Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 168482c5 authored by Hawkwood's avatar Hawkwood
Browse files

Do not dedupe theme updates when seedColor is pulled from context

Bug: 409707465
Bug: 409704280
Flag: NONE Bugfix
Test: Manually checked dedupe behavior
Change-Id: Ie05f6898802863aabb13522da3932031c9ff0374
parent f0349244
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -48,7 +48,13 @@ interface ClockFaceController {
    companion object {
        fun ClockFaceController.updateTheme(mutateTheme: (ThemeConfig) -> ThemeConfig) {
            val theme = mutateTheme(this.theme)
            if (this.theme == theme) return

            // Themes with null seeds are always considered to have changed since we don't know
            // at this point if the context's color theme has been updated externally.
            // TODO(b/364680879): Capture context's color and compare when applicable.
            val hasChanged = this.theme != theme || theme.seedColor == null
            if (!hasChanged) return

            events.onThemeChanged(theme)
            this.theme = theme
        }