Merge "Handle keyguard visibility states separately. DO NOT MERGE" into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
dcddea9530
@@ -32,6 +32,13 @@ import java.util.ArrayList;
|
|||||||
public class WindowAnimator {
|
public class WindowAnimator {
|
||||||
private static final String TAG = "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 WindowManagerService mService;
|
||||||
final Context mContext;
|
final Context mContext;
|
||||||
final WindowManagerPolicy mPolicy;
|
final WindowManagerPolicy mPolicy;
|
||||||
@@ -39,7 +46,6 @@ public class WindowAnimator {
|
|||||||
ArrayList<WindowStateAnimator> mWinAnimators = new ArrayList<WindowStateAnimator>();
|
ArrayList<WindowStateAnimator> mWinAnimators = new ArrayList<WindowStateAnimator>();
|
||||||
|
|
||||||
boolean mAnimating;
|
boolean mAnimating;
|
||||||
boolean mForceHiding;
|
|
||||||
WindowState mWindowAnimationBackground;
|
WindowState mWindowAnimationBackground;
|
||||||
int mWindowAnimationBackgroundColor;
|
int mWindowAnimationBackgroundColor;
|
||||||
int mAdjResult;
|
int mAdjResult;
|
||||||
@@ -279,8 +285,16 @@ public class WindowAnimator {
|
|||||||
}
|
}
|
||||||
mService.mFocusMayChange = true;
|
mService.mFocusMayChange = true;
|
||||||
}
|
}
|
||||||
if (win.isReadyForDisplay() && winAnimator.mAnimationIsEntrance) {
|
if (win.isReadyForDisplay()) {
|
||||||
mForceHiding = true;
|
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,
|
if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
|
||||||
"Force hide " + mForceHiding
|
"Force hide " + mForceHiding
|
||||||
@@ -292,9 +306,12 @@ public class WindowAnimator {
|
|||||||
+ " hidden=" + win.mRootToken.hidden
|
+ " hidden=" + win.mRootToken.hidden
|
||||||
+ " anim=" + win.mWinAnimator.mAnimation);
|
+ " anim=" + win.mWinAnimator.mAnimation);
|
||||||
} else if (mPolicy.canBeForceHidden(win, win.mAttrs)) {
|
} else if (mPolicy.canBeForceHidden(win, win.mAttrs)) {
|
||||||
|
final boolean hideWhenLocked =
|
||||||
|
(winAnimator.mAttrFlags & FLAG_SHOW_WHEN_LOCKED) == 0;
|
||||||
final boolean changed;
|
final boolean changed;
|
||||||
if (mForceHiding && (!winAnimator.isAnimating()
|
if (((mForceHiding == KEYGUARD_ANIMATING_IN)
|
||||||
|| (winAnimator.mAttrFlags & FLAG_SHOW_WHEN_LOCKED) == 0)) {
|
&& (!winAnimator.isAnimating() || hideWhenLocked))
|
||||||
|
|| ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) {
|
||||||
changed = win.hideLw(false, false);
|
changed = win.hideLw(false, false);
|
||||||
if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG,
|
if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG,
|
||||||
"Now policy hidden: " + win);
|
"Now policy hidden: " + win);
|
||||||
@@ -411,7 +428,7 @@ public class WindowAnimator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void performAnimationsLocked() {
|
private void performAnimationsLocked() {
|
||||||
mForceHiding = false;
|
mForceHiding = KEYGUARD_NOT_SHOWN;
|
||||||
mDetachedWallpaper = null;
|
mDetachedWallpaper = null;
|
||||||
mWindowAnimationBackground = null;
|
mWindowAnimationBackground = null;
|
||||||
mWindowAnimationBackgroundColor = 0;
|
mWindowAnimationBackgroundColor = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user