Merge "Do not ignore forceReload requests" into tm-dev

This commit is contained in:
Lucas Dupin
2022-04-28 15:41:04 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 1 deletions

View File

@@ -474,7 +474,7 @@ public class ThemeOverlayController extends CoreStartable implements Dumpable {
mThemeStyle = fetchThemeStyleFromSetting();
mSecondaryOverlay = getOverlay(mMainWallpaperColor, ACCENT, mThemeStyle);
mNeutralOverlay = getOverlay(mMainWallpaperColor, NEUTRAL, mThemeStyle);
if (colorSchemeIsApplied()) {
if (colorSchemeIsApplied() && !forceReload) {
Log.d(TAG, "Skipping overlay creation. Theme was already: " + mColorScheme);
return;
}

View File

@@ -729,6 +729,18 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
mColorsListener.getValue().onColorsChanged(mainColors, WallpaperManager.FLAG_SYSTEM,
USER_SYSTEM);
reset(mResources);
when(mResources.getColor(eq(android.R.color.system_accent1_500), any()))
.thenReturn(mThemeOverlayController.mColorScheme.getAccent1().get(6));
when(mResources.getColor(eq(android.R.color.system_accent2_500), any()))
.thenReturn(mThemeOverlayController.mColorScheme.getAccent2().get(6));
when(mResources.getColor(eq(android.R.color.system_accent3_500), any()))
.thenReturn(mThemeOverlayController.mColorScheme.getAccent3().get(6));
when(mResources.getColor(eq(android.R.color.system_neutral1_500), any()))
.thenReturn(mThemeOverlayController.mColorScheme.getNeutral1().get(6));
when(mResources.getColor(eq(android.R.color.system_neutral2_500), any()))
.thenReturn(mThemeOverlayController.mColorScheme.getNeutral2().get(6));
// Defers event because we already have initial colors.
verify(mThemeOverlayApplier, never())
.applyCurrentUserOverlays(any(), any(), anyInt(), any());