From 6f99676c45918a79fcf292a07cbc137a847fcf1d Mon Sep 17 00:00:00 2001 From: George Lin Date: Thu, 8 Jun 2023 19:02:58 +0000 Subject: [PATCH] Conform the logic to decide wallpaper darkness Make sure that the logic of deciding if the wallpaper is dark or light is the same as defined in Tonal. Test: Manaully tested the color is the same as the lock screen Bug: 286425611 Change-Id: I4b66edb86008ad817028eb444d4b121ae054631e --- .../systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt index db231092d7a5d..1c2e85b0fd3a4 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt @@ -404,8 +404,7 @@ constructor( val darkClockColor = wallpaperColorScheme?.accent2?.s600 /** Note that when [wallpaperColors] is null, isWallpaperDark is true. */ val isWallpaperDark: Boolean = - (wallpaperColors?.colorHints?.and(WallpaperColors.HINT_SUPPORTS_DARK_TEXT)) != - WallpaperColors.HINT_SUPPORTS_DARK_TEXT + (wallpaperColors?.colorHints?.and(WallpaperColors.HINT_SUPPORTS_DARK_TEXT)) == 0 clock.events.onSeedColorChanged( if (isWallpaperDark) lightClockColor else darkClockColor )