summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2012-07-11 14:37:39 -0700
committerCraig Mautner <cmautner@google.com>2012-07-11 14:38:29 -0700
commitf333f5f67a6e2e943123797d8752f946c9a4b399 (patch)
tree8f9d669cff5cc860c0a92848033d79fdfffd746c
parent04ca8e577859235a68fa9a5268af528d547310be (diff)
downloadframeworks_base-f333f5f67a6e2e943123797d8752f946c9a4b399.zip
frameworks_base-f333f5f67a6e2e943123797d8752f946c9a4b399.tar.gz
frameworks_base-f333f5f67a6e2e943123797d8752f946c9a4b399.tar.bz2
Handle keyguard visibility states separately. DO NOT MERGE
Previous to this change the forceHiding variable was a boolean. This change recognizes the different configurations of the keyguard by defining separate states for forceHiding and testing for window visibility differently in each state. Fixes bug 6786114. Change-Id: I3460c45ea6da772a4ff76bb016de7aa4b051a673
-rw-r--r--services/java/com/android/server/wm/WindowAnimator.java29
1 files changed, 23 insertions, 6 deletions
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index db3b2bd..62cf711 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -32,6 +32,13 @@ import java.util.ArrayList;
public class WindowAnimator {
private static final String TAG = "WindowAnimator";
+ // mForceHiding states.
+ private static final int KEYGUARD_NOT_SHOWN = 0;
+ private static final int KEYGUARD_ANIMATING_IN = 1;
+ private static final int KEYGUARD_SHOWN = 2;
+ private static final int KEYGUARD_ANIMATING_OUT = 3;
+ int mForceHiding;
+
final WindowManagerService mService;
final Context mContext;
final WindowManagerPolicy mPolicy;
@@ -39,7 +46,6 @@ public class WindowAnimator {
ArrayList<WindowStateAnimator> mWinAnimators = new ArrayList<WindowStateAnimator>();
boolean mAnimating;
- boolean mForceHiding;
WindowState mWindowAnimationBackground;
int mWindowAnimationBackgroundColor;
int mAdjResult;
@@ -279,8 +285,16 @@ public class WindowAnimator {
}
mService.mFocusMayChange = true;
}
- if (win.isReadyForDisplay() && winAnimator.mAnimationIsEntrance) {
- mForceHiding = true;
+ if (win.isReadyForDisplay()) {
+ if (nowAnimating) {
+ if (winAnimator.mAnimationIsEntrance) {
+ mForceHiding = KEYGUARD_ANIMATING_IN;
+ } else {
+ mForceHiding = KEYGUARD_ANIMATING_OUT;
+ }
+ } else {
+ mForceHiding = KEYGUARD_SHOWN;
+ }
}
if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
"Force hide " + mForceHiding
@@ -292,9 +306,12 @@ public class WindowAnimator {
+ " hidden=" + win.mRootToken.hidden
+ " anim=" + win.mWinAnimator.mAnimation);
} else if (mPolicy.canBeForceHidden(win, win.mAttrs)) {
+ final boolean hideWhenLocked =
+ (winAnimator.mAttrFlags & FLAG_SHOW_WHEN_LOCKED) == 0;
final boolean changed;
- if (mForceHiding && (!winAnimator.isAnimating()
- || (winAnimator.mAttrFlags & FLAG_SHOW_WHEN_LOCKED) == 0)) {
+ if (((mForceHiding == KEYGUARD_ANIMATING_IN)
+ && (!winAnimator.isAnimating() || hideWhenLocked))
+ || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) {
changed = win.hideLw(false, false);
if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG,
"Now policy hidden: " + win);
@@ -411,7 +428,7 @@ public class WindowAnimator {
}
private void performAnimationsLocked() {
- mForceHiding = false;
+ mForceHiding = KEYGUARD_NOT_SHOWN;
mDetachedWallpaper = null;
mWindowAnimationBackground = null;
mWindowAnimationBackgroundColor = 0;