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
This commit is contained in:
Craig Mautner
2012-11-08 22:44:47 -08:00
parent c1ae43ade0
commit d86159067f

View File

@@ -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