From 81d457f7820fc9dc6ca28a2d3796d1134908bb1c Mon Sep 17 00:00:00 2001 From: shawnlin Date: Fri, 24 Dec 2021 12:12:54 +0800 Subject: [PATCH] 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 --- .../SystemUI/src/com/android/systemui/ScreenDecorations.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index 33538ec25fcd0..a100cb8caf980 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -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) {