From 24ed9cac0e552d6574715906aa03f7dd4233757e Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Thu, 17 Jun 2021 14:27:21 +0800 Subject: [PATCH] Workaround to fix remote animation hanging. After Ic78c603b2375d36cf2170b81cca7cddbf334408b, sometimes there will call keyguardGoingAway twice to trigger the second phase unlock animation, so several conditions the remote animation may not execute, so better to send the callback to update the status in window manager. Right now the framework cannot ignore the second keyguardGoingAway call because keyguard status in KeyguardViewMediator could be hiding, so better to trigger startKeyguardExitAnimation once there was receive keyguardGoingAway. Still need to find out why will keyguardGoingAway been called twice, better to merge those call together. Bug: 190040281 Test: No hanging when launch app and received two keyguardGoingAway calls. Change-Id: I3c425066e2fc2d00dc8f55f470efa229607ac83f --- .../android/systemui/keyguard/KeyguardViewMediator.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index c84d6a87246ae..b5fd73984a79e 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -2161,6 +2161,15 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, if (!mHiding && !mSurfaceBehindRemoteAnimationRequested && !mKeyguardStateController.isFlingingToDismissKeyguardDuringSwipeGesture()) { + if (finishedCallback != null) { + // There will not execute animation, send a finish callback to ensure the remote + // animation won't hanging there. + try { + finishedCallback.onAnimationFinished(); + } catch (RemoteException e) { + Slog.w(TAG, "Failed to call onAnimationFinished", e); + } + } setShowingLocked(mShowing, true /* force */); return; }