diff options
| author | 2022-11-22 16:11:25 +0000 | |
|---|---|---|
| committer | 2022-11-22 16:11:25 +0000 | |
| commit | 1672431e47b66b3b566520298b33a5ad733cb1ce (patch) | |
| tree | 16d90049dd3cce92594c698ad8964425de0dd8a7 | |
| parent | 43f386b38087c93e5bc5853a536236788eb1fe49 (diff) | |
Fix blocking task switch when 3P launcher is used.
Bug: 232984498
Test: manual
1. install 3P launcher and set it as default.
2. swipe up to start task switcher.
3. tap a task screenshot to start an activity.
4. verifity animation starts immediately.
Change-Id: I547c8aae25f6d1701758a72ca95bb9186dd1479f
| -rw-r--r-- | services/core/java/com/android/server/wm/AppTransitionController.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java index d5c9e66204d8..7e93109dcb6d 100644 --- a/services/core/java/com/android/server/wm/AppTransitionController.java +++ b/services/core/java/com/android/server/wm/AppTransitionController.java @@ -1229,13 +1229,23 @@ public class AppTransitionController { "Delaying app transition for screen rotation animation to finish"); return false; } + final boolean isRecentsInOpening = mDisplayContent.mOpeningApps.stream().anyMatch( + ConfigurationContainer::isActivityTypeRecents); for (int i = 0; i < apps.size(); i++) { WindowContainer wc = apps.valueAt(i); final ActivityRecord activity = getAppFromContainer(wc); if (activity == null) { continue; } - if (activity.isAnimating(PARENTS, ANIMATION_TYPE_RECENTS)) { + // In order to avoid visual clutter caused by a conflict between app transition + // animation and recents animation, app transition is delayed until recents finishes. + // One exceptional case. When 3P launcher is used and a user taps a task screenshot in + // task switcher (isRecentsInOpening=true), app transition must start even though + // recents is running. Otherwise app transition is blocked until timeout (b/232984498). + // When 1P launcher is used, this animation is controlled by the launcher outside of + // the app transition, so delaying app transition doesn't cause visible delay. After + // recents finishes, app transition is handled just to commit visibility on apps. + if (!isRecentsInOpening && activity.isAnimating(PARENTS, ANIMATION_TYPE_RECENTS)) { ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Delaying app transition for recents animation to finish"); return false; |