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

Commit 4ca9955d authored by Craig Lafayette's avatar Craig Lafayette Committed by Android (Google) Code Review
Browse files

Merge "DevicePolicyManager API review changes" into mnc-dev

parents f4cf03dc 4e401fa4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -5835,7 +5835,6 @@ package android.app.admin {
    field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD";
    field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD";
    field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
    field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
    field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED";
    field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED";
    field public static final int DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
    field public static final int ENCRYPTION_STATUS_ACTIVATING = 2; // 0x2
    field public static final int ENCRYPTION_STATUS_ACTIVATING = 2; // 0x2
    field public static final int ENCRYPTION_STATUS_ACTIVE = 3; // 0x3
    field public static final int ENCRYPTION_STATUS_ACTIVE = 3; // 0x3
    field public static final int ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY = 4; // 0x4
    field public static final int ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY = 4; // 0x4
@@ -5900,6 +5899,7 @@ package android.app.admin {
    field public static final int PERMISSION_POLICY_AUTO_DENY = 2; // 0x2
    field public static final int PERMISSION_POLICY_AUTO_DENY = 2; // 0x2
    field public static final int PERMISSION_POLICY_AUTO_GRANT = 1; // 0x1
    field public static final int PERMISSION_POLICY_AUTO_GRANT = 1; // 0x1
    field public static final int PERMISSION_POLICY_PROMPT = 0; // 0x0
    field public static final int PERMISSION_POLICY_PROMPT = 0; // 0x0
    field public static final int RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
    field public static final int RESET_PASSWORD_REQUIRE_ENTRY = 1; // 0x1
    field public static final int RESET_PASSWORD_REQUIRE_ENTRY = 1; // 0x1
    field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
    field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
    field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
    field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
+1 −1
Original line number Original line Diff line number Diff line
@@ -5943,7 +5943,6 @@ package android.app.admin {
    field public static final java.lang.String ACTION_SET_PROFILE_OWNER = "android.app.action.SET_PROFILE_OWNER";
    field public static final java.lang.String ACTION_SET_PROFILE_OWNER = "android.app.action.SET_PROFILE_OWNER";
    field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
    field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
    field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED";
    field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED";
    field public static final int DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
    field public static final int ENCRYPTION_STATUS_ACTIVATING = 2; // 0x2
    field public static final int ENCRYPTION_STATUS_ACTIVATING = 2; // 0x2
    field public static final int ENCRYPTION_STATUS_ACTIVE = 3; // 0x3
    field public static final int ENCRYPTION_STATUS_ACTIVE = 3; // 0x3
    field public static final int ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY = 4; // 0x4
    field public static final int ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY = 4; // 0x4
@@ -6011,6 +6010,7 @@ package android.app.admin {
    field public static final int PERMISSION_POLICY_AUTO_DENY = 2; // 0x2
    field public static final int PERMISSION_POLICY_AUTO_DENY = 2; // 0x2
    field public static final int PERMISSION_POLICY_AUTO_GRANT = 1; // 0x1
    field public static final int PERMISSION_POLICY_AUTO_GRANT = 1; // 0x1
    field public static final int PERMISSION_POLICY_PROMPT = 0; // 0x0
    field public static final int PERMISSION_POLICY_PROMPT = 0; // 0x0
    field public static final int RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
    field public static final int RESET_PASSWORD_REQUIRE_ENTRY = 1; // 0x1
    field public static final int RESET_PASSWORD_REQUIRE_ENTRY = 1; // 0x1
    field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
    field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
    field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
    field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
+4 −4
Original line number Original line Diff line number Diff line
@@ -1653,9 +1653,9 @@ public class DevicePolicyManager {
    }
    }


    /**
    /**
     * Queries whether {@link #DO_NOT_ASK_CREDENTIALS_ON_BOOT} flag is set.
     * Queries whether {@link #RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT} flag is set.
     *
     *
     * @return true if DO_NOT_ASK_CREDENTIALS_ON_BOOT flag is set.
     * @return true if RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT flag is set.
     * @hide
     * @hide
     */
     */
    public boolean getDoNotAskCredentialsOnBoot() {
    public boolean getDoNotAskCredentialsOnBoot() {
@@ -1753,7 +1753,7 @@ public class DevicePolicyManager {
     * is ignored. Once the flag is set, it cannot be reverted back without resetting the
     * is ignored. Once the flag is set, it cannot be reverted back without resetting the
     * device to factory defaults.
     * device to factory defaults.
     */
     */
    public static final int DO_NOT_ASK_CREDENTIALS_ON_BOOT = 0x0002;
    public static final int RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT = 0x0002;


    /**
    /**
     * Force a new device unlock password (the password needed to access the
     * Force a new device unlock password (the password needed to access the
@@ -1779,7 +1779,7 @@ public class DevicePolicyManager {
     *
     *
     * @param password The new password for the user. Null or empty clears the password.
     * @param password The new password for the user. Null or empty clears the password.
     * @param flags May be 0 or combination of {@link #RESET_PASSWORD_REQUIRE_ENTRY} and
     * @param flags May be 0 or combination of {@link #RESET_PASSWORD_REQUIRE_ENTRY} and
     *              {@link #DO_NOT_ASK_CREDENTIALS_ON_BOOT}.
     *              {@link #RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT}.
     * @return Returns true if the password was applied, or false if it is
     * @return Returns true if the password was applied, or false if it is
     * not acceptable for the current constraints.
     * not acceptable for the current constraints.
     */
     */
+1 −1
Original line number Original line Diff line number Diff line
@@ -2897,7 +2897,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {


        boolean callerIsDeviceOwnerAdmin = isCallerDeviceOwnerOrInitializer(callingUid);
        boolean callerIsDeviceOwnerAdmin = isCallerDeviceOwnerOrInitializer(callingUid);
        boolean doNotAskCredentialsOnBoot =
        boolean doNotAskCredentialsOnBoot =
                (flags & DevicePolicyManager.DO_NOT_ASK_CREDENTIALS_ON_BOOT) != 0;
                (flags & DevicePolicyManager.RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT) != 0;
        if (callerIsDeviceOwnerAdmin && doNotAskCredentialsOnBoot) {
        if (callerIsDeviceOwnerAdmin && doNotAskCredentialsOnBoot) {
            setDoNotAskCredentialsOnBoot();
            setDoNotAskCredentialsOnBoot();
        }
        }