Fix stuck activity

Assume the following sequence of events:

- prepareAppTransition
- setVisibility(app)
- okToAnimate -> false
- setVisibility(app)

In this case, the first setVisibility call sets a dummy animation
but the second setVisibility call removes the app from
mOpeningApps but does not clear out the animation. In that case,
the app is stuck with the dummy animation set that will get never
cleared.

To fix this, we always reset the animation if a dummy animation is
set when changing the visibility, no matter we use a transit or
not.

Test: Unlock with fingerprint from AOD to homescreen
Change-Id: I0dbe2d9836238aba7f16d3e45649fd4b82ff52f6
Fixes: 65067824
This commit is contained in:
Jorim Jaggi
2017-08-31 17:28:27 +02:00
parent c1235a1ff2
commit 4d1835db5d
2 changed files with 7 additions and 4 deletions

View File

@@ -450,7 +450,7 @@ public class AppWindowAnimator {
return isAnimating;
}
void dump(PrintWriter pw, String prefix, boolean dumpAll) {
void dump(PrintWriter pw, String prefix) {
pw.print(prefix); pw.print("mAppToken="); pw.println(mAppToken);
pw.print(prefix); pw.print("mAnimator="); pw.println(mAnimator);
pw.print(prefix); pw.print("freezingScreen="); pw.print(freezingScreen);

View File

@@ -368,10 +368,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
boolean runningAppAnimation = false;
if (mAppAnimator.animation == AppWindowAnimator.sDummyAnimation) {
mAppAnimator.setNullAnimation();
}
if (transit != AppTransition.TRANSIT_UNSET) {
if (mAppAnimator.animation == AppWindowAnimator.sDummyAnimation) {
mAppAnimator.setNullAnimation();
}
if (mService.applyAnimationLocked(this, lp, transit, visible, isVoiceInteraction)) {
delayed = runningAppAnimation = true;
}
@@ -1759,6 +1759,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (mRemovingFromDisplay) {
pw.println(prefix + "mRemovingFromDisplay=" + mRemovingFromDisplay);
}
if (mAppAnimator.isAnimating()) {
mAppAnimator.dump(pw, prefix + " ");
}
}
@Override