Bug 1187382 - Revise AppConstants.Versions after release of Android M. The assignment logic has also been changed appropriately. r=sebastian

This commit is contained in:
cijo 2016-03-07 04:18:00 +01:00
parent 63c24c282a
commit 1cf47b8f45
4 changed files with 4 additions and 8 deletions

View File

@ -63,8 +63,7 @@ public class AppConstants {
* If our MAX_SDK_VERSION is lower than ICS, we must not be an ICS device.
* Otherwise, we need a range check.
*/
public static final boolean preM = MAX_SDK_VERSION < 23 ||
(MIN_SDK_VERSION < 23 && Build.VERSION.SDK_INT < 23 && !Build.VERSION.RELEASE.equals("M"));
public static final boolean preMarshmallow = MAX_SDK_VERSION < 23 || (MIN_SDK_VERSION < 23 && Build.VERSION.SDK_INT < 23);
public static final boolean preLollipop = MAX_SDK_VERSION < 21 || (MIN_SDK_VERSION < 21 && Build.VERSION.SDK_INT < 21);
public static final boolean preJBMR2 = MAX_SDK_VERSION < 18 || (MIN_SDK_VERSION < 18 && Build.VERSION.SDK_INT < 18);
public static final boolean preJBMR1 = MAX_SDK_VERSION < 17 || (MIN_SDK_VERSION < 17 && Build.VERSION.SDK_INT < 17);

View File

@ -28,7 +28,7 @@ class AndroidImportPreference extends MultiPrefMultiChoicePreference {
public static class Handler implements GeckoPreferences.PrefHandler {
public boolean setupPref(Context context, Preference pref) {
// Feature disabled on devices running Android M+ (Bug 1183559)
return Versions.preM && Restrictions.isAllowed(context, Restrictable.IMPORT_SETTINGS);
return Versions.preMarshmallow && Restrictions.isAllowed(context, Restrictable.IMPORT_SETTINGS);
}
public void onChange(Context context, Preference pref, Object newValue) { }

View File

@ -14,15 +14,12 @@ import org.mozilla.gecko.R;
import org.mozilla.gecko.preferences.GeckoPreferences;
import org.mozilla.gecko.util.ThreadUtils;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Build;
import android.provider.Settings;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.ContextCompat;
@ -64,7 +61,7 @@ public class TabQueueHelper {
* @return true if the specified context can draw on top of other apps, false otherwise.
*/
public static boolean canDrawOverlays(Context context) {
if (AppConstants.Versions.preM) {
if (AppConstants.Versions.preMarshmallow) {
return true; // We got the permission at install time.
}

View File

@ -233,7 +233,7 @@ public class TabQueueService extends Service {
@TargetApi(Build.VERSION_CODES.M)
private void showSettingsNotification() {
if (AppConstants.Versions.preM) {
if (AppConstants.Versions.preMarshmallow) {
return;
}