Deflake wallpaper color events
The main changes are:
- do not get fetch the "wallpaper.mWhich" flag in advance before
computing the color. Notify the with "wallpaper.mWhich" once the
colors are computed. This way, we won't send colors for an outdated
which flag if there is a migrattion while the colors are processed
- do not send any color event for the old wallpaper if the wallpaper
changes while the colors are computed
- do not send color events for the fallback wallpaper if another
wallpaper is changed.
This avoids some race conditions when wallpapers are set quickly with a
script (like in our tests).
Flag: NONE
Test: atest WallpaperManagerTest --iterations 100
Test: (note: those two tests is the sequence that caused failures in b/308757171) atest WallpaperManagerTest#setResource_homeScreen_homeLive_lockScreenUnset_setsLockToHomeAndUpdatesHome WallpaperManagerTest#invokeOnColorsChangedListenerTest_systemOnly --iterations 1000
Bug: 308757171
Change-Id: I5d38ef84ab5088a227b1b39f06296113fb6dea9c
Loading
Please register or sign in to comment