Get rid of the limit-unlock policy control.
This is merged with force-lock. These both allow effectively the same thing, so there is no reason to junk up the user experience with them as separate entities.
This commit is contained in:
@@ -20396,7 +20396,7 @@
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="4"
|
||||
value="3"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
@@ -20414,17 +20414,6 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="USES_POLICY_LIMIT_UNLOCK"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="3"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="USES_POLICY_RESET_PASSWORD"
|
||||
type="int"
|
||||
transient="false"
|
||||
@@ -20451,7 +20440,7 @@
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="5"
|
||||
value="4"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
|
||||
@@ -80,23 +80,15 @@ public final class DeviceAdminInfo implements Parcelable {
|
||||
public static final int USES_POLICY_RESET_PASSWORD = 2;
|
||||
|
||||
/**
|
||||
* A type of policy that this device admin can use: able to limit the
|
||||
* A type of policy that this device admin can use: able to force the device
|
||||
* to lock via{@link DevicePolicyManager#lockNow} or limit the
|
||||
* maximum lock timeout for the device via
|
||||
* {@link DevicePolicyManager#setMaximumTimeToLock}.
|
||||
*
|
||||
* <p>To control this policy, the device admin must have a "limit-unlock"
|
||||
* tag in the "uses-policies" section of its meta-data.
|
||||
*/
|
||||
public static final int USES_POLICY_LIMIT_UNLOCK = 3;
|
||||
|
||||
/**
|
||||
* A type of policy that this device admin can use: able to force the device
|
||||
* to lock via{@link DevicePolicyManager#lockNow}.
|
||||
*
|
||||
* <p>To control this policy, the device admin must have a "force-lock"
|
||||
* tag in the "uses-policies" section of its meta-data.
|
||||
*/
|
||||
public static final int USES_POLICY_FORCE_LOCK = 4;
|
||||
public static final int USES_POLICY_FORCE_LOCK = 3;
|
||||
|
||||
/**
|
||||
* A type of policy that this device admin can use: able to factory
|
||||
@@ -106,7 +98,7 @@ public final class DeviceAdminInfo implements Parcelable {
|
||||
* <p>To control this policy, the device admin must have a "wipe-data"
|
||||
* tag in the "uses-policies" section of its meta-data.
|
||||
*/
|
||||
public static final int USES_POLICY_WIPE_DATA = 5;
|
||||
public static final int USES_POLICY_WIPE_DATA = 4;
|
||||
|
||||
/** @hide */
|
||||
public static class PolicyInfo {
|
||||
@@ -140,9 +132,6 @@ public final class DeviceAdminInfo implements Parcelable {
|
||||
sPoliciesDisplayOrder.add(new PolicyInfo(USES_POLICY_WATCH_LOGIN, "watch-login",
|
||||
com.android.internal.R.string.policylab_watchLogin,
|
||||
com.android.internal.R.string.policydesc_watchLogin));
|
||||
sPoliciesDisplayOrder.add(new PolicyInfo(USES_POLICY_LIMIT_UNLOCK, "limit-unlock",
|
||||
com.android.internal.R.string.policylab_limitUnlock,
|
||||
com.android.internal.R.string.policydesc_limitUnlock));
|
||||
sPoliciesDisplayOrder.add(new PolicyInfo(USES_POLICY_FORCE_LOCK, "force-lock",
|
||||
com.android.internal.R.string.policylab_forceLock,
|
||||
com.android.internal.R.string.policydesc_forceLock));
|
||||
|
||||
@@ -410,7 +410,7 @@ public class DevicePolicyManager {
|
||||
* the length that the user can set. It takes effect immediately.
|
||||
*
|
||||
* <p>The calling device admin must have requested
|
||||
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_UNLOCK} to be able to call
|
||||
* {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} to be able to call
|
||||
* this method; if it has not, a security exception will be thrown.
|
||||
*
|
||||
* @param admin Which {@link DeviceAdmin} this request is associated with.
|
||||
|
||||
@@ -1218,16 +1218,11 @@
|
||||
<string name="policydesc_resetPassword">Force your password
|
||||
to a new value, requiring the administrator give it to you
|
||||
before you can log in.</string>
|
||||
<!-- Title of policy access to limiting the user's unlock timeout -->
|
||||
<string name="policylab_limitUnlock">Limit lock timeout</string>
|
||||
<!-- Description of policy access to limiting the user's unlock timeout -->
|
||||
<string name="policydesc_limitUnlock">Restrict the unlock timeout
|
||||
durations you can select.</string>
|
||||
<!-- Title of policy access to force lock the device -->
|
||||
<string name="policylab_forceLock">Force lock</string>
|
||||
<!-- Description of policy access to limiting the user's password choices -->
|
||||
<string name="policydesc_forceLock">Force the device to immediately lock,
|
||||
requiring that you re-enter its password.</string>
|
||||
<string name="policydesc_forceLock">Control when device locks,
|
||||
requiring you re-enter its password.</string>
|
||||
<!-- Title of policy access to wipe the user's data -->
|
||||
<string name="policylab_wipeData">Erase all data</string>
|
||||
<!-- Description of policy access to wipe the user's data -->
|
||||
|
||||
@@ -608,7 +608,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
throw new NullPointerException("ComponentName is null");
|
||||
}
|
||||
ActiveAdmin ap = getActiveAdminForCallerLocked(who,
|
||||
DeviceAdminInfo.USES_POLICY_LIMIT_UNLOCK);
|
||||
DeviceAdminInfo.USES_POLICY_FORCE_LOCK);
|
||||
if (ap.maximumTimeToUnlock != timeMs) {
|
||||
ap.maximumTimeToUnlock = timeMs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user