Fix race condition in WindowManagerService.disableKeyguard()
TokenWatcher.acquire() synchronizes on mTokens, not this, so we need to synchronize on mKeyguardDisabled in disableKeyguard() to synchronize properly with reenableKeyguard(). This should fix b/2180142 (Stuck in enable keyguard when receiving phone call) Change-Id: Iad66a2748c7fbf2c516fdb8a00988696719ea80c Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
@@ -3971,7 +3971,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
throw new SecurityException("Requires DISABLE_KEYGUARD permission");
|
||||
}
|
||||
mKeyguardDisabled.acquire(token, tag);
|
||||
synchronized (mKeyguardDisabled) {
|
||||
mKeyguardDisabled.acquire(token, tag);
|
||||
}
|
||||
}
|
||||
|
||||
public void reenableKeyguard(IBinder token) {
|
||||
|
||||
Reference in New Issue
Block a user