Merge "Do not post color event, run it directly" into sc-dev

This commit is contained in:
Lucas Dupin
2021-06-10 15:23:55 +00:00
committed by Android (Google) Code Review

View File

@@ -329,17 +329,22 @@ public class ThemeOverlayController extends SystemUI implements Dumpable {
Runnable updateColors = () -> { Runnable updateColors = () -> {
WallpaperColors systemColor = mWallpaperManager.getWallpaperColors( WallpaperColors systemColor = mWallpaperManager.getWallpaperColors(
getLatestWallpaperType()); getLatestWallpaperType());
mMainExecutor.execute(() -> { Runnable applyColors = () -> {
if (DEBUG) Log.d(TAG, "Boot colors: " + systemColor); if (DEBUG) Log.d(TAG, "Boot colors: " + systemColor);
mCurrentColors = systemColor; mCurrentColors = systemColor;
reevaluateSystemTheme(false /* forceReload */); 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, // 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. // otherwise we'll see some jank when the activity is recreated.
if (!mDeviceProvisionedController.isCurrentUserSetup()) { if (!mDeviceProvisionedController.isCurrentUserSetup()) {
mMainExecutor.execute(updateColors); updateColors.run();
} else { } else {
mBgExecutor.execute(updateColors); mBgExecutor.execute(updateColors);
} }