Switch to main thread when execute update colors

Test: manual
Bug: 288491055
Change-Id: I9c4c560e04f5c7a57d156743907684480d92d1e1
This commit is contained in:
Sherry Zhou
2023-07-12 18:25:06 +00:00
parent e296d2d738
commit cdcebc5402

View File

@@ -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) }
}
)
}