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

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

Merge "New DevicePolicyManager operation: OPERATION_REBOOT."

parents c5b1410f a9daef82
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -380,6 +380,7 @@ package android.app.admin {
    field public static final String ACTION_DATA_SHARING_RESTRICTION_APPLIED = "android.app.action.DATA_SHARING_RESTRICTION_APPLIED";
    field public static final int OPERATION_CREATE_AND_MANAGE_USER = 5; // 0x5
    field public static final int OPERATION_LOCK_NOW = 1; // 0x1
    field public static final int OPERATION_REBOOT = 7; // 0x7
    field public static final int OPERATION_REMOVE_USER = 6; // 0x6
    field public static final int OPERATION_START_USER_IN_BACKGROUND = 3; // 0x3
    field public static final int OPERATION_STOP_USER = 4; // 0x4
+5 −1
Original line number Diff line number Diff line
@@ -2610,6 +2610,9 @@ public class DevicePolicyManager {
    /** @hide */
    @TestApi
    public static final int OPERATION_REMOVE_USER = 6;
    /** @hide */
    @TestApi
    public static final int OPERATION_REBOOT = 7;
    private static final String PREFIX_OPERATION = "OPERATION_";
@@ -2620,7 +2623,8 @@ public class DevicePolicyManager {
            OPERATION_START_USER_IN_BACKGROUND,
            OPERATION_STOP_USER,
            OPERATION_CREATE_AND_MANAGE_USER,
            OPERATION_REMOVE_USER
            OPERATION_REMOVE_USER,
            OPERATION_REBOOT
    })
    @Retention(RetentionPolicy.SOURCE)
    public static @interface DevicePolicyOperation {
+1 −1
Original line number Diff line number Diff line
@@ -12564,7 +12564,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        Objects.requireNonNull(admin, "ComponentName is null");
        final CallerIdentity caller = getCallerIdentity(admin);
        Preconditions.checkCallAuthorization(isDeviceOwner(caller));
        checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_REBOOT);
        mInjector.binderWithCleanCallingIdentity(() -> {
            // Make sure there are no ongoing calls on the device.
            if (mTelephonyManager.getCallState() != TelephonyManager.CALL_STATE_IDLE) {