diff options
| author | 2024-01-29 11:50:13 +0000 | |
|---|---|---|
| committer | 2024-01-29 11:50:13 +0000 | |
| commit | 2a15b956cc65a0fc3376306dad1967c1f9991126 (patch) | |
| tree | 2654994c0a6804f2b510d7243c61d5199f8bc964 | |
| parent | 8a19c01a0090f9c6fdf97b146c10f3dd1d6af247 (diff) | |
| parent | bba0ac0b32028205054b9cefa98f7bba597c0658 (diff) | |
Merge "Update RemoteTransition wrapper to better match pre-Shell behavior." into main
| -rw-r--r-- | packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java index f094102ad88f..d4ac19556b0a 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java @@ -40,7 +40,15 @@ public class RemoteAnimationTargetCompat { */ public static RemoteAnimationTarget[] wrapApps(TransitionInfo info, SurfaceControl.Transaction t, ArrayMap<SurfaceControl, SurfaceControl> leashMap) { - return wrap(info, t, leashMap, new TransitionUtil.LeafTaskFilter()); + // LeafTaskFilter is order-dependent, so the same object needs to be used for all Change + // objects. That's why it's constructed here and captured by the lambda instead of building + // a new one ad hoc every time. + TransitionUtil.LeafTaskFilter taskFilter = new TransitionUtil.LeafTaskFilter(); + return wrap(info, t, leashMap, (change) -> { + // Intra-task activity -> activity transitions should be categorized as apps. + if (change.getActivityComponent() != null) return true; + return taskFilter.test(change); + }); } /** @@ -53,8 +61,12 @@ public class RemoteAnimationTargetCompat { */ public static RemoteAnimationTarget[] wrapNonApps(TransitionInfo info, boolean wallpapers, SurfaceControl.Transaction t, ArrayMap<SurfaceControl, SurfaceControl> leashMap) { - return wrap(info, t, leashMap, (change) -> (wallpapers - ? TransitionUtil.isWallpaper(change) : TransitionUtil.isNonApp(change))); + return wrap(info, t, leashMap, (change) -> { + // Intra-task activity -> activity transitions should be categorized as apps. + if (change.getActivityComponent() != null) return false; + return wallpapers + ? TransitionUtil.isWallpaper(change) : TransitionUtil.isNonApp(change); + }); } private static RemoteAnimationTarget[] wrap(TransitionInfo info, |