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

Commit af60534c authored by Charles He's avatar Charles He Committed by Android (Google) Code Review
Browse files

Merge "Add user restriction to suppress error dialogs."

parents f3e2f630 22ff6f9d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31834,6 +31834,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_SET_WALLPAPER = "no_set_wallpaper";
    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_SYSTEM_ERROR_DIALOGS = "no_system_error_dialogs";
    field public static final java.lang.String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
    field public static final java.lang.String DISALLOW_UNMUTE_MICROPHONE = "no_unmute_microphone";
    field public static final java.lang.String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer";
+1 −0
Original line number Diff line number Diff line
@@ -34678,6 +34678,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_SET_WALLPAPER = "no_set_wallpaper";
    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_SYSTEM_ERROR_DIALOGS = "no_system_error_dialogs";
    field public static final java.lang.String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
    field public static final java.lang.String DISALLOW_UNMUTE_MICROPHONE = "no_unmute_microphone";
    field public static final java.lang.String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer";
+1 −0
Original line number Diff line number Diff line
@@ -32097,6 +32097,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_SET_WALLPAPER = "no_set_wallpaper";
    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_SYSTEM_ERROR_DIALOGS = "no_system_error_dialogs";
    field public static final java.lang.String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
    field public static final java.lang.String DISALLOW_UNMUTE_MICROPHONE = "no_unmute_microphone";
    field public static final java.lang.String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer";
+19 −0
Original line number Diff line number Diff line
@@ -573,6 +573,25 @@ public class UserManager {
     */
    public static final String DISALLOW_CREATE_WINDOWS = "no_create_windows";

    /**
     * Specifies that system error dialogs for crashed or unresponsive apps should not be shown.
     * In this case, the system will force-stop the app as if the user chooses the "close app"
     * option on the UI. No feedback report will be collected as there is no way for the user to
     * provide explicit consent.
     *
     * When this user restriction is set by device owners, it's applied to all users; when it's set
     * by profile owners, it's only applied to the relevant profiles.
     * The default value is <code>false</code>.
     *
     * <p>This user restriction has no effect on managed profiles.
     * <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_SYSTEM_ERROR_DIALOGS = "no_system_error_dialogs";

    /**
     * Specifies if what is copied in the clipboard of this profile can
     * be pasted in related profiles. Does not restrict if the clipboard of related profiles can be
+2 −1
Original line number Diff line number Diff line
@@ -199,7 +199,6 @@ import android.annotation.UserIdInt;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityManager.StackId;
import android.app.ActivityManager.StackInfo;
import android.app.ActivityManager.TaskSnapshot;
import android.app.ActivityManagerInternal;
@@ -753,6 +752,8 @@ public class ActivityManagerService extends IActivityManager.Stub
    public boolean canShowErrorDialogs() {
        return mShowDialogs && !mSleeping && !mShuttingDown
                && !mKeyguardController.isKeyguardShowing(DEFAULT_DISPLAY)
                && !mUserController.hasUserRestriction(UserManager.DISALLOW_SYSTEM_ERROR_DIALOGS,
                        mUserController.getCurrentUserId())
                && !(UserManager.isDeviceInDemoMode(mContext)
                        && mUserController.getCurrentUser().isDemo());
    }
Loading