From e8befb35313e37f519ef61b35669d848eb464437 Mon Sep 17 00:00:00 2001 From: tiger_huang Date: Mon, 29 Jun 2015 17:17:30 +0800 Subject: [PATCH] Use the correct lock to protect members in PolicyControl Members in PolicyControl can be accessed by multiple threads via the public functions called by PhoneWindowManager. Most of the functions are called with the window-manager-lock held, but reloadFromSetting() is an exception. In this patch, we acquire the window-manager-lock before calling reloadFromSetting() to ensure accessing the members with the same lock held. Change-Id: I54ac5cab2a2d74c568fa96145f7a6741c6d99e36 --- .../com/android/internal/policy/impl/PhoneWindowManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index d4c530bbad3d3..1e047b930630f 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -1567,6 +1567,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mImmersiveModeConfirmation != null) { mImmersiveModeConfirmation.loadSetting(mCurrentUserId); } + } + synchronized (mWindowManagerFuncs.getWindowManagerLock()) { PolicyControl.reloadFromSetting(mContext); } if (updateRotation) {