Rename LOCK_STATE_ALWAYS_LOCKED to LOCK_STATE_DEFAULT

Also update the documentation to more accurately represent what the
flag actually does.

Bug: 217273933
Test: existing tests should pass
Change-Id: I28c9798d7974e58cfcd6ab59e7ee50f9a6c43985
This commit is contained in:
Antony Sargent
2022-02-08 20:11:30 -08:00
parent ce52ece919
commit e1db351bfb
2 changed files with 8 additions and 7 deletions

View File

@@ -2772,8 +2772,8 @@ package android.companion.virtual {
method @NonNull public java.util.Set<android.os.UserHandle> getUsersWithMatchingAccounts();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.companion.virtual.VirtualDeviceParams> CREATOR;
field public static final int LOCK_STATE_ALWAYS_LOCKED = 0; // 0x0
field public static final int LOCK_STATE_ALWAYS_UNLOCKED = 1; // 0x1
field public static final int LOCK_STATE_DEFAULT = 0; // 0x0
}
public static final class VirtualDeviceParams.Builder {

View File

@@ -48,15 +48,16 @@ public final class VirtualDeviceParams implements Parcelable {
/** @hide */
@IntDef(prefix = "LOCK_STATE_",
value = {LOCK_STATE_ALWAYS_LOCKED, LOCK_STATE_ALWAYS_UNLOCKED})
value = {LOCK_STATE_DEFAULT, LOCK_STATE_ALWAYS_UNLOCKED})
@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
public @interface LockState {}
/**
* Indicates that the lock state of the virtual device should be always locked.
* Indicates that the lock state of the virtual device will be the same as the default physical
* display.
*/
public static final int LOCK_STATE_ALWAYS_LOCKED = 0;
public static final int LOCK_STATE_DEFAULT = 0;
/**
* Indicates that the lock state of the virtual device should be always unlocked.
@@ -199,7 +200,7 @@ public final class VirtualDeviceParams implements Parcelable {
*/
public static final class Builder {
private @LockState int mLockState = LOCK_STATE_ALWAYS_LOCKED;
private @LockState int mLockState = LOCK_STATE_DEFAULT;
private Set<UserHandle> mUsersWithMatchingAccounts;
@Nullable private Set<ComponentName> mBlockedActivities;
@Nullable private Set<ComponentName> mAllowedActivities;
@@ -207,9 +208,9 @@ public final class VirtualDeviceParams implements Parcelable {
/**
* Sets the lock state of the device. The permission {@code ADD_ALWAYS_UNLOCKED_DISPLAY}
* is required if this is set to {@link #LOCK_STATE_ALWAYS_UNLOCKED}.
* The default is {@link #LOCK_STATE_ALWAYS_LOCKED}.
* The default is {@link #LOCK_STATE_DEFAULT}.
*
* @param lockState The lock state, either {@link #LOCK_STATE_ALWAYS_LOCKED} or
* @param lockState The lock state, either {@link #LOCK_STATE_DEFAULT} or
* {@link #LOCK_STATE_ALWAYS_UNLOCKED}.
*/
@RequiresPermission(value = ADD_ALWAYS_UNLOCKED_DISPLAY, conditional = true)