Fix ConcurrentModificationException when addTunable

Calls to addTunnable() in systemui are all in mainExecutor, we should
also use it in ScreenDecorations to prevent concurrent issue.

Bug: 199385132
Test: atest ScreenDecorationsTest
Change-Id: Idb8c3800c1bf222f57e212a89c6466367aa5d818
This commit is contained in:
shawnlin
2021-12-24 12:12:54 +08:00
committed by Shawn Lin
parent 35f5342aaf
commit 81d457f782

View File

@@ -342,7 +342,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable {
mDisplayManager.getDisplay(DEFAULT_DISPLAY).getMetrics(metrics);
mDensity = metrics.density;
mExecutor.execute(() -> mTunerService.addTunable(this, SIZE));
mMainExecutor.execute(() -> mTunerService.addTunable(this, SIZE));
// Watch color inversion and invert the overlay as needed.
if (mColorInversionSetting == null) {