From cd6c58acd83c7a77783258f65dc99a0455e290d2 Mon Sep 17 00:00:00 2001 From: Qi Wu Date: Sat, 16 Jan 2021 23:26:30 +0800 Subject: [PATCH] Limited use key: feature flags. Add feature flags to indicate whether KeyMint only enforce this feature in hardware with count == 1 or enforce with any number of the count (>=1). Test: compile Change-Id: Id9c13ee91b779164bd07ff20ae2b4c0e158fdb33 Merged-In: Id9c13ee91b779164bd07ff20ae2b4c0e158fdb33 --- core/api/current.txt | 2 ++ .../android/content/pm/PackageManager.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/core/api/current.txt b/core/api/current.txt index 285506f0556d3..e9f2d7bdf8d02 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -12133,6 +12133,8 @@ package android.content.pm { field public static final String FEATURE_INPUT_METHODS = "android.software.input_methods"; field public static final String FEATURE_IPSEC_TUNNELS = "android.software.ipsec_tunnels"; field public static final String FEATURE_IRIS = "android.hardware.biometrics.iris"; + field public static final String FEATURE_KEYSTORE_LIMITED_USE_KEY = "android.hardware.keystore.limited_use_key"; + field public static final String FEATURE_KEYSTORE_SINGLE_USE_KEY = "android.hardware.keystore.single_use_key"; field public static final String FEATURE_LEANBACK = "android.software.leanback"; field public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only"; field public static final String FEATURE_LIVE_TV = "android.software.live_tv"; diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 31beb6e6a5650..742f48c7a6a31 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -3224,6 +3224,24 @@ public abstract class PackageManager { @SdkConstant(SdkConstantType.FEATURE) public static final String FEATURE_APP_ENUMERATION = "android.software.app_enumeration"; + /** + * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device has + * a Keystore implementation that can only enforce limited use key in hardware with max usage + * count equals to 1. + */ + @SdkConstant(SdkConstantType.FEATURE) + public static final String FEATURE_KEYSTORE_SINGLE_USE_KEY = + "android.hardware.keystore.single_use_key"; + + /** + * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device has + * a Keystore implementation that can enforce limited use key in hardware with any max usage + * count (including count equals to 1). + */ + @SdkConstant(SdkConstantType.FEATURE) + public static final String FEATURE_KEYSTORE_LIMITED_USE_KEY = + "android.hardware.keystore.limited_use_key"; + /** @hide */ public static final boolean APP_ENUMERATION_ENABLED_BY_DEFAULT = true;