From 7b04a06e42a7297f409f4a9a7a8b1b0f87f12689 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 6 Oct 2022 18:09:58 +0000 Subject: [PATCH] Cancel unocclude animation on main thread - It throws an exception since it's not being called on a looper thread Bug: 251481696 Test: atest SystemUITests Change-Id: I407bbcc2824ef4d6130c269551a6e0e7995896d7 --- .../android/systemui/keyguard/KeyguardViewMediator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 38b98eb45aec2..6f84903af7458 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -987,9 +987,11 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, @Override public void onAnimationCancelled(boolean isKeyguardOccluded) { - if (mUnoccludeAnimator != null) { - mUnoccludeAnimator.cancel(); - } + mContext.getMainExecutor().execute(() -> { + if (mUnoccludeAnimator != null) { + mUnoccludeAnimator.cancel(); + } + }); setOccluded(isKeyguardOccluded /* isOccluded */, false /* animate */); Log.d(TAG, "Unocclude animation cancelled. Occluded state is now: "