Skip to content

Commit 8d67df6

Browse files
neobuddy89joeyhuab
authored andcommitted
SystemUI: Do not invalidate ongoing chip bg color often
* We should invalidate / clear it only when user sets it to accent mode. * If we invalidate too often, chip background flickers on seekbar manual updates. Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
1 parent 30c2a0f commit 8d67df6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/SystemUI/src/com/android/systemui/statusbar/OnGoingActionProgressController.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class OnGoingActionProgressController(
201201
currentIcon = context.resources.getDrawable(R.drawable.ic_default_music_icon, context.theme)
202202
}
203203
if (chipColorMode == CHIP_COLOR_MODE_ICON && currentIcon != null) {
204-
invalidateChipBgColor()
205204
currentIcon?.let { extractAndApplyChipBgColorFromIcon(it) }
206205
}
207206
}
@@ -222,7 +221,6 @@ class OnGoingActionProgressController(
222221
if (art != null) {
223222
currentAlbumArt = art
224223
if (chipColorMode == CHIP_COLOR_MODE_ALBUM_ART) {
225-
invalidateChipBgColor()
226224
currentAlbumArt?.let { extractAndApplyChipBgColorFromAlbumArt(it) }
227225
}
228226
} else if (metadata != null) { // Partial update, force refresh
@@ -859,11 +857,12 @@ class OnGoingActionProgressController(
859857
)
860858

861859
if (wasChipColorMode != chipColorMode) {
862-
invalidateChipBgColor()
863860
if (chipColorMode == CHIP_COLOR_MODE_ALBUM_ART && currentAlbumArt != null) {
864861
currentAlbumArt?.let { extractAndApplyChipBgColorFromAlbumArt(it) }
865862
} else if (chipColorMode == CHIP_COLOR_MODE_ICON && currentIcon != null) {
866863
currentIcon?.let { extractAndApplyChipBgColorFromIcon(it) }
864+
} else {
865+
invalidateChipBgColor()
867866
}
868867
}
869868

0 commit comments

Comments
 (0)