Loading packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +5 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,11 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { public void onReceive(Context context, Intent intent) { if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction()) || Intent.ACTION_MANAGED_PROFILE_ADDED.equals(intent.getAction())) { if (!mDeviceProvisionedController.isCurrentUserSetup()) { Log.i(TAG, "User setup not finished when " + intent.getAction() + " was received. Deferring..."); return; } if (DEBUG) Log.d(TAG, "Updating overlays for user switch / profile added."); reevaluateSystemTheme(true /* forceReload */); } else if (Intent.ACTION_WALLPAPER_CHANGED.equals(intent.getAction())) { Loading packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,22 @@ public class ThemeOverlayControllerTest extends SysuiTestCase { .isEqualTo(new OverlayIdentifier("override.package.name")); } @Test public void onProfileAdded_setsTheme() { mBroadcastReceiver.getValue().onReceive(null, new Intent(Intent.ACTION_MANAGED_PROFILE_ADDED)); verify(mThemeOverlayApplier).applyCurrentUserOverlays(any(), any(), anyInt(), any()); } @Test public void onProfileAdded_ignoresUntilSetupComplete() { reset(mDeviceProvisionedController); mBroadcastReceiver.getValue().onReceive(null, new Intent(Intent.ACTION_MANAGED_PROFILE_ADDED)); verify(mThemeOverlayApplier, never()) .applyCurrentUserOverlays(any(), any(), anyInt(), any()); } @Test public void onWallpaperColorsChanged_firstEventBeforeUserSetup_shouldBeAccepted() { // By default, on setup() we make this controller return that the user finished setup Loading Loading
packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +5 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,11 @@ public class ThemeOverlayController extends SystemUI implements Dumpable { public void onReceive(Context context, Intent intent) { if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction()) || Intent.ACTION_MANAGED_PROFILE_ADDED.equals(intent.getAction())) { if (!mDeviceProvisionedController.isCurrentUserSetup()) { Log.i(TAG, "User setup not finished when " + intent.getAction() + " was received. Deferring..."); return; } if (DEBUG) Log.d(TAG, "Updating overlays for user switch / profile added."); reevaluateSystemTheme(true /* forceReload */); } else if (Intent.ACTION_WALLPAPER_CHANGED.equals(intent.getAction())) { Loading
packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,22 @@ public class ThemeOverlayControllerTest extends SysuiTestCase { .isEqualTo(new OverlayIdentifier("override.package.name")); } @Test public void onProfileAdded_setsTheme() { mBroadcastReceiver.getValue().onReceive(null, new Intent(Intent.ACTION_MANAGED_PROFILE_ADDED)); verify(mThemeOverlayApplier).applyCurrentUserOverlays(any(), any(), anyInt(), any()); } @Test public void onProfileAdded_ignoresUntilSetupComplete() { reset(mDeviceProvisionedController); mBroadcastReceiver.getValue().onReceive(null, new Intent(Intent.ACTION_MANAGED_PROFILE_ADDED)); verify(mThemeOverlayApplier, never()) .applyCurrentUserOverlays(any(), any(), anyInt(), any()); } @Test public void onWallpaperColorsChanged_firstEventBeforeUserSetup_shouldBeAccepted() { // By default, on setup() we make this controller return that the user finished setup Loading