diff options
| author | 2020-12-08 23:54:22 +0000 | |
|---|---|---|
| committer | 2020-12-08 23:54:22 +0000 | |
| commit | 4ba5de5cbdad6a864b29e98682d35a444779591c (patch) | |
| tree | e47fce7e63e19905278c2f96ff16b297f85a3909 | |
| parent | 860f61b4caa105909c919ca5e12747c6b917f78e (diff) | |
Revert "Fix issue with white and black themes"
This reverts commit 860f61b4caa105909c919ca5e12747c6b917f78e.
Reason for revert: Broke one sysui test
Change-Id: If43b21fc6588bbbb0e42e5159f70c94e52773c2a
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java | 8 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java | 30 |
2 files changed, 3 insertions, 35 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java index b7ed70a23038..006ecb937922 100644 --- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java @@ -254,12 +254,6 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { ColorUtils.RGBToHSL(Color.red(color), Color.green(color), Color.blue(color), hslMain); hslMain[0] /= 360f; - // To close to white or black, let's use the default system theme instead of - // applying a colorized one. - if (hslMain[2] < 0.05 || hslMain[2] > 0.95) { - return Color.TRANSPARENT; - } - float minDistance = Float.MAX_VALUE; int closestColor = Color.TRANSPARENT; for (int candidate: candidates) { @@ -287,7 +281,7 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { final String overlayPackageJson = mSecureSettings.getStringForUser( Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES, currentUser); - if (DEBUG) Log.d(TAG, "updateThemeOverlays. Setting: " + overlayPackageJson); + if (DEBUG) Log.d(TAG, "updateThemeOverlays: " + overlayPackageJson); boolean hasSystemPalette = false; boolean hasAccentColor = false; final Map<String, String> categoryToPackage = new ArrayMap<>(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java index e04720a6aa68..c826cbcb5389 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java @@ -148,36 +148,10 @@ public class ThemeOverlayControllerTest extends SysuiTestCase { } @Test - public void onWallpaperColorsChanged_whiteTheme() { - WallpaperColors mainColors = new WallpaperColors(Color.valueOf(Color.WHITE), - Color.valueOf(Color.BLUE), null); - mColorsListener.getValue().onColorsChanged(mainColors, WallpaperManager.FLAG_SYSTEM); - ArgumentCaptor<Map<String, String>> themeOverlays = ArgumentCaptor.forClass(Map.class); - - verify(mThemeOverlayApplier).applyCurrentUserOverlays(themeOverlays.capture(), any()); - - // Assert that we received the colors that we were expecting - assertThat(!themeOverlays.getValue().containsKey(OVERLAY_CATEGORY_SYSTEM_PALETTE)); - } - - @Test - public void onWallpaperColorsChanged_blackTheme() { - WallpaperColors mainColors = new WallpaperColors(Color.valueOf(Color.BLACK), - Color.valueOf(Color.BLUE), null); - mColorsListener.getValue().onColorsChanged(mainColors, WallpaperManager.FLAG_SYSTEM); - ArgumentCaptor<Map<String, String>> themeOverlays = ArgumentCaptor.forClass(Map.class); - - verify(mThemeOverlayApplier).applyCurrentUserOverlays(themeOverlays.capture(), any()); - - // Assert that we received the colors that we were expecting - assertThat(!themeOverlays.getValue().containsKey(OVERLAY_CATEGORY_SYSTEM_PALETTE)); - } - - @Test public void onWallpaperColorsChanged_addsLeadingZerosToColors() { // Should ask for a new theme when wallpaper colors change WallpaperColors mainColors = new WallpaperColors(Color.valueOf(0x0CCCCC), - Color.valueOf(0x000CCC), null); + Color.valueOf(0x000111), null); mColorsListener.getValue().onColorsChanged(mainColors, WallpaperManager.FLAG_SYSTEM); ArgumentCaptor<Map<String, String>> themeOverlays = ArgumentCaptor.forClass(Map.class); @@ -187,7 +161,7 @@ public class ThemeOverlayControllerTest extends SysuiTestCase { assertThat(themeOverlays.getValue().get(OVERLAY_CATEGORY_SYSTEM_PALETTE)) .isEqualTo(MONET_SYSTEM_PALETTE_PACKAGE + "0CCCCC"); assertThat(themeOverlays.getValue().get(OVERLAY_CATEGORY_ACCENT_COLOR)) - .isEqualTo(MONET_ACCENT_COLOR_PACKAGE + "000CCC"); + .isEqualTo(MONET_ACCENT_COLOR_PACKAGE + "000111"); } @Test |