From 6920cf55469fd1f8f274c56593330f4a1fb59ba0 Mon Sep 17 00:00:00 2001 From: Issei Suzuki Date: Fri, 17 Jun 2022 13:20:58 +0000 Subject: [PATCH] Ignore overriding pending animaiton for unlock transition. System app can request to override app transition animation using the following hidden APIs. - IWindowManager#overridePendingAppTransitionRemote - Activity#registerRemoteAnimations - IActivityTaskManager#registerRemoteAnimationsForDisplay We usually give the lowest priority for the overrides registered by the last API, since it defines default transition animaiton for a given transition type and others are used to overide more specific cases. However remote animation for unlock transition is also used to sync keyguard status between server_process and system ui, even system app must not override it. Bug: 231556392 Test: manual 1. Press Power button to display the lock screen. 2. Press Power button and the volume down button at the same time to take a screenshot. 3. Tap the screenshot preview that appears in the lower left corner of the screen. 4. Execute Fingerprint authentication to unlock the screen. Change-Id: I16593c1aa7e7799e355aafbe47832e5c3b23c0cc --- .../android/server/wm/AppTransitionController.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java index 140ac333e3af1..e60ea12608681 100644 --- a/services/core/java/com/android/server/wm/AppTransitionController.java +++ b/services/core/java/com/android/server/wm/AppTransitionController.java @@ -113,7 +113,6 @@ public class AppTransitionController { private final DisplayContent mDisplayContent; private final WallpaperController mWallpaperControllerLocked; private RemoteAnimationDefinition mRemoteAnimationDefinition = null; - private static final int KEYGUARD_GOING_AWAY_ANIMATION_DURATION = 400; private static final int TYPE_NONE = 0; private static final int TYPE_ACTIVITY = 1; @@ -716,14 +715,17 @@ public class AppTransitionController { */ private void overrideWithRemoteAnimationIfSet(@Nullable ActivityRecord animLpActivity, @TransitionOldType int transit, ArraySet activityTypes) { + RemoteAnimationAdapter adapter = null; if (transit == TRANSIT_OLD_CRASHING_ACTIVITY_CLOSE) { // The crash transition has higher priority than any involved remote animations. - return; + } else if (AppTransition.isKeyguardGoingAwayTransitOld(transit)) { + adapter = mRemoteAnimationDefinition != null + ? mRemoteAnimationDefinition.getAdapter(transit, activityTypes) + : null; + } else if (mDisplayContent.mAppTransition.getRemoteAnimationController() == null) { + adapter = getRemoteAnimationOverride(animLpActivity, transit, activityTypes); } - final RemoteAnimationAdapter adapter = - getRemoteAnimationOverride(animLpActivity, transit, activityTypes); - if (adapter != null - && mDisplayContent.mAppTransition.getRemoteAnimationController() == null) { + if (adapter != null) { mDisplayContent.mAppTransition.overridePendingAppTransitionRemote(adapter); } }