Use a color container surface to animate rotation with wallpaper
By default, WallpaperService has a 0.05f dim. And SystemUI's
DefaultDeviceEffectsApplier may set 0.6f for battery saver mode.
If the wallpaper surface is not opaque, it may be blending with
the surface behind. E.g.
Before animation starts:
z=1 Wallpaper 0.6 alpha
z=0 No other layer (black)
Animation starts:
z=2 Wallpaper 0.6 alpha <--- looks brighter
z=1 Bright (assume the content is light color) background layer
Animation ends: (flickering when removing the background layer)
z=2 Wallpaper 0.6 alpha
z=0 No other layer (black)
So wrap the surface which contains the wallpaper into a surface
with color that will animate from background color to black, then
the translucent wallpaper can have a smoother transition.
Bug: 326331384
Flag: EXEMPT bugfix
Test: Enable home rotation. Set a white color wallpaper.
adb shell cmd battery unplug \
&& adb shell settings put global low_power 1
(or "adb shell cmd wallpaper set-dim-amount 0.5")
Rotate device.
The end frame should not flickering from light to dark.
Change-Id: Ie869abf59ecd59c976a503aee14880759f4b42e2
2 files changed