From d86159067f4feed23b5057eff726cef4a4af7f2b Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Thu, 8 Nov 2012 22:44:47 -0800 Subject: [PATCH] Synchronize access to Locked methods. DO NOT MERGE onConfigurationChange was calling maybeCreateKeyguardLocked without actually holding the lock. Now the call to maybeCreateKeyguardLocked is synchronized. May fix bug 7094175. Change-Id: I3171a18e25f54506f614f9c2cc09aa20080bd6bb --- .../impl/keyguard/KeyguardViewManager.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java index 76ba811aa0aec..4e8aba78946fb 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java @@ -129,12 +129,19 @@ public class KeyguardViewManager { @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); - 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"); - } + post(new Runnable() { + @Override + public void run() { + synchronized (KeyguardViewManager.this) { + 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"); + } + } + } + }); } @Override