summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jorim Jaggi <jjaggi@google.com> 2014-11-13 23:54:15 +0100
committer Jorim Jaggi <jjaggi@google.com> 2014-11-17 19:15:22 +0100
commit235607589c78d952b5210e27738df5bc37a63e38 (patch)
tree47ad62a7cf4b9c75fbe88f5e4979b9a44dfec9f8
parent8c8d8b1012b409b653679a8f0236d57de346f4d7 (diff)
Always set correct policy visibility
Windows without a surface didn't get the correct policy visibility applied after dismissing lockscreen. Thus, when launching something from lockscreen, home activity was hidden but never set to visible again. Before executing the transition to home, we didn't consider home as a wallpaper target because it was still invisible, and thus we picked the wrong transition. Always applying policy visibility when lockscreen changes fixes this outdated state. Bug: 18369599 Change-Id: I2933eaf0ab55fe31cb382c46c411033e33a756e0
-rw-r--r--services/core/java/com/android/server/wm/WindowAnimator.java50
1 files changed, 32 insertions, 18 deletions
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java
index 345e8af9a996..fe2e0a65a209 100644
--- a/services/core/java/com/android/server/wm/WindowAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowAnimator.java
@@ -221,6 +221,24 @@ public class WindowAnimator {
}
}
+ private boolean shouldForceHide(WindowState win) {
+ final WindowState imeTarget = mService.mInputMethodTarget;
+ final boolean showImeOverKeyguard = imeTarget != null && imeTarget.isVisibleNow() &&
+ (imeTarget.getAttrs().flags & FLAG_SHOW_WHEN_LOCKED) != 0;
+
+ final WindowState winShowWhenLocked = (WindowState) mPolicy.getWinShowWhenLockedLw();
+ final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ?
+ null : winShowWhenLocked.mAppToken;
+ final boolean hideWhenLocked =
+ !(((win.mIsImWindow || imeTarget == win) && showImeOverKeyguard)
+ || (appShowWhenLocked != null && (appShowWhenLocked == win.mAppToken ||
+ // Show error dialogs over apps that dismiss keyguard.
+ (win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0)));
+ return ((mForceHiding == KEYGUARD_ANIMATING_IN)
+ && (!win.mWinAnimator.isAnimating() || hideWhenLocked))
+ || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked);
+ }
+
private void updateWindowsLocked(final int displayId) {
++mAnimTransactionSequence;
@@ -256,14 +274,6 @@ public class WindowAnimator {
mForceHiding = KEYGUARD_NOT_SHOWN;
- final WindowState imeTarget = mService.mInputMethodTarget;
- final boolean showImeOverKeyguard = imeTarget != null && imeTarget.isVisibleNow() &&
- (imeTarget.getAttrs().flags & FLAG_SHOW_WHEN_LOCKED) != 0;
-
- final WindowState winShowWhenLocked = (WindowState) mPolicy.getWinShowWhenLockedLw();
- final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ?
- null : winShowWhenLocked.mAppToken;
-
boolean wallpaperInUnForceHiding = false;
boolean startingInUnForceHiding = false;
ArrayList<WindowStateAnimator> unForceHiding = null;
@@ -272,7 +282,8 @@ public class WindowAnimator {
WindowState win = windows.get(i);
WindowStateAnimator winAnimator = win.mWinAnimator;
final int flags = win.mAttrs.flags;
-
+ boolean canBeForceHidden = mPolicy.canBeForceHidden(win, win.mAttrs);
+ boolean shouldBeForceHidden = shouldForceHide(win);
if (winAnimator.mSurfaceControl != null) {
final boolean wasAnimating = winAnimator.mWasAnimating;
final boolean nowAnimating = winAnimator.stepAnimationLocked(mCurrentTime);
@@ -332,15 +343,8 @@ public class WindowAnimator {
+ " vis=" + win.mViewVisibility
+ " hidden=" + win.mRootToken.hidden
+ " anim=" + win.mWinAnimator.mAnimation);
- } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) {
- final boolean hideWhenLocked =
- !(((win.mIsImWindow || imeTarget == win) && showImeOverKeyguard)
- || (appShowWhenLocked != null && (appShowWhenLocked == win.mAppToken ||
- // Show error dialogs over apps that dismiss keyguard.
- (win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0)));
- if (((mForceHiding == KEYGUARD_ANIMATING_IN)
- && (!winAnimator.isAnimating() || hideWhenLocked))
- || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) {
+ } else if (canBeForceHidden) {
+ if (shouldBeForceHidden) {
if (!win.hideLw(false, false)) {
// Was already hidden
continue;
@@ -411,6 +415,16 @@ public class WindowAnimator {
}
}
+ // If the window doesn't have a surface, the only thing we care about is the correct
+ // policy visibility.
+ else if (canBeForceHidden) {
+ if (shouldBeForceHidden) {
+ win.hideLw(false, false);
+ } else {
+ win.showLw(false, false);
+ }
+ }
+
final AppWindowToken atoken = win.mAppToken;
if (winAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW) {
if (atoken == null || atoken.allDrawn) {