From 0a92c85fbb69cce52c60f2362149e60187df69f4 Mon Sep 17 00:00:00 2001 From: Bahar KURT Date: Fri, 3 Jul 2026 03:52:23 +0300 Subject: [PATCH 1/3] base: services: core: Report proper dark theme status when using auto/custom theme --- services/core/java/com/android/server/UiModeManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/UiModeManagerService.java b/services/core/java/com/android/server/UiModeManagerService.java index cc09d380dd8e1..98211748b5eb7 100644 --- a/services/core/java/com/android/server/UiModeManagerService.java +++ b/services/core/java/com/android/server/UiModeManagerService.java @@ -548,7 +548,7 @@ private void updateSystemProperties() { int mode = Secure.getIntForUser(getContext().getContentResolver(), Secure.UI_NIGHT_MODE, mNightMode.get(), 0); if (mode == MODE_NIGHT_AUTO || mode == MODE_NIGHT_CUSTOM) { - mode = MODE_NIGHT_YES; + mode = mComputedNightMode ? MODE_NIGHT_YES : MODE_NIGHT_NO; } SystemProperties.set(SYSTEM_PROPERTY_DEVICE_THEME, Integer.toString(mode)); } From 0cfa3ee1e489d259fb057e3f8453cf4f5a42ee61 Mon Sep 17 00:00:00 2001 From: Bahar KURT Date: Fri, 3 Jul 2026 03:53:40 +0300 Subject: [PATCH 2/3] services: core: Update system properties upon theme change These exact places makes sure the props are updated even when we have auto/custom theme applied. --- .../core/java/com/android/server/UiModeManagerService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/UiModeManagerService.java b/services/core/java/com/android/server/UiModeManagerService.java index 98211748b5eb7..b9219eae5b4fc 100644 --- a/services/core/java/com/android/server/UiModeManagerService.java +++ b/services/core/java/com/android/server/UiModeManagerService.java @@ -2457,6 +2457,7 @@ private void updateComputedNightModeLocked(boolean activate) { if (mAttentionModeThemeOverlay != MODE_ATTENTION_THEME_OVERLAY_OFF) { mComputedNightMode = mAttentionModeThemeOverlay == MODE_ATTENTION_THEME_OVERLAY_NIGHT; + updateSystemProperties(); return; } if (mNightMode.get() == MODE_NIGHT_YES || mNightMode.get() == UiModeManager.MODE_NIGHT_NO) { @@ -2464,10 +2465,12 @@ private void updateComputedNightModeLocked(boolean activate) { } if (mOverrideNightModeOn && !mComputedNightMode) { mComputedNightMode = true; + updateSystemProperties(); return; } if (mOverrideNightModeOff && mComputedNightMode) { mComputedNightMode = false; + updateSystemProperties(); return; } @@ -2475,6 +2478,7 @@ private void updateComputedNightModeLocked(boolean activate) { && mTwilightManager.getLastTwilightState() != null)) { resetNightModeOverrideLocked(); } + updateSystemProperties(); } private boolean resetNightModeOverrideLocked() { From 83acdee31214c8216c301ae208aa38631fcd3e88 Mon Sep 17 00:00:00 2001 From: Bahar KURT Date: Fri, 3 Jul 2026 03:54:38 +0300 Subject: [PATCH 3/3] base: cmds: bootanimation: Get system theme to decide which anim to use --- cmds/bootanimation/BootAnimation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 29768246da757..5c45a14012dc2 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -19,6 +19,7 @@ #define LOG_TAG "BootAnimation" #define ATRACE_TAG ATRACE_TAG_GRAPHICS +#include #include #include @@ -716,7 +717,9 @@ bool BootAnimation::findBootAnimationFileInternal(const std::vector void BootAnimation::findBootAnimationFile() { ATRACE_CALL(); - const bool playDarkAnim = android::base::GetIntProperty("ro.boot.theme", 0) == 1; + android::base::WaitForProperty("ro.persistent_properties.ready", "true", + std::chrono::seconds(5)); + const bool playDarkAnim = android::base::GetIntProperty("persist.sys.theme", 2) == 2; const std::string productBootanimationFile = PRODUCT_BOOTANIMATION_DIR + android::base::GetProperty("ro.product.bootanim.file", playDarkAnim ? PRODUCT_BOOTANIMATION_DARK_FILE : PRODUCT_BOOTANIMATION_FILE);