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

Commit 7ae26641 authored by Peter Kalauskas's avatar Peter Kalauskas Committed by Automerger Merge Worker
Browse files

Merge "Use long-running executor for bg guest creation" into tm-dev am: 471391dd

parents a02966ce 471391dd
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.broadcast.BroadcastSender;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.LongRunning;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.plugins.ActivityStarter;
@@ -153,6 +154,7 @@ public class UserSwitcherController implements Dumpable {
    private final IActivityManager mActivityManager;
    private final Executor mBgExecutor;
    private final Executor mUiExecutor;
    private final Executor mLongRunningExecutor;
    private final boolean mGuestUserAutoCreated;
    private final AtomicBoolean mGuestIsResetting;
    private final AtomicBoolean mGuestCreationScheduled;
@@ -177,6 +179,7 @@ public class UserSwitcherController implements Dumpable {
            TelephonyListenerManager telephonyListenerManager,
            SecureSettings secureSettings,
            @Background Executor bgExecutor,
            @LongRunning Executor longRunningExecutor,
            @Main Executor uiExecutor,
            InteractionJankMonitor interactionJankMonitor,
            LatencyTracker latencyTracker,
@@ -195,6 +198,7 @@ public class UserSwitcherController implements Dumpable {
        mGuestResumeSessionReceiver = new GuestResumeSessionReceiver(
                this, mUserTracker, mUiEventLogger, secureSettings);
        mBgExecutor = bgExecutor;
        mLongRunningExecutor = longRunningExecutor;
        mUiExecutor = uiExecutor;
        if (!UserManager.isGuestUserEphemeral()) {
            mGuestResumeSessionReceiver.register(mBroadcastDispatcher);
@@ -794,7 +798,7 @@ public class UserSwitcherController implements Dumpable {
            return;
        }

        mBgExecutor.execute(() -> {
        mLongRunningExecutor.execute(() -> {
            int newGuestId = createGuest();
            mGuestCreationScheduled.set(false);
            mGuestIsResetting.set(false);
+3 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ class UserSwitcherControllerTest : SysuiTestCase() {
    @Mock private lateinit var dialogLaunchAnimator: DialogLaunchAnimator
    private lateinit var testableLooper: TestableLooper
    private lateinit var bgExecutor: FakeExecutor
    private lateinit var longRunningExecutor: FakeExecutor
    private lateinit var uiExecutor: FakeExecutor
    private lateinit var uiEventLogger: UiEventLoggerFake
    private lateinit var userSwitcherController: UserSwitcherController
@@ -117,6 +118,7 @@ class UserSwitcherControllerTest : SysuiTestCase() {
        MockitoAnnotations.initMocks(this)
        testableLooper = TestableLooper.get(this)
        bgExecutor = FakeExecutor(FakeSystemClock())
        longRunningExecutor = FakeExecutor(FakeSystemClock())
        uiExecutor = FakeExecutor(FakeSystemClock())
        uiEventLogger = UiEventLoggerFake()

@@ -167,6 +169,7 @@ class UserSwitcherControllerTest : SysuiTestCase() {
                telephonyListenerManager,
                secureSettings,
                bgExecutor,
                longRunningExecutor,
                uiExecutor,
                interactionJankMonitor,
                latencyTracker,