Merge "Expand abbreviation in constant identifier." into oc-dev

This commit is contained in:
Andrew Scull
2017-04-28 17:41:48 +00:00
committed by Android (Google) Code Review
8 changed files with 31 additions and 18 deletions

View File

@@ -6493,7 +6493,7 @@ package android.app.admin {
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT"; field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT";
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE"; field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID"; field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
field public static final int FLAG_EVICT_CE_KEY = 1; // 0x1 field public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1; // 0x1
field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2 field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1 field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff

View File

@@ -18,6 +18,7 @@ package android.app.admin {
method public deprecated java.lang.String getDeviceInitializerApp(); method public deprecated java.lang.String getDeviceInitializerApp();
method public deprecated android.content.ComponentName getDeviceInitializerComponent(); method public deprecated android.content.ComponentName getDeviceInitializerComponent();
method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>); method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>);
field public static final deprecated int FLAG_EVICT_CE_KEY = 1; // 0x1
} }
} }

View File

@@ -6737,7 +6737,7 @@ package android.app.admin {
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT"; field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT";
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE"; field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID"; field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
field public static final int FLAG_EVICT_CE_KEY = 1; // 0x1 field public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1; // 0x1
field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2 field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1 field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff

View File

@@ -16,6 +16,7 @@ package android.app.admin {
method public deprecated android.os.UserHandle createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle); method public deprecated android.os.UserHandle createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle);
method public deprecated android.os.UserHandle createUser(android.content.ComponentName, java.lang.String); method public deprecated android.os.UserHandle createUser(android.content.ComponentName, java.lang.String);
method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>); method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>);
field public static final deprecated int FLAG_EVICT_CE_KEY = 1; // 0x1
} }
} }

View File

@@ -6523,7 +6523,7 @@ package android.app.admin {
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE"; field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID"; field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
field public static final java.lang.String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION"; field public static final java.lang.String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";
field public static final int FLAG_EVICT_CE_KEY = 1; // 0x1 field public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1; // 0x1
field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2 field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1 field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff

View File

@@ -18,6 +18,7 @@ package android.app.admin {
method public deprecated java.lang.String getDeviceInitializerApp(); method public deprecated java.lang.String getDeviceInitializerApp();
method public deprecated android.content.ComponentName getDeviceInitializerComponent(); method public deprecated android.content.ComponentName getDeviceInitializerComponent();
method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>); method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>);
field public static final deprecated int FLAG_EVICT_CE_KEY = 1; // 0x1
} }
} }

View File

@@ -3030,17 +3030,24 @@ public class DevicePolicyManager {
* keyring. The user's credential will need to be entered again in order to derive the * keyring. The user's credential will need to be entered again in order to derive the
* credential encryption key that will be stored back in the keyring for future use. * credential encryption key that will be stored back in the keyring for future use.
* <p> * <p>
* This flag can only be used by a profile owner when locking a managed profile on an FBE * This flag can only be used by a profile owner when locking a managed profile when
* device. * {@link #getStorageEncryptionStatus} returns {@link #ENCRYPTION_STATUS_ACTIVE_PER_USER}.
* <p> * <p>
* In order to secure user data, the user will be stopped and restarted so apps should wait * In order to secure user data, the user will be stopped and restarted so apps should wait
* until they are next run to perform further actions. * until they are next run to perform further actions.
*/ */
public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1;
/**
* Instead use {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY}.
* @removed
*/
@Deprecated
public static final int FLAG_EVICT_CE_KEY = 1; public static final int FLAG_EVICT_CE_KEY = 1;
/** @hide */ /** @hide */
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@IntDef(flag=true, value={FLAG_EVICT_CE_KEY}) @IntDef(flag=true, value={FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY})
public @interface LockNowFlag {} public @interface LockNowFlag {}
/** /**
@@ -3072,15 +3079,17 @@ public class DevicePolicyManager {
* This method can be called on the {@link DevicePolicyManager} instance returned by * This method can be called on the {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to lock the parent profile. * {@link #getParentProfileInstance(ComponentName)} in order to lock the parent profile.
* *
* @param flags May be 0 or {@link #FLAG_EVICT_CE_KEY}. * @param flags May be 0 or {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY}.
* @throws SecurityException if the calling application does not own an active administrator * @throws SecurityException if the calling application does not own an active administrator
* that uses {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} or the * that uses {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} or the
* {@link #FLAG_EVICT_CE_KEY} flag is passed by an application that is not a profile * {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY} flag is passed by an application
* that is not a profile
* owner of a managed profile. * owner of a managed profile.
* @throws IllegalArgumentException if the {@link #FLAG_EVICT_CE_KEY} flag is passed when * @throws IllegalArgumentException if the {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY} flag is
* locking the parent profile. * passed when locking the parent profile.
* @throws UnsupportedOperationException if the {@link #FLAG_EVICT_CE_KEY} flag is passed on a * @throws UnsupportedOperationException if the {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY}
* non-FBE device. * flag is passed when {@link #getStorageEncryptionStatus} does not return
* {@link #ENCRYPTION_STATUS_ACTIVE_PER_USER}.
*/ */
public void lockNow(@LockNowFlag int flags) { public void lockNow(@LockNowFlag int flags) {
if (mService != null) { if (mService != null) {

View File

@@ -4651,19 +4651,20 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
final long ident = mInjector.binderClearCallingIdentity(); final long ident = mInjector.binderClearCallingIdentity();
try { try {
// Evict key // Evict key
if ((flags & DevicePolicyManager.FLAG_EVICT_CE_KEY) != 0) { if ((flags & DevicePolicyManager.FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY) != 0) {
enforceManagedProfile(callingUserId, "set FLAG_EVICT_CE_KEY"); enforceManagedProfile(
callingUserId, "set FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY");
if (!isProfileOwner(admin.info.getComponent(), callingUserId)) { if (!isProfileOwner(admin.info.getComponent(), callingUserId)) {
throw new SecurityException( throw new SecurityException("Only profile owner admins can set "
"Only profile owner admins can set FLAG_EVICT_CE_KEY"); + "FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY");
} }
if (parent) { if (parent) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Cannot set FLAG_EVICT_CE_KEY for the parent"); "Cannot set FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY for the parent");
} }
if (!mInjector.storageManagerIsFileBasedEncryptionEnabled()) { if (!mInjector.storageManagerIsFileBasedEncryptionEnabled()) {
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
"FLAG_EVICT_CE_KEY only applies to FBE devices"); "FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY only applies to FBE devices");
} }
mUserManager.evictCredentialEncryptionKey(callingUserId); mUserManager.evictCredentialEncryptionKey(callingUserId);
} }