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

Commit 30ebd832 authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge "Apply colors a bit earlier when switching users" into sc-dev am: 2178808d

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

Change-Id: Id3bb1d46c036cbfa5cd9429345258725d9822a47
parents 7c3c9eb6 2178808d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -237,7 +237,7 @@ public class ThemeOverlayController extends SystemUI implements Dumpable {
    private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
    private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
        @Override
        @Override
        public void onReceive(Context context, Intent intent) {
        public void onReceive(Context context, Intent intent) {
            if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction())
            if (Intent.ACTION_USER_STARTED.equals(intent.getAction())
                    || Intent.ACTION_MANAGED_PROFILE_ADDED.equals(intent.getAction())) {
                    || Intent.ACTION_MANAGED_PROFILE_ADDED.equals(intent.getAction())) {
                if (!mDeviceProvisionedController.isCurrentUserSetup()) {
                if (!mDeviceProvisionedController.isCurrentUserSetup()) {
                    Log.i(TAG, "User setup not finished when " + intent.getAction()
                    Log.i(TAG, "User setup not finished when " + intent.getAction()
@@ -282,7 +282,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_SWITCHED);
        filter.addAction(Intent.ACTION_USER_STARTED);
        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,
+7 −0
Original line number Original line Diff line number Diff line
@@ -359,6 +359,13 @@ 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,