From 9b34b73ece6f0c77fd89e550e0365529b7271a07 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 9 Jun 2021 17:08:36 -0700 Subject: [PATCH] Do not post color event, run it directly If setup wizard is not complete, run the theme application directly instead of posting it to a Handler. Test: atest ThemeOverlayControllerTest Fixes: 190580756 Change-Id: Ibe59526fe569766bdcb243652dc21ad35f83320c --- .../systemui/theme/ThemeOverlayController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java index 428921ee34ecd..d9ec6ee305804 100644 --- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java @@ -326,17 +326,22 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { Runnable updateColors = () -> { WallpaperColors systemColor = mWallpaperManager.getWallpaperColors( getLatestWallpaperType()); - mMainExecutor.execute(() -> { + Runnable applyColors = () -> { if (DEBUG) Log.d(TAG, "Boot colors: " + systemColor); mCurrentColors = systemColor; reevaluateSystemTheme(false /* forceReload */); - }); + }; + if (mDeviceProvisionedController.isCurrentUserSetup()) { + mMainExecutor.execute(applyColors); + } else { + applyColors.run(); + } }; // Whenever we're going directly to setup wizard, we need to process colors synchronously, // otherwise we'll see some jank when the activity is recreated. if (!mDeviceProvisionedController.isCurrentUserSetup()) { - mMainExecutor.execute(updateColors); + updateColors.run(); } else { mBgExecutor.execute(updateColors); }