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

Commit 7f1f1dfc authored by Oleksandr Peletskyi's avatar Oleksandr Peletskyi
Browse files

Added restriction if a user is allowed to change the icon.

BUG: 25305966

Change-Id: I3d527224f00087b2bd959879ebb143e2ecb9c914
parent 3dbb412c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -28558,6 +28558,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
    field public static final java.lang.String DISALLOW_REMOVE_USER = "no_remove_user";
    field public static final java.lang.String DISALLOW_SAFE_BOOT = "no_safe_boot";
    field public static final java.lang.String DISALLOW_SET_USER_ICON = "no_set_user_icon";
    field public static final java.lang.String DISALLOW_SHARE_LOCATION = "no_share_location";
    field public static final java.lang.String DISALLOW_SMS = "no_sms";
    field public static final java.lang.String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
+1 −0
Original line number Diff line number Diff line
@@ -30576,6 +30576,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
    field public static final java.lang.String DISALLOW_REMOVE_USER = "no_remove_user";
    field public static final java.lang.String DISALLOW_SAFE_BOOT = "no_safe_boot";
    field public static final java.lang.String DISALLOW_SET_USER_ICON = "no_set_user_icon";
    field public static final java.lang.String DISALLOW_SHARE_LOCATION = "no_share_location";
    field public static final java.lang.String DISALLOW_SMS = "no_sms";
    field public static final java.lang.String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
+1 −0
Original line number Diff line number Diff line
@@ -28567,6 +28567,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
    field public static final java.lang.String DISALLOW_REMOVE_USER = "no_remove_user";
    field public static final java.lang.String DISALLOW_SAFE_BOOT = "no_safe_boot";
    field public static final java.lang.String DISALLOW_SET_USER_ICON = "no_set_user_icon";
    field public static final java.lang.String DISALLOW_SHARE_LOCATION = "no_share_location";
    field public static final java.lang.String DISALLOW_SMS = "no_sms";
    field public static final java.lang.String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
+15 −0
Original line number Diff line number Diff line
@@ -528,6 +528,21 @@ public class UserManager {
     */
    public static final String DISALLOW_DATA_ROAMING = "no_data_roaming";

    /**
     * Specifies if a user is not allowed to change their icon. Device owner and profile owner
     * can set this restriction. When it is set by device owner, only the target user will be
     * affected. The default value is <code>false</code>.
     *
     * <p>Key for user restrictions.
     *
     * <p>Type: Boolean
     *
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()
     */
    public static final String DISALLOW_SET_USER_ICON = "no_set_user_icon";

    /**
     * Allows apps in the parent profile to handle web links from the managed profile.
     *
+10 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package android.os;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.Bitmap;

/**
 * @hide Only for use within the system server.
@@ -81,4 +82,13 @@ public abstract class UserManagerInternal {
     * whether the user is managed by profile owner.
     */
    public abstract void setUserManaged(int userId, boolean isManaged);

    /**
     * Called by {@link com.android.server.devicepolicy.DevicePolicyManagerService} to omit
     * restriction check, because DevicePolicyManager must always be able to set user icon
     * regardless of any restriction.
     * Also called by {@link com.android.server.pm.UserManagerService} because the logic of setting
     * the icon is in this method.
     */
    public abstract void setUserIcon(int userId, Bitmap bitmap);
}
Loading