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

Commit 99bd4917 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

Keyguard: Fix configuration change observer

Change I9e5dfdb12df522dc7dd50c26f35aba26b1bbe44e made recreations
only happen when a stored copy of the previous configuration differs
from the current one. But "configuration = otherConfiguration" creates
a reference to the original object, not a copy, so newConfig.diff(mLastConfiguration)
always returned zero. Fixit by creating an actual deep copy of the
Configuration object.

Change-Id: I236932dfc0e121dd83212882b4fe71306c8a3fab
parent debb17a1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ public class KeyguardViewManager {
        public ViewManagerHost(Context context) {
            super(context);
            setBackground(mBackgroundDrawable);
            mLastConfiguration = context.getResources().getConfiguration();
            mLastConfiguration = new Configuration(context.getResources().getConfiguration());
        }

        public void drawToCanvas(Canvas canvas, Drawable drawable) {
@@ -297,7 +297,7 @@ public class KeyguardViewManager {
            } else {
                if (DEBUG) Log.v(TAG, "onConfigurationChanged: view not visible");
            }
            mLastConfiguration = newConfig;
            mLastConfiguration = new Configuration(newConfig);
        }

        @Override