Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2d46fbf authored by Adam Bookatz's avatar Adam Bookatz Committed by Automerger Merge Worker
Browse files

Merge "Revert "Apply colors a bit earlier when switching users"" into sc-dev...

Merge "Revert "Apply colors a bit earlier when switching users"" into sc-dev am: 29852f8a am: c88aa182

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15067672

Change-Id: I237e596c7a9c2f580984fe1def83d61fddbbfb2d
parents 4e41fa89 c88aa182
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -241,7 +241,7 @@ public class ThemeOverlayController extends SystemUI implements Dumpable {
        @Override
        @Override
        public void onReceive(Context context, Intent intent) {
        public void onReceive(Context context, Intent intent) {
            boolean newWorkProfile = Intent.ACTION_MANAGED_PROFILE_ADDED.equals(intent.getAction());
            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(
            boolean isManagedProfile = mUserManager.isManagedProfile(
                    intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0));
                    intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0));
            if (userStarted || newWorkProfile) {
            if (userStarted || newWorkProfile) {
@@ -288,7 +288,7 @@ public class ThemeOverlayController extends SystemUI implements Dumpable {
    public void start() {
    public void start() {
        if (DEBUG) Log.d(TAG, "Start");
        if (DEBUG) Log.d(TAG, "Start");
        final IntentFilter filter = new IntentFilter();
        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_MANAGED_PROFILE_ADDED);
        filter.addAction(Intent.ACTION_WALLPAPER_CHANGED);
        filter.addAction(Intent.ACTION_WALLPAPER_CHANGED);
        mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter, mMainExecutor,
        mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter, mMainExecutor,
+0 −7
Original line number Original line Diff line number Diff line
@@ -414,13 +414,6 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
                .applyCurrentUserOverlays(any(), any(), anyInt(), any());
                .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
    @Test
    public void onProfileAdded_setsTheme() {
    public void onProfileAdded_setsTheme() {
        mBroadcastReceiver.getValue().onReceive(null,
        mBroadcastReceiver.getValue().onReceive(null,