Rename MediaDrm security levels
API review requested that MediaDrm security levels be prefixed with a common string. bug:76449152 bug:74831432 Change-Id: I2b4d5ed2c881f736659f29aa76c556a79d1335f4
This commit is contained in:
@@ -23450,9 +23450,6 @@ package android.media {
|
||||
field public static final int HDCP_V2 = 3; // 0x3
|
||||
field public static final int HDCP_V2_1 = 4; // 0x4
|
||||
field public static final int HDCP_V2_2 = 5; // 0x5
|
||||
field public static final int HW_SECURE_ALL = 5; // 0x5
|
||||
field public static final int HW_SECURE_CRYPTO = 3; // 0x3
|
||||
field public static final int HW_SECURE_DECODE = 4; // 0x4
|
||||
field public static final int KEY_TYPE_OFFLINE = 2; // 0x2
|
||||
field public static final int KEY_TYPE_RELEASE = 3; // 0x3
|
||||
field public static final int KEY_TYPE_STREAMING = 1; // 0x1
|
||||
@@ -23461,9 +23458,12 @@ package android.media {
|
||||
field public static final java.lang.String PROPERTY_DEVICE_UNIQUE_ID = "deviceUniqueId";
|
||||
field public static final java.lang.String PROPERTY_VENDOR = "vendor";
|
||||
field public static final java.lang.String PROPERTY_VERSION = "version";
|
||||
field public static final int SECURITY_LEVEL_HW_SECURE_ALL = 5; // 0x5
|
||||
field public static final int SECURITY_LEVEL_HW_SECURE_CRYPTO = 3; // 0x3
|
||||
field public static final int SECURITY_LEVEL_HW_SECURE_DECODE = 4; // 0x4
|
||||
field public static final int SECURITY_LEVEL_SW_SECURE_CRYPTO = 1; // 0x1
|
||||
field public static final int SECURITY_LEVEL_SW_SECURE_DECODE = 2; // 0x2
|
||||
field public static final int SECURITY_LEVEL_UNKNOWN = 0; // 0x0
|
||||
field public static final int SW_SECURE_CRYPTO = 1; // 0x1
|
||||
field public static final int SW_SECURE_DECODE = 2; // 0x2
|
||||
}
|
||||
|
||||
public final class MediaDrm.CryptoSession {
|
||||
|
||||
@@ -654,9 +654,11 @@ public final class MediaDrm implements AutoCloseable {
|
||||
* ID is returned.
|
||||
*
|
||||
* @param level the new security level, one of
|
||||
* {@link #SW_SECURE_CRYPTO}, {@link #SW_SECURE_DECODE},
|
||||
* {@link #HW_SECURE_CRYPTO}, {@link #HW_SECURE_DECODE} or
|
||||
* {@link #HW_SECURE_ALL}.
|
||||
* {@link #SECURITY_LEVEL_SW_SECURE_CRYPTO},
|
||||
* {@link #SECURITY_LEVEL_SW_SECURE_DECODE},
|
||||
* {@link #SECURITY_LEVEL_HW_SECURE_CRYPTO},
|
||||
* {@link #SECURITY_LEVEL_HW_SECURE_DECODE} or
|
||||
* {@link #SECURITY_LEVEL_HW_SECURE_ALL}.
|
||||
*
|
||||
* @throws NotProvisionedException if provisioning is needed
|
||||
* @throws ResourceBusyException if required resources are in use
|
||||
@@ -1140,8 +1142,9 @@ public final class MediaDrm implements AutoCloseable {
|
||||
* implementation.
|
||||
*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({SECURITY_LEVEL_UNKNOWN, SW_SECURE_CRYPTO, SW_SECURE_DECODE,
|
||||
HW_SECURE_CRYPTO, HW_SECURE_DECODE, HW_SECURE_ALL})
|
||||
@IntDef({SECURITY_LEVEL_UNKNOWN, SECURITY_LEVEL_SW_SECURE_CRYPTO,
|
||||
SECURITY_LEVEL_SW_SECURE_DECODE, SECURITY_LEVEL_HW_SECURE_CRYPTO,
|
||||
SECURITY_LEVEL_HW_SECURE_DECODE, SECURITY_LEVEL_HW_SECURE_ALL})
|
||||
public @interface SecurityLevel {}
|
||||
|
||||
/**
|
||||
@@ -1153,31 +1156,31 @@ public final class MediaDrm implements AutoCloseable {
|
||||
/**
|
||||
* DRM key management uses software-based whitebox crypto.
|
||||
*/
|
||||
public static final int SW_SECURE_CRYPTO = 1;
|
||||
public static final int SECURITY_LEVEL_SW_SECURE_CRYPTO = 1;
|
||||
|
||||
/**
|
||||
* DRM key management and decoding use software-based whitebox crypto.
|
||||
*/
|
||||
public static final int SW_SECURE_DECODE = 2;
|
||||
public static final int SECURITY_LEVEL_SW_SECURE_DECODE = 2;
|
||||
|
||||
/**
|
||||
* DRM key management and crypto operations are performed within a hardware
|
||||
* backed trusted execution environment.
|
||||
*/
|
||||
public static final int HW_SECURE_CRYPTO = 3;
|
||||
public static final int SECURITY_LEVEL_HW_SECURE_CRYPTO = 3;
|
||||
|
||||
/**
|
||||
* DRM key management, crypto operations and decoding of content are
|
||||
* performed within a hardware backed trusted execution environment.
|
||||
*/
|
||||
public static final int HW_SECURE_DECODE = 4;
|
||||
public static final int SECURITY_LEVEL_HW_SECURE_DECODE = 4;
|
||||
|
||||
/**
|
||||
* DRM key management, crypto operations, decoding of content and all
|
||||
* handling of the media (compressed and uncompressed) is handled within a
|
||||
* hardware backed trusted execution environment.
|
||||
*/
|
||||
public static final int HW_SECURE_ALL = 5;
|
||||
public static final int SECURITY_LEVEL_HW_SECURE_ALL = 5;
|
||||
|
||||
/**
|
||||
* The maximum security level supported by the device. This is the default
|
||||
@@ -1203,9 +1206,9 @@ public final class MediaDrm implements AutoCloseable {
|
||||
* @param sessionId the session to query.
|
||||
* <p>
|
||||
* @return one of {@link #SECURITY_LEVEL_UNKNOWN},
|
||||
* {@link #SW_SECURE_CRYPTO}, {@link #SW_SECURE_DECODE},
|
||||
* {@link #HW_SECURE_CRYPTO}, {@link #HW_SECURE_DECODE} or
|
||||
* {@link #HW_SECURE_ALL}.
|
||||
* {@link #SECURITY_LEVEL_SW_SECURE_CRYPTO}, {@link #SECURITY_LEVEL_SW_SECURE_DECODE},
|
||||
* {@link #SECURITY_LEVEL_HW_SECURE_CRYPTO}, {@link #SECURITY_LEVEL_HW_SECURE_DECODE} or
|
||||
* {@link #SECURITY_LEVEL_HW_SECURE_ALL}.
|
||||
*/
|
||||
@SecurityLevel
|
||||
public native int getSecurityLevel(@NonNull byte[] sessionId);
|
||||
|
||||
@@ -729,15 +729,15 @@ static void android_media_MediaDrm_native_init(JNIEnv *env) {
|
||||
|
||||
GET_STATIC_FIELD_ID(field, clazz, "SECURITY_LEVEL_UNKNOWN", "I");
|
||||
gSecurityLevels.kSecurityLevelUnknown = env->GetStaticIntField(clazz, field);
|
||||
GET_STATIC_FIELD_ID(field, clazz, "SW_SECURE_CRYPTO", "I");
|
||||
GET_STATIC_FIELD_ID(field, clazz, "SECURITY_LEVEL_SW_SECURE_CRYPTO", "I");
|
||||
gSecurityLevels.kSecurityLevelSwSecureCrypto = env->GetStaticIntField(clazz, field);
|
||||
GET_STATIC_FIELD_ID(field, clazz, "SW_SECURE_DECODE", "I");
|
||||
GET_STATIC_FIELD_ID(field, clazz, "SECURITY_LEVEL_SW_SECURE_DECODE", "I");
|
||||
gSecurityLevels.kSecurityLevelSwSecureDecode = env->GetStaticIntField(clazz, field);
|
||||
GET_STATIC_FIELD_ID(field, clazz, "HW_SECURE_CRYPTO", "I");
|
||||
GET_STATIC_FIELD_ID(field, clazz, "SECURITY_LEVEL_HW_SECURE_CRYPTO", "I");
|
||||
gSecurityLevels.kSecurityLevelHwSecureCrypto = env->GetStaticIntField(clazz, field);
|
||||
GET_STATIC_FIELD_ID(field, clazz, "HW_SECURE_DECODE", "I");
|
||||
GET_STATIC_FIELD_ID(field, clazz, "SECURITY_LEVEL_HW_SECURE_DECODE", "I");
|
||||
gSecurityLevels.kSecurityLevelHwSecureDecode = env->GetStaticIntField(clazz, field);
|
||||
GET_STATIC_FIELD_ID(field, clazz, "HW_SECURE_ALL", "I");
|
||||
GET_STATIC_FIELD_ID(field, clazz, "SECURITY_LEVEL_HW_SECURE_ALL", "I");
|
||||
gSecurityLevels.kSecurityLevelHwSecureAll = env->GetStaticIntField(clazz, field);
|
||||
|
||||
jmethodID getMaxSecurityLevel;
|
||||
|
||||
Reference in New Issue
Block a user