diff options
author | Craig Mautner <cmautner@google.com> | 2014-03-19 19:48:38 -0700 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2014-03-22 17:15:52 -0700 |
commit | 0392442de8295caf1b9ce9dc5fb19f9798b54972 (patch) | |
tree | c6a02e8431aba291fa20962b3b6d88df043c5eb6 /policy | |
parent | 6eb2810318262ff36014c52384ed3cdea19bd34e (diff) | |
download | frameworks_base-0392442de8295caf1b9ce9dc5fb19f9798b54972.zip frameworks_base-0392442de8295caf1b9ce9dc5fb19f9798b54972.tar.gz frameworks_base-0392442de8295caf1b9ce9dc5fb19f9798b54972.tar.bz2 |
Allow FLAG_SHOW_WHEN_LOCKED to apply to dialogs
Previous fix to keep non-show-when-locked windows hid dialogs from
activities that had asked to be show-when-locked. That was too
restrictive.
Fixes bug 13225149.
Change-Id: I39ae9d7cbcc9b5109257f732d027bda3a2de65e4
Diffstat (limited to 'policy')
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 951925b..3f4bcd4 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -153,6 +153,7 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; +import java.util.HashSet; /** * WindowManagerPolicy implementation for the Android phone UI. This @@ -408,7 +409,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { static final Rect mTmpNavigationFrame = new Rect(); WindowState mTopFullscreenOpaqueWindowState; - boolean mHideWindowBehindKeyguard; + HashSet<IApplicationToken> mAppsToBeHidden = new HashSet<IApplicationToken>(); boolean mTopIsFullscreen; boolean mForceStatusBar; boolean mForceStatusBarFromKeyguard; @@ -2935,7 +2936,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight) { mTopFullscreenOpaqueWindowState = null; - mHideWindowBehindKeyguard = false; + mAppsToBeHidden.clear(); mForceStatusBar = false; mForceStatusBarFromKeyguard = false; @@ -2978,12 +2979,17 @@ public class PhoneWindowManager implements WindowManagerPolicy { final boolean showWhenLocked = (attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0; if (appWindow) { + if (showWhenLocked) { + mAppsToBeHidden.remove(win.getAppToken()); + } else { + mAppsToBeHidden.add(win.getAppToken()); + } if (attrs.x == 0 && attrs.y == 0 && attrs.width == WindowManager.LayoutParams.MATCH_PARENT && attrs.height == WindowManager.LayoutParams.MATCH_PARENT) { if (DEBUG_LAYOUT) Slog.v(TAG, "Fullscreen window: " + win); mTopFullscreenOpaqueWindowState = win; - if (!mHideWindowBehindKeyguard) { + if (mAppsToBeHidden.isEmpty()) { if (showWhenLocked) { if (DEBUG_LAYOUT) Slog.v(TAG, "Setting mHideLockScreen to true by win " + win); mHideLockScreen = true; @@ -3001,8 +3007,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) { mAllowLockscreenWhenOn = true; } - } else if (!showWhenLocked) { - mHideWindowBehindKeyguard = true; } } } |