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

Commit cac0014a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add IActivityManager.stopUserWithDelayedLocking"

parents d5dc1844 4cb99331
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -355,6 +355,12 @@ interface IActivityManager {
            in Bundle options, int userId);
    @UnsupportedAppUsage
    int stopUser(int userid, boolean force, in IStopUserCallback callback);
    /**
     * Check {@link com.android.server.am.ActivityManagerService#stopUserWithDelayedLocking(int, boolean, IStopUserCallback)}
     * for details.
     */
    int stopUserWithDelayedLocking(int userid, boolean force, in IStopUserCallback callback);

    @UnsupportedAppUsage
    void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name);
    void unregisterUserSwitchObserver(in IUserSwitchObserver observer);
+31 −6
Original line number Diff line number Diff line
@@ -9108,13 +9108,14 @@ public class ActivityManagerService extends IActivityManager.Stub
            final Resources res = mContext.getResources();
            mAppErrors.loadAppsNotReportingCrashesFromConfigLocked(res.getString(
                    com.android.internal.R.string.config_appsNotReportingCrashes));
            mUserController.mUserSwitchUiEnabled = !res.getBoolean(
            final boolean userSwitchUiEnabled = !res.getBoolean(
                    com.android.internal.R.bool.config_customUserSwitchUi);
            mUserController.mMaxRunningUsers = res.getInteger(
            final int maxRunningUsers = res.getInteger(
                    com.android.internal.R.integer.config_multiuserMaxRunningUsers);
            mUserController.mDelayUserDataLocking = res.getBoolean(
            final boolean delayUserDataLocking = res.getBoolean(
                    com.android.internal.R.bool.config_multiuserDelayUserDataLocking);
            mUserController.setInitialConfig(userSwitchUiEnabled, maxRunningUsers,
                    delayUserDataLocking);
            mWaitForNetworkTimeoutMs = waitForNetworkTimeoutMs;
            mPssDeferralTime = pssDeferralMs;
        }
@@ -17942,7 +17943,31 @@ public class ActivityManagerService extends IActivityManager.Stub
    @Override
    public int stopUser(final int userId, boolean force, final IStopUserCallback callback) {
        return mUserController.stopUser(userId, force, callback, null /* keyEvictedCallback */);
        return mUserController.stopUser(userId, force, /* allowDelayedLocking= */ false,
                /* callback= */ callback, /* keyEvictedCallback= */ null);
    }
    /**
     * Stops user but allow delayed locking. Delayed locking keeps user unlocked even after
     * stopping only if {@code config_multiuserDelayUserDataLocking} overlay is set true.
     *
     * <p>When delayed locking is not enabled through the overlay, this call becomes the same
     * with {@link #stopUser(int, boolean, IStopUserCallback)} call.
     *
     * @param userId User id to stop.
     * @param force Force stop the user even if the user is related with system user or current
     *              user.
     * @param callback Callback called when user has stopped.
     *
     * @return {@link ActivityManager#USER_OP_SUCCESS} when user is stopped successfully. Returns
     *         other {@code ActivityManager#USER_OP_*} codes for failure.
     *
     */
    @Override
    public int stopUserWithDelayedLocking(final int userId, boolean force,
            final IStopUserCallback callback) {
        return mUserController.stopUser(userId, force, /* allowDelayedLocking= */ true,
                /* callback= */ callback, /* keyEvictedCallback= */ null);
    }
    @Override
@@ -18348,7 +18373,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        @Override
        public int getMaxRunningUsers() {
            return mUserController.mMaxRunningUsers;
            return mUserController.getMaxRunningUsers();
        }
        @Override
+155 −56

File changed.

Preview size limit exceeded, changes collapsed.

+101 −11

File changed.

Preview size limit exceeded, changes collapsed.