summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author tiger_huang <tiger_huang@htc.com> 2015-03-31 22:09:49 +0800
committer tiger_huang <tiger_huang@htc.com> 2015-03-31 22:09:49 +0800
commit517129cfa4cbbe21c5b391520cbf24fd53044781 (patch)
tree0561dedad49bdb763236a305d1c66fff2f2435a9
parent631565abd6cadd65befe197afa7bac0d44f70fb2 (diff)
Prevent infinite layout and wallpaper flashing
The original logic would cause mTopFullscreenOpaqueWindowState to be hidden in PhoneWindowManager.finishPostLayoutPolicyLw(), and to be shown in WindowAnimator.updateWindowsLocked() continuously if there is a show-when-locked dialog. The wallpaper would be hidden after the original wallpaper target is hidden, before the new wallpaper target is shown. https://code.google.com/p/android/issues/detail?id=162495 Change-Id: I918e0fa03eec38d9f0c07150c17013c6c21683cb
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 69a4ac02a058..af5025b8d151 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -4120,8 +4120,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
@Override
public int finishPostLayoutPolicyLw() {
- if (mWinShowWhenLocked != null &&
- mWinShowWhenLocked != mTopFullscreenOpaqueWindowState) {
+ if (mWinShowWhenLocked != null && mTopFullscreenOpaqueWindowState != null &&
+ mWinShowWhenLocked.getAppToken() != mTopFullscreenOpaqueWindowState.getAppToken()
+ && isKeyguardLocked()) {
// A dialog is dismissing the keyguard. Put the wallpaper behind it and hide the
// fullscreen window.
// TODO: Make sure FLAG_SHOW_WALLPAPER is restored when dialog is dismissed. Or not.