Loading packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +4 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,10 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { + wallpaperColors); mDeferredThemeEvaluation = true; return; } else if (mDeferredThemeEvaluation) { Log.i(TAG, "Wallpaper color event received, but we already were deferring eval: " + wallpaperColors); return; } else { if (DEBUG) { Log.i(TAG, "During user setup, but allowing first color event: had? " Loading packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,18 @@ public class ThemeOverlayControllerTest extends SysuiTestCase { mColorsListener.getValue().onColorsChanged(mainColors, WallpaperManager.FLAG_SYSTEM); verify(mThemeOverlayApplier).applyCurrentUserOverlays(any(), any(), anyInt(), any()); // Regression test: null events should not reset the internal state and allow colors to be // applied again. clearInvocations(mThemeOverlayApplier); mBroadcastReceiver.getValue().onReceive(null, new Intent(Intent.ACTION_WALLPAPER_CHANGED)); mColorsListener.getValue().onColorsChanged(null, WallpaperManager.FLAG_SYSTEM); verify(mThemeOverlayApplier, never()).applyCurrentUserOverlays(any(), any(), anyInt(), any()); mColorsListener.getValue().onColorsChanged(new WallpaperColors(Color.valueOf(Color.GREEN), null, null), WallpaperManager.FLAG_SYSTEM); verify(mThemeOverlayApplier, never()).applyCurrentUserOverlays(any(), any(), anyInt(), any()); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +4 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,10 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { + wallpaperColors); mDeferredThemeEvaluation = true; return; } else if (mDeferredThemeEvaluation) { Log.i(TAG, "Wallpaper color event received, but we already were deferring eval: " + wallpaperColors); return; } else { if (DEBUG) { Log.i(TAG, "During user setup, but allowing first color event: had? " Loading
packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,18 @@ public class ThemeOverlayControllerTest extends SysuiTestCase { mColorsListener.getValue().onColorsChanged(mainColors, WallpaperManager.FLAG_SYSTEM); verify(mThemeOverlayApplier).applyCurrentUserOverlays(any(), any(), anyInt(), any()); // Regression test: null events should not reset the internal state and allow colors to be // applied again. clearInvocations(mThemeOverlayApplier); mBroadcastReceiver.getValue().onReceive(null, new Intent(Intent.ACTION_WALLPAPER_CHANGED)); mColorsListener.getValue().onColorsChanged(null, WallpaperManager.FLAG_SYSTEM); verify(mThemeOverlayApplier, never()).applyCurrentUserOverlays(any(), any(), anyInt(), any()); mColorsListener.getValue().onColorsChanged(new WallpaperColors(Color.valueOf(Color.GREEN), null, null), WallpaperManager.FLAG_SYSTEM); verify(mThemeOverlayApplier, never()).applyCurrentUserOverlays(any(), any(), anyInt(), any()); } @Test Loading