Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4f09a5f authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Updating version check method names" into ub-launcher3-master

parents 8b16b96b f5e37446
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ public class Launcher extends Activity
                        ? app.getInvariantDeviceProfile().landscapeProfile
                        : app.getInvariantDeviceProfile().portraitProfile;

        if (Utilities.isNycOrAbove() && isInMultiWindowMode()) {
        if (Utilities.ATLEAST_NOUGAT && isInMultiWindowMode()) {
            Display display = getWindowManager().getDefaultDisplay();
            Point mwSize = new Point();
            display.getSize(mwSize);
@@ -466,7 +466,7 @@ public class Launcher extends Activity

    private void loadExtractedColorsAndColorItems() {
        // TODO: do this in pre-N as well, once the extraction part is complete.
        if (Utilities.isNycOrAbove()) {
        if (Utilities.ATLEAST_NOUGAT) {
            mExtractedColors.load(this);
            mHotseat.updateColor(mExtractedColors, !mPaused);
            mWorkspace.getPageIndicator().updateColor(mExtractedColors);
@@ -913,7 +913,7 @@ public class Launcher extends Activity
            mLauncherCallbacks.onStop();
        }

        if (Utilities.isNycMR1OrAbove()) {
        if (Utilities.ATLEAST_NOUGAT_MR1) {
            mAppWidgetHost.stopListening();
        }
    }
@@ -927,7 +927,7 @@ public class Launcher extends Activity
            mLauncherCallbacks.onStart();
        }

        if (Utilities.isNycMR1OrAbove()) {
        if (Utilities.ATLEAST_NOUGAT_MR1) {
            mAppWidgetHost.startListening();
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ public class LauncherAppState {
        filter.addAction(Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE);
        filter.addAction(Intent.ACTION_MANAGED_PROFILE_UNLOCKED);
        // For extracting colors from the wallpaper
        if (Utilities.isNycOrAbove()) {
        if (Utilities.ATLEAST_NOUGAT) {
            // TODO: add a broadcast entry to the manifest for pre-N.
            filter.addAction(Intent.ACTION_WALLPAPER_CHANGED);
        }
+1 −1
Original line number Diff line number Diff line
@@ -2692,7 +2692,7 @@ public class LauncherModel extends BroadcastReceiver
     * use partial updates similar to {@link UserManagerCompat}
     */
    public void refreshShortcutsIfRequired() {
        if (Utilities.isNycMR1OrAbove()) {
        if (Utilities.ATLEAST_NOUGAT_MR1) {
            sWorker.removeCallbacks(mShortcutPermissionCheckRunnable);
            sWorker.post(mShortcutPermissionCheckRunnable);
        }
+6 −8
Original line number Diff line number Diff line
@@ -84,13 +84,11 @@ public final class Utilities {
    private static final int[] sLoc0 = new int[2];
    private static final int[] sLoc1 = new int[2];

    public static boolean isNycMR1OrAbove() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1;
    }
    public static final boolean ATLEAST_NOUGAT_MR1 =
        Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1;

    public static boolean isNycOrAbove() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
    }
    public static final boolean ATLEAST_NOUGAT =
        Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;

    public static final boolean ATLEAST_MARSHMALLOW =
            Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
@@ -137,7 +135,7 @@ public final class Utilities {
    }

    public static boolean getAllowRotationDefaultValue(Context context) {
        if (isNycOrAbove()) {
        if (ATLEAST_NOUGAT) {
            // If the device was scaled, used the original dimensions to determine if rotation
            // is allowed of not.
            Resources res = context.getResources();
@@ -619,7 +617,7 @@ public final class Utilities {
    }

    public static boolean isWallpaperAllowed(Context context) {
        if (isNycOrAbove()) {
        if (ATLEAST_NOUGAT) {
            try {
                WallpaperManager wm = context.getSystemService(WallpaperManager.class);
                return (Boolean) wm.getClass().getDeclaredMethod("isSetWallpaperAllowed")
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ public class AlphabeticIndexCompat {
        BaseIndex index = null;

        try {
            if (Utilities.isNycOrAbove()) {
            if (Utilities.ATLEAST_NOUGAT) {
                index = new AlphabeticIndexVN(context);
            }
        } catch (Exception e) {
Loading