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

Commit 4dd8644d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "UserLifecycleStressTest: not stop user on switch" into main

parents dc1ffc33 91039b94
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ package com.android.server.pm;

import static android.os.UserHandle.USER_NULL;

import static com.android.compatibility.common.util.SystemUtil.runWithShellPermissionIdentity;

import static com.google.common.truth.Truth.assertWithMessage;

import static org.junit.Assume.assumeFalse;
@@ -92,10 +94,16 @@ public final class UserLifecycleStressTest {
                Settings.Global.REMOVE_GUEST_ON_EXIT);
        waitForBroadcastBarrier(); // isolate tests from each other
        mOriginalCurrentUserId = ActivityManager.getCurrentUser();
        runWithShellPermissionIdentity(
                () -> mActivityManager.setStopUserOnSwitch(
                        ActivityManager.STOP_USER_ON_SWITCH_FALSE));
    }

    @After
    public void tearDown() throws Exception {
        runWithShellPermissionIdentity(
                () -> mActivityManager.setStopUserOnSwitch(
                        ActivityManager.STOP_USER_ON_SWITCH_DEFAULT));
        switchUser("on tearDown()", mOriginalCurrentUserId);
        mUserSwitchWaiter.close();
        Settings.Global.putString(mContext.getContentResolver(),