Skip to content

Commit d861590

Browse files
author
Craig Mautner
committed
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
1 parent c1ae43a commit d861590

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,19 @@ public ViewManagerHost(Context context) {
129129
@Override
130130
protected void onConfigurationChanged(Configuration newConfig) {
131131
super.onConfigurationChanged(newConfig);
132-
if (mKeyguardHost.getVisibility() == View.VISIBLE) {
133-
// only propagate configuration messages if we're currently showing
134-
maybeCreateKeyguardLocked(shouldEnableScreenRotation(), true, null);
135-
} else {
136-
if (DEBUG) Log.v(TAG, "onConfigurationChanged: view not visible");
137-
}
132+
post(new Runnable() {
133+
@Override
134+
public void run() {
135+
synchronized (KeyguardViewManager.this) {
136+
if (mKeyguardHost.getVisibility() == View.VISIBLE) {
137+
// only propagate configuration messages if we're currently showing
138+
maybeCreateKeyguardLocked(shouldEnableScreenRotation(), true, null);
139+
} else {
140+
if (DEBUG) Log.v(TAG, "onConfigurationChanged: view not visible");
141+
}
142+
}
143+
}
144+
});
138145
}
139146

140147
@Override

0 commit comments

Comments
 (0)