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

Commit 8f3abc06 authored by Danny Baumann's avatar Danny Baumann Committed by Steve Kondik
Browse files

Don't recreate keyguard for MCC/MNC changes.

Change-Id: I9e5dfdb12df522dc7dd50c26f35aba26b1bbe44e
parent 2c93da22
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ public class KeyguardViewManager {
        private static final int BACKGROUND_COLOR = 0x70000000;

        private Drawable mCustomBackground;
        private Configuration mLastConfiguration;

        // This is a faster way to draw the background on devices without hardware acceleration
        private final Drawable mBackgroundDrawable = new Drawable() {
@@ -198,6 +199,7 @@ public class KeyguardViewManager {
        public ViewManagerHost(Context context) {
            super(context);
            setBackground(mBackgroundDrawable);
            mLastConfiguration = context.getResources().getConfiguration();
        }

        public void drawToCanvas(Canvas canvas, Drawable drawable) {
@@ -286,12 +288,16 @@ public class KeyguardViewManager {
        @Override
        protected void onConfigurationChanged(Configuration newConfig) {
            super.onConfigurationChanged(newConfig);
            if (mKeyguardHost.getVisibility() == View.VISIBLE) {
            int diff = newConfig.diff(mLastConfiguration);
            if ((diff & ~(ActivityInfo.CONFIG_MCC | ActivityInfo.CONFIG_MNC)) == 0) {
                if (DEBUG) Log.v(TAG, "onConfigurationChanged: no relevant changes");
            } else if (mKeyguardHost.getVisibility() == View.VISIBLE) {
                // only propagate configuration messages if we're currently showing
                maybeCreateKeyguardLocked(shouldEnableScreenRotation(), true, null);
            } else {
                if (DEBUG) Log.v(TAG, "onConfigurationChanged: view not visible");
            }
            mLastConfiguration = newConfig;
        }

        @Override