Device ID attestation: Add feature flag.

Add a feature flag to find out if Device ID attestation is supported or
not, as it is an optional feature.
Otherwise, the cts tests could not meaningfully say if the device
correctly supports this feature or not.

Bug: 72642093
Bug: 73448533
Test: Modified CTS tests.
Change-Id: Ia6ba47a5262412ab24afa700d1b891be10a21df9
This commit is contained in:
Eran Messeri
2018-03-27 19:34:03 +01:00
parent 87860048bd
commit adaf68cd62
3 changed files with 21 additions and 0 deletions

View File

@@ -6508,6 +6508,7 @@ package android.app.admin {
method public boolean isApplicationHidden(android.content.ComponentName, java.lang.String);
method public boolean isBackupServiceEnabled(android.content.ComponentName);
method public deprecated boolean isCallerApplicationRestrictionsManagingPackage();
method public boolean isDeviceIdAttestationSupported();
method public boolean isDeviceOwnerApp(java.lang.String);
method public boolean isEphemeralUser(android.content.ComponentName);
method public boolean isLockTaskPermitted(java.lang.String);

View File

@@ -4292,6 +4292,15 @@ public class DevicePolicyManager {
return null;
}
/**
* Returns {@code true} if the device supports attestation of device identifiers in addition
* to key attestation.
* @return {@code true} if Device ID attestation is supported.
*/
public boolean isDeviceIdAttestationSupported() {
PackageManager pm = mContext.getPackageManager();
return pm.hasSystemFeature(PackageManager.FEATURE_DEVICE_ID_ATTESTATION);
}
/**
* Called by a device or profile owner, or delegated certificate installer, to associate

View File

@@ -2628,6 +2628,17 @@ public abstract class PackageManager {
public static final String FEATURE_STRONGBOX_KEYSTORE =
"android.hardware.strongbox_keystore";
/**
* Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
* The device has a Keymaster implementation that supports Device ID attestation.
*
* @see DevicePolicyManager#isDeviceIdAttestationSupported
* @hide
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_DEVICE_ID_ATTESTATION =
"android.software.device_id_attestation";
/**
* Action to external storage service to clean out removed apps.
* @hide