Fix light status bar when transitioning home -> recents

In the home -> recents animation home is exiting but recents
is still translucent because this is how the animation is
designed. In that case, mWinAnimator.mShownAlpha is 0 such that
mTopFullscreenOpaque becomes null, creating a flicker if both
home and recents have light status bar flag set.

We fix this by refining this condition: It was added such that
a starting window for an activity that might never become visible
does not affect the systemUI flags. Now, we only avoid affecting
the flags if a dummy animation is set (a transition is about to
start) and shown alpha is 0, which indicates that the window is
entering.

Test: go/wm-smoke
Test: With light wallpaper, go home -> recents
Test: All other common transitions with light status bar
Test: Open camera, go to gallery, go home, double click power
button to reopen camera (regression test)

Change-Id: I6cddc3b8eb09c547618d7572195889de7766d838
Fixes: 65398267
This commit is contained in:
Jorim Jaggi
2017-09-11 16:58:53 +02:00
parent 04b6095082
commit b7202a8339

View File

@@ -1484,7 +1484,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// TODO: Another visibility method that was added late in the release to minimize risk.
@Override
public boolean canAffectSystemUiFlags() {
final boolean shown = mWinAnimator.getShown() && mWinAnimator.mShownAlpha > 0f;
final boolean shown = mWinAnimator.getShown();
// We only consider the app to be exiting when the animation has started. After the app
// transition is executed the windows are marked exiting before the new windows have been
@@ -1498,7 +1498,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
final boolean exiting = exitingSelf || mDestroying || appExiting;
final boolean translucent = mAttrs.alpha == 0.0f;
return shown && !exiting && !translucent;
// If we are entering with a dummy animation, avoid affecting SystemUI flags until the
// transition is starting.
final boolean enteringWithDummyAnimation =
mWinAnimator.isDummyAnimation() && mWinAnimator.mShownAlpha == 0f;
return shown && !exiting && !translucent && !enteringWithDummyAnimation;
}
/**