Merge "Fix IME Keyguard exit animation" into oc-dev

am: b4566b30fc

Change-Id: Ia857135f520ca1633f1ca4d53379ca7135c217b4
This commit is contained in:
Jorim Jaggi
2017-05-09 17:40:27 +00:00
committed by android-build-merger
2 changed files with 9 additions and 30 deletions

View File

@@ -2494,7 +2494,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
void startKeyguardExitOnNonAppWindows(boolean onWallpaper, boolean goingToShade) {
final WindowManagerPolicy policy = mService.mPolicy;
forAllWindows(w -> {
if (w.mAppToken == null && policy.canBeHiddenByKeyguardLw(w)) {
if (w.mAppToken == null && policy.canBeHiddenByKeyguardLw(w)
&& w.wouldBeVisibleIfPolicyIgnored() && !w.isVisible()) {
w.mWinAnimator.setAnimation(
policy.createHiddenByKeyguardExit(onWallpaper, goingToShade));
}

View File

@@ -1292,36 +1292,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
@Override
boolean isVisible() {
// TODO: The check for hiddenRequested is commented out below, because the window can still
// be visible on screen when the flag is true. We would like the isVisible() method to
// return an answer closer to if the window is truly visible (can't be an exact answer
// without checking the surface state), so comment out the check for now so we can test to
// see what problem it causes.
// If it doesn't cause any issues, then we can remove just before we lock down the current
// release (O) and also consolidate this method with #isVisibleUnchecked() and possibly
// other methods like isVisibleNow().
// If it does cause problems, then we can look if there are other ways to solve the problem.
// If there isn't then uncomment and document here why it is needed.
if (/*(mAppToken == null || !mAppToken.hiddenRequested) && */isVisibleUnchecked()
// TODO: The window isn't considered visible when the token is hidden, however
// uncommenting the check below breaks the visual transition from an app to the launcher
// if the home buttons is pressed. Need to investigate an fix that issue before
// uncommenting.
/* && !mToken.hidden*/) {
// Is this window visible? It is not visible if there is no surface, or we are in the
// process of running an exit animation that will remove the surface, or its app token
// has been hidden.
return true;
}
return false;
return wouldBeVisibleIfPolicyIgnored() && mPolicyVisibility;
}
/**
* Does the minimal check for visibility. Callers generally want to use one of the public
* methods as they perform additional checks on the app token.
* TODO: See if there are other places we can use this check below instead of duplicating...
* @return True if the window would be visible if we'd ignore policy visibility, false
* otherwise.
*/
private boolean isVisibleUnchecked() {
boolean wouldBeVisibleIfPolicyIgnored() {
return mHasSurface && mPolicyVisibility && !isParentWindowHidden()
&& !mAnimatingExit && !mDestroying && (!mIsWallpaper || mWallpaperVisible);
}
@@ -1338,7 +1316,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// TODO: Can we consolidate this with #isVisible() or have a more appropriate name for this?
boolean isWinVisibleLw() {
return (mAppToken == null || !mAppToken.hiddenRequested || mAppToken.mAppAnimator.animating)
&& isVisibleUnchecked();
&& isVisible();
}
/**
@@ -1347,7 +1325,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
*/
boolean isVisibleNow() {
return (!mToken.hidden || mAttrs.type == TYPE_APPLICATION_STARTING)
&& isVisibleUnchecked();
&& isVisible();
}
/**
@@ -2063,7 +2041,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// If app died visible, apply a dim over the window to indicate that it's inactive
dc.mDimLayerController.applyDimAbove(getDimLayerUser(), mWinAnimator);
} else if ((mAttrs.flags & FLAG_DIM_BEHIND) != 0
&& dc != null && !mAnimatingExit && isVisibleUnchecked()) {
&& dc != null && !mAnimatingExit && isVisible()) {
dc.mDimLayerController.applyDimBehind(getDimLayerUser(), mWinAnimator);
}
}