Reduce unnecessary collecting for wallpaper with shell transition
The adjustWallpaperWindows is a heavy operation (including assigning
layer), and it has no direct relation with ensure visibility of task.
Especially if there are several tasks, it may increase overhead with
dozens milliseconds in a transition. The original problem should be
fixed by collecting wallpaper token instead of window state.
(Because Transition only recognizes wallpaper by token)
Also
- Reduce re-assigning layer if visibility is not changed.
- Collect wallpaper token only when the requested visibility is
different, that reduces lots of checking transition participants.
- Update wallpaper visibility before playing transition, which is
similar to legacy adjustWallpaperWindowsForAppTransitionIfNeeded.
Bug: 206487939
Bug: 187461719
Test: WallpaperControllerTests#testWallpaperTokenVisibility
Test: adb shell setprop persist.debug.shell_transit 1; reboot
Check 3 cases:
1. Rotate display -> latency reduced.
2. Launch app in different orientation from home
-> wallpaper is not rotated.
3. Launch an opaque app from home and it launches a
non-opaque app immediately -> wallpaper should not flash.
Change-Id: I1819f6aad23eb103f97c9d33bc2ad68db0e6c4ed
5 files changed