Set occluded state on remote animation cancel.

The launch animator cancel method can be
called by other methods within the activity
launch animator, which is very dangerous
since it can set the occluded state incorrectly.

Bug: 235463625
Test: occlude and unocclude repeatedly to trigger cancel/restart
Change-Id: I1a8cc95876c2966009c9cfa8dbe2471a360930a7
This commit is contained in:
Josh Tsuji
2022-06-17 16:07:40 -07:00
committed by Issei Suzuki
parent c77d9bda04
commit bdfb30745c

View File

@@ -842,7 +842,6 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
@Override
public void onLaunchAnimationCancelled() {
setOccluded(true /* occluded */, false /* animate */);
Log.d(TAG, "Occlude launch animation cancelled. Occluded state is now: "
+ mOccluded);
}
@@ -915,7 +914,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
mUnoccludeAnimator.cancel();
}
setOccluded(isKeyguardOccluded, false /* animate */);
setOccluded(isKeyguardOccluded /* isOccluded */, false /* animate */);
Log.d(TAG, "Unocclude animation cancelled. Occluded state is now: "
+ mOccluded);
}
@@ -3195,7 +3194,10 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
@Override
public void onAnimationCancelled(boolean isKeyguardOccluded) throws RemoteException {
super.onAnimationCancelled(isKeyguardOccluded);
Log.d(TAG, "Occlude launch animation cancelled. Occluded state is now: " + mOccluded);
setOccluded(isKeyguardOccluded /* occluded */, false /* animate */);
Log.d(TAG, "Occlude animation cancelled by WM. "
+ "Setting occluded state to: " + mOccluded);
}
}
}