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

Commit 65cd2312 authored by Olivier Nshimiye's avatar Olivier Nshimiye
Browse files

Add javadocs for features behind private space flags.

- Add Javadocs changes for making the requestQuietMode API generic
- Update Javadocs for ConnectedApps apis
- Update Javadocs related to stopUserWithDelayedLocking

Bug: 302662311
Change-Id: Ic64fbc1e46f787868aaf58c8febb34ec9fb54e75
parent 99d3091a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -304,6 +304,7 @@ public class CrossProfileApps {
     * <li>It is not equal to the calling user</li>
     * <li>It is in the same profile group of calling user profile</li>
     * <li>It is enabled</li>
     * <li>It is not hidden (ex. profile type {@link UserManager#USER_TYPE_PROFILE_PRIVATE})</li>
     * </ul>
     *
     * @see UserManager#getUserProfiles()
@@ -460,8 +461,8 @@ public class CrossProfileApps {
     *
     * <p>Specifically, returns whether the following are all true:
     * <ul>
     * <li>{@code UserManager#getEnabledProfileIds(int)} returns at least one other profile for the
     * calling user.</li>
     * <li>{@code UserManager#getProfileIdsExcludingHidden(int)} returns at least one other
     * profile for the calling user.</li>
     * <li>The calling app has requested
     * {@code android.Manifest.permission.INTERACT_ACROSS_PROFILES} in its manifest.</li>
     * <li>The calling app is not a profile owner within the profile group of the calling user.</li>
+8 −6
Original line number Diff line number Diff line
@@ -5577,8 +5577,8 @@ public class UserManager {
    }

    /**
     * Enables or disables quiet mode for a managed profile. If quiet mode is enabled, apps in a
     * managed profile don't run, generate notifications, or consume data or battery.
     * Enables or disables quiet mode for a profile. If quiet mode is enabled, apps in the profile
     * don't run, generate notifications, or consume data or battery.
     * <p>
     * If a user's credential is needed to turn off quiet mode, a confirm credential screen will be
     * shown to the user.
@@ -5586,8 +5586,11 @@ public class UserManager {
     * The change may not happen instantly, however apps can listen for
     * {@link Intent#ACTION_MANAGED_PROFILE_AVAILABLE} and
     * {@link Intent#ACTION_MANAGED_PROFILE_UNAVAILABLE} broadcasts in order to be notified of
     * the change of the quiet mode. Apps can also check the current state of quiet mode by
     * calling {@link #isQuietModeEnabled(UserHandle)}.
     * the change of the quiet mode for managed profile.
     * Apps can listen to generic broadcasts {@link Intent#ACTION_PROFILE_AVAILABLE} and
     * {@link Intent#ACTION_PROFILE_UNAVAILABLE} to be notified of the change in quiet mode for
     * any profiles. Apps can also check the current state of quiet mode by calling
     * {@link #isQuietModeEnabled(UserHandle)}.
     * <p>
     * The caller must either be the foreground default launcher or have one of these permissions:
     * {@code MANAGE_USERS} or {@code MODIFY_QUIET_MODE}.
@@ -5597,7 +5600,7 @@ public class UserManager {
     * @return {@code false} if user's credential is needed in order to turn off quiet mode,
     *         {@code true} otherwise
     * @throws SecurityException if the caller is invalid
     * @throws IllegalArgumentException if {@code userHandle} is not a managed profile
     * @throws IllegalArgumentException if {@code userHandle} is not a profile
     *
     * @see #isQuietModeEnabled(UserHandle)
     */
@@ -5662,7 +5665,6 @@ public class UserManager {

    /**
     * Returns whether the given profile is in quiet mode or not.
     * Notes: Quiet mode is only supported for managed profiles.
     *
     * @param userHandle The user handle of the profile to be queried.
     * @return true if the profile is in quiet mode, false otherwise.
+4 −3
Original line number Diff line number Diff line
@@ -306,6 +306,7 @@ import android.content.pm.ServiceInfo;
import android.content.pm.SharedLibraryInfo;
import android.content.pm.TestUtilityService;
import android.content.pm.UserInfo;
import android.content.pm.UserProperties;
import android.content.pm.VersionedPackage;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
@@ -18183,7 +18184,9 @@ public class ActivityManagerService extends IActivityManager.Stub
    /**
     * Stops user but allow delayed locking. Delayed locking keeps user unlocked even after
     * stopping only if {@code config_multiuserDelayUserDataLocking} overlay is set true.
     * stopping only if {@code config_multiuserDelayUserDataLocking} overlay is set true on the
     * device or if the user has {@link UserProperties#getAllowStoppingUserWithDelayedLocking()}
     * set to true.
     *
     * <p>When delayed locking is not enabled through the overlay, this call becomes the same
     * with {@link #stopUserWithCallback(int, IStopUserCallback)} call.
@@ -18195,8 +18198,6 @@ public class ActivityManagerService extends IActivityManager.Stub
     *         other {@code ActivityManager#USER_OP_*} codes for failure.
     *
     */
    // TODO(b/302662311): Add javadoc changes corresponding to the user property that allows
    // delayed locking behavior once the private space flag is finalized.
    @Override
    public int stopUserWithDelayedLocking(@UserIdInt int userId, IStopUserCallback callback) {
        return mUserController.stopUser(userId, /* allowDelayedLocking= */ true,
+4 −2
Original line number Diff line number Diff line
@@ -384,9 +384,11 @@ class UserController implements Handler.Callback {
     * postponed until total number of unlocked users in the system reaches mMaxRunningUsers.
     * Once total number of unlocked users reach mMaxRunningUsers, least recently used user
     * will be locked.
     *
     * <p> Note: Even if this is false for the device as a whole, it is possible some users may
     * individually allow delayed locking, as specified by
     * {@link UserProperties#getAllowStoppingUserWithDelayedLocking()}.
     */
    // TODO(b/302662311): Add javadoc changes corresponding to the user property that allows
    // delayed locking behavior once the private space flag is finalized.
    @GuardedBy("mLock")
    private boolean mDelayUserDataLocking;