Consider multiple show-when-locked activities for wallpaper
2 problems:
- ActivityRecord#mShowWhenLocked was not involved, i.e. if the
app uses Activity#setShowWhenLocked rather than
FLAG_SHOW_WHEN_LOCKED, the condition needsShowWhenLockedWallpaper
is never satisfied.
- The useTopWallpaperAsTarget was always true if there exists one
non fullscreen show-when-locked activity even if the wallpaper
can be occluded by the opaque show-when-locked activity behind.
The first one is fixed by checking WindowState#canShowWhenLocked.
The second one is fixed by updating mNeedsShowWhenLockedWallpaper
when going through all windows from top to bottom.
Note that with shell transition, if the wallpaper becomes visible
unexpectedly, it will be collected into transition. And because
the wallpaper surface will be put on transition root surface that
may have higher z-order, which will cause the wallpaper to be
flickering when switching show-when-locked activities with scene
transition (covert to translucent).
Fix: 286172268
Test: WallpaperControllerTests#testShowWhenLockedWallpaperTarge
Change-Id: Ic029c9c42472f7061020e4ca47e325be1ee53787
3 files changed