diff options
| author | Eran Messeri <eranm@google.com> | 2018-03-27 19:34:03 +0100 |
|---|---|---|
| committer | Eran Messeri <eranm@google.com> | 2018-03-29 21:56:37 +0100 |
| commit | adaf68cd627e6d8447c061ead91bd5ad95013f91 (patch) | |
| tree | 88a30b6d93ef9ab6b98325dc1364f120a77f2f32 /core/java/android | |
| parent | 87860048bd81f0b6d6848bf81be4d0ef48304653 (diff) | |
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
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 9 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageManager.java | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 5c55e4fa3fc7..a5a58fe20ace 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -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 diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 491f0af2576d..dd86d475b0e8 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -2629,6 +2629,17 @@ public abstract class PackageManager { "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 */ |
