From cdcebc54027497ddeb0c1298d63bda942323b5d9 Mon Sep 17 00:00:00 2001 From: Sherry Zhou Date: Wed, 12 Jul 2023 18:25:06 +0000 Subject: Switch to main thread when execute update colors Test: manual Bug: 288491055 Change-Id: I9c4c560e04f5c7a57d156743907684480d92d1e1 --- .../src/com/android/systemui/shared/regionsampling/RegionSampler.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/regionsampling/RegionSampler.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/regionsampling/RegionSampler.kt index 0fbeb1a054a7..f3296f0632bb 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/regionsampling/RegionSampler.kt +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/regionsampling/RegionSampler.kt @@ -32,7 +32,7 @@ open class RegionSampler @JvmOverloads constructor( val sampledView: View, - mainExecutor: Executor?, + val mainExecutor: Executor?, val bgExecutor: Executor?, val regionSamplingEnabled: Boolean, val isLockscreen: Boolean = false, @@ -166,7 +166,7 @@ constructor( if (isLockscreen) WallpaperManager.FLAG_LOCK else WallpaperManager.FLAG_SYSTEM ) - onColorsChanged(sampledRegionWithOffset, initialSampling) + mainExecutor?.execute { onColorsChanged(sampledRegionWithOffset, initialSampling) } } ) } -- cgit v1.2.3-59-g8ed1b