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

Commit 4815d345 authored by Felipe Leme's avatar Felipe Leme Committed by Android (Google) Code Review
Browse files

Merge "Renamed methods related to starting user in bg visible on display."

parents 4da4279d de516e65
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ package android.app {
  public class ActivityManager {
    method @RequiresPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER) public void addHomeVisibilityListener(@NonNull java.util.concurrent.Executor, @NonNull android.app.HomeVisibilityListener);
    method public void alwaysShowUnsupportedCompileSdkWarning(android.content.ComponentName);
    method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) public int[] getSecondaryDisplayIdsForStartingBackgroundUsers();
    method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) public int[] getDisplayIdsForStartingVisibleBackgroundUsers();
    method public long getTotalRam();
    method @RequiresPermission(allOf={android.Manifest.permission.PACKAGE_USAGE_STATS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}, conditional=true) public int getUidProcessCapabilities(int);
    method @RequiresPermission(allOf={android.Manifest.permission.PACKAGE_USAGE_STATS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}, conditional=true) public int getUidProcessState(int);
@@ -136,7 +136,7 @@ package android.app {
    method public static void resumeAppSwitches() throws android.os.RemoteException;
    method @RequiresPermission(android.Manifest.permission.CHANGE_CONFIGURATION) public void scheduleApplicationInfoChanged(java.util.List<java.lang.String>, int);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) public void setStopUserOnSwitch(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) public boolean startUserInBackgroundOnSecondaryDisplay(int, int);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) public boolean startUserInBackgroundVisibleOnDisplay(int, int);
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public boolean stopUser(int, boolean);
    method @RequiresPermission(android.Manifest.permission.CHANGE_CONFIGURATION) public boolean updateMccMncConfiguration(@NonNull String, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.DUMP) public void waitForBroadcastIdle();
@@ -1942,7 +1942,7 @@ package android.os {
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean hasBaseUserRestriction(@NonNull String, @NonNull android.os.UserHandle);
    method public static boolean isSplitSystemUser();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isUserTypeEnabled(@NonNull String);
    method public boolean isUsersOnSecondaryDisplaysSupported();
    method public boolean isVisibleBackgroundUsersSupported();
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.content.pm.UserInfo preCreateUser(@NonNull String) throws android.os.UserManager.UserOperationException;
  }

+7 −8
Original line number Diff line number Diff line
@@ -4380,7 +4380,7 @@ public class ActivityManager {
     *
     * <p>This method will allow the user to launch activities on that display, and it's typically
     * used only on automotive builds when the vehicle has multiple displays (you can verify if it's
     * supported by calling {@link UserManager#isUsersOnSecondaryDisplaysSupported()}).
     * supported by calling {@link UserManager#isVisibleBackgroundUsersSupported()}).
     *
     * <p><b>NOTE:</b> differently from {@link #switchUser(int)}, which stops the current foreground
     * user before starting a new one, this method does not stop the previous user running in
@@ -4404,14 +4404,13 @@ public class ActivityManager {
    @TestApi
    @RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS,
            android.Manifest.permission.INTERACT_ACROSS_USERS})
    public boolean startUserInBackgroundOnSecondaryDisplay(@UserIdInt int userId,
            int displayId) {
        if (!UserManager.isUsersOnSecondaryDisplaysEnabled()) {
    public boolean startUserInBackgroundVisibleOnDisplay(@UserIdInt int userId, int displayId) {
        if (!UserManager.isVisibleBackgroundUsersEnabled()) {
            throw new UnsupportedOperationException(
                    "device does not support users on secondary displays");
        }
        try {
            return getService().startUserInBackgroundOnSecondaryDisplay(userId, displayId);
            return getService().startUserInBackgroundVisibleOnDisplay(userId, displayId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -4427,9 +4426,9 @@ public class ActivityManager {
    @Nullable
    @RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS,
            android.Manifest.permission.INTERACT_ACROSS_USERS})
    public int[] getSecondaryDisplayIdsForStartingBackgroundUsers() {
    public int[] getDisplayIdsForStartingVisibleBackgroundUsers() {
        try {
            return getService().getSecondaryDisplayIdsForStartingBackgroundUsers();
            return getService().getDisplayIdsForStartingVisibleBackgroundUsers();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -4589,7 +4588,7 @@ public class ActivityManager {
     * Stops the given {@code userId}.
     *
     * <p><b>NOTE:</b> on systems that support
     * {@link UserManager#isUsersOnSecondaryDisplaysSupported() background users on secondary
     * {@link UserManager#isVisibleBackgroundUsersSupported() background users on secondary
     * displays}, this method will also unassign the user from the display it was started on.
     *
     * @hide
+3 −3
Original line number Diff line number Diff line
@@ -799,14 +799,14 @@ interface IActivityManager {
     */
    @JavaPassthrough(annotation=
            "@android.annotation.RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}, conditional = true)")
    boolean startUserInBackgroundOnSecondaryDisplay(int userid, int displayId);
    boolean startUserInBackgroundVisibleOnDisplay(int userid, int displayId);

    /**
     * Gets the ids of displays that can be used on {@link #startUserInBackgroundOnSecondaryDisplay(int userId, int displayId)}.
     * Gets the ids of displays that can be used on {@link #startUserInBackgroundVisibleOnDisplay(int userId, int displayId)}.
     *
     * <p>Typically used only by automotive builds when the vehicle has multiple displays.
     */
    @nullable int[] getSecondaryDisplayIdsForStartingBackgroundUsers();
    @nullable int[] getDisplayIdsForStartingVisibleBackgroundUsers();

    /** Returns if the service is a short-service is still "alive" and past the timeout. */
    boolean shouldServiceTimeOut(in ComponentName className, in IBinder token);
+7 −6
Original line number Diff line number Diff line
@@ -2912,14 +2912,15 @@ public class UserManager {
    /**
     * @hide
     */
    public static boolean isUsersOnSecondaryDisplaysEnabled() {
        return SystemProperties.getBoolean("fw.users_on_secondary_displays",
    public static boolean isVisibleBackgroundUsersEnabled() {
        return SystemProperties.getBoolean("fw.visible_bg_users",
                Resources.getSystem()
                        .getBoolean(R.bool.config_multiuserUsersOnSecondaryDisplays));
                        .getBoolean(R.bool.config_multiuserVisibleBackgroundUsers));
    }

    /**
     * Returns whether the device allows users to run (and launch activities) on secondary displays.
     * Returns whether the device allows (full) users to be started in background visible in a given
     * display (which would allow them to launch activities in that display).
     *
     * @return {@code false} for most devices, except on automotive builds for vehiches with
     * passenger displays.
@@ -2927,8 +2928,8 @@ public class UserManager {
     * @hide
     */
    @TestApi
    public boolean isUsersOnSecondaryDisplaysSupported() {
        return isUsersOnSecondaryDisplaysEnabled();
    public boolean isVisibleBackgroundUsersSupported() {
        return isVisibleBackgroundUsersEnabled();
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -2672,9 +2672,9 @@
         will be locked. -->
    <bool name="config_multiuserDelayUserDataLocking">false</bool>

    <!-- Whether the device allows users to start in background on secondary displays.
    <!-- Whether the device allows users to start in background visible on displays.
         Should be false for most devices, except automotive vehicle with passenger displays. -->
    <bool name="config_multiuserUsersOnSecondaryDisplays">false</bool>
    <bool name="config_multiuserVisibleBackgroundUsers">false</bool>

    <!-- Whether to automatically switch to the designated Dock User (the user chosen for
         displaying dreams, etc.) after a timeout when the device is docked.  -->
Loading