Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8de43ee1 authored by Jeff Tinker's avatar Jeff Tinker
Browse files

Resolve feedback from API review

Fix inconsistent naming of offline license states

bug:120489407
bug:120488811
test:cts and gts media tests

Change-Id: I6cceac233cf8882c5bf7fbef7503764c611125d1
parent ed02ce4f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -24727,9 +24727,9 @@ package android.media {
    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
    field public static final int OFFLINE_LICENSE_INACTIVE = 2; // 0x2
    field public static final int OFFLINE_LICENSE_STATE_RELEASED = 2; // 0x2
    field public static final int OFFLINE_LICENSE_STATE_UNKNOWN = 0; // 0x0
    field public static final int OFFLINE_LICENSE_USABLE = 1; // 0x1
    field public static final int OFFLINE_LICENSE_STATE_USABLE = 1; // 0x1
    field public static final String PROPERTY_ALGORITHMS = "algorithms";
    field public static final String PROPERTY_DESCRIPTION = "description";
    field public static final String PROPERTY_DEVICE_UNIQUE_ID = "deviceUniqueId";
+8 −8
Original line number Diff line number Diff line
@@ -1186,22 +1186,22 @@ public final class MediaDrm implements AutoCloseable {
    public static final int OFFLINE_LICENSE_STATE_UNKNOWN = 0;

    /**
     * Offline license state is usable, the keys may be used for decryption.
     * Offline license is usable, the keys may be used for decryption.
     */
    public static final int OFFLINE_LICENSE_USABLE = 1;
    public static final int OFFLINE_LICENSE_STATE_USABLE = 1;

    /**
     * Offline license state is inactive, the keys have been marked for
     * release using {@link #getKeyRequest} with KEY_TYPE_RELEASE but the
     * key response has not been received.
     * Offline license is released, the keys have been marked for
     * release using {@link #getKeyRequest} with KEY_TYPE_RELEASE but
     * the key response has not been received.
     */
    public static final int OFFLINE_LICENSE_INACTIVE = 2;
    public static final int OFFLINE_LICENSE_STATE_RELEASED = 2;

    /** @hide */
    @IntDef({
        OFFLINE_LICENSE_STATE_UNKNOWN,
        OFFLINE_LICENSE_USABLE,
        OFFLINE_LICENSE_INACTIVE,
        OFFLINE_LICENSE_STATE_USABLE,
        OFFLINE_LICENSE_STATE_RELEASED,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface OfflineLicenseState {}
+6 −6
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ struct SecurityLevels {

struct OfflineLicenseState {
    jint kOfflineLicenseStateUsable;
    jint kOfflineLicenseStateInactive;
    jint kOfflineLicenseStateReleased;
    jint kOfflineLicenseStateUnknown;
} gOfflineLicenseStates;

@@ -797,10 +797,10 @@ static void android_media_MediaDrm_native_init(JNIEnv *env) {
    GET_STATIC_FIELD_ID(field, clazz, "SECURITY_LEVEL_HW_SECURE_ALL", "I");
    gSecurityLevels.kSecurityLevelHwSecureAll = env->GetStaticIntField(clazz, field);

    GET_STATIC_FIELD_ID(field, clazz, "OFFLINE_LICENSE_USABLE", "I");
    GET_STATIC_FIELD_ID(field, clazz, "OFFLINE_LICENSE_STATE_USABLE", "I");
    gOfflineLicenseStates.kOfflineLicenseStateUsable = env->GetStaticIntField(clazz, field);
    GET_STATIC_FIELD_ID(field, clazz, "OFFLINE_LICENSE_INACTIVE", "I");
    gOfflineLicenseStates.kOfflineLicenseStateInactive = env->GetStaticIntField(clazz, field);
    GET_STATIC_FIELD_ID(field, clazz, "OFFLINE_LICENSE_STATE_RELEASED", "I");
    gOfflineLicenseStates.kOfflineLicenseStateReleased = env->GetStaticIntField(clazz, field);
    GET_STATIC_FIELD_ID(field, clazz, "OFFLINE_LICENSE_STATE_UNKNOWN", "I");
    gOfflineLicenseStates.kOfflineLicenseStateUnknown = env->GetStaticIntField(clazz, field);

@@ -1581,8 +1581,8 @@ static jint android_media_MediaDrm_getOfflineLicenseState(JNIEnv *env,
    switch(state) {
    case DrmPlugin::kOfflineLicenseStateUsable:
        return gOfflineLicenseStates.kOfflineLicenseStateUsable;
    case DrmPlugin::kOfflineLicenseStateInactive:
        return gOfflineLicenseStates.kOfflineLicenseStateInactive;
    case DrmPlugin::kOfflineLicenseStateReleased:
        return gOfflineLicenseStates.kOfflineLicenseStateReleased;
    default:
        return gOfflineLicenseStates.kOfflineLicenseStateUnknown;
    }