summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sherry Zhou <yuandizhou@google.com> 2023-07-12 18:25:06 +0000
committer Sherry Zhou <yuandizhou@google.com> 2023-07-12 21:13:16 +0000
commitcdcebc54027497ddeb0c1298d63bda942323b5d9 (patch)
tree6a35eb684fb1c3666fd1a5d3780d7ddaa76500bd
parente296d2d73861e467959fa3722d483fca5727fdc5 (diff)
Switch to main thread when execute update colors
Test: manual Bug: 288491055 Change-Id: I9c4c560e04f5c7a57d156743907684480d92d1e1
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/regionsampling/RegionSampler.kt4
1 files 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) }
}
)
}