From 4cfb4ca96621601406964c791da5b9f6812201c9 Mon Sep 17 00:00:00 2001 From: Adam Bookatz Date: Tue, 22 Jun 2021 19:02:15 +0000 Subject: [PATCH] Revert "Apply colors a bit earlier when switching users" This reverts commit e02895a32fce38713acf0160b9d0f6a1604cb26c. Reason for revert: Regression in multiuser performance metrics Change-Id: I46b16d21841e33f2203319407c595553081d18fe Bug: 190830245 --- .../com/android/systemui/theme/ThemeOverlayController.java | 4 ++-- .../android/systemui/theme/ThemeOverlayControllerTest.java | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java index ca1f55e95ff48..11ddbd045cd40 100644 --- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java @@ -241,7 +241,7 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { @Override public void onReceive(Context context, Intent intent) { boolean newWorkProfile = Intent.ACTION_MANAGED_PROFILE_ADDED.equals(intent.getAction()); - boolean userStarted = Intent.ACTION_USER_STARTED.equals(intent.getAction()); + boolean userStarted = Intent.ACTION_USER_SWITCHED.equals(intent.getAction()); boolean isManagedProfile = mUserManager.isManagedProfile( intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); if (userStarted || newWorkProfile) { @@ -288,7 +288,7 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { public void start() { if (DEBUG) Log.d(TAG, "Start"); final IntentFilter filter = new IntentFilter(); - filter.addAction(Intent.ACTION_USER_STARTED); + filter.addAction(Intent.ACTION_USER_SWITCHED); filter.addAction(Intent.ACTION_MANAGED_PROFILE_ADDED); filter.addAction(Intent.ACTION_WALLPAPER_CHANGED); mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter, mMainExecutor, diff --git a/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java index 208790b24d8ad..1a24c113a0df7 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java @@ -414,13 +414,6 @@ public class ThemeOverlayControllerTest extends SysuiTestCase { .applyCurrentUserOverlays(any(), any(), anyInt(), any()); } - @Test - public void onUserSwitch_setsTheme() { - mBroadcastReceiver.getValue().onReceive(null, - new Intent(Intent.ACTION_USER_STARTED)); - verify(mThemeOverlayApplier).applyCurrentUserOverlays(any(), any(), anyInt(), any()); - } - @Test public void onProfileAdded_setsTheme() { mBroadcastReceiver.getValue().onReceive(null,