Wait for color changes in ensureCleanState

The method ensureCleanState sets a small bitmap as wallpaper. It is used
as a setup before running some tests, including color listener tests.

In some cases, ensureCleanState will send a color event quite late; and
this event will interfere with the color listener tests.

To avoid this, make sure that we wait for the color events of
ensureCleanState (or timeout after 5s) before moving on and performing
the actual test.

Also add a log to make debugging slightly easier next time.

Flag: NA
Test: atest WallpaperManagerTest
Bug: 326189127
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2fe704b9eeb2131d93e3f80c544d4c3f353f4020)
Merged-In: I47183de05750c51b3e766d93ed8f7439d0ea02df
Change-Id: I47183de05750c51b3e766d93ed8f7439d0ea02df
1 file changed