Loading core/res/AndroidManifest.xml +7 −1 Original line number Diff line number Diff line Loading @@ -2812,7 +2812,13 @@ @hide This is not a third-party API (intended for system apps). --> <permission android:name="android.permission.READ_INSTALL_SESSIONS" android:label="@string/permlab_readInstallSessions" android:description="@string/permdesc_readInstallSessions" android:description="@string/permdesc_readInstallSessions" /> <!-- @SystemApi Allows an application to remove DRM certificates @hide This is not a third-party API (intended for system apps). --> <permission android:name="android.permission.REMOVE_DRM_CERTIFICATES" android:label="@string/permlab_removeDrmCertificates" android:description="@string/permdesc_removeDrmCertificates" android:protectionLevel="signature|system" /> <!-- The system process is explicitly the only one allowed to launch the Loading core/res/res/values/strings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2167,6 +2167,11 @@ <string name="permlab_handoverStatus">Receive Android Beam transfer status</string> <string name="permdesc_handoverStatus">Allows this application to receive information about current Android Beam transfers</string> <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <string name="permlab_removeDrmCertificates">remove DRM certificates</string> <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <string name="permdesc_removeDrmCertificates">Allows an application to remove DRM certficates. Should never be needed for normal apps.</string> <!-- Policy administration --> <!-- Title of policy access to limiting the user's password choices --> Loading media/java/android/media/MediaDrm.java +13 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import java.lang.ref.WeakReference; import java.util.UUID; import java.util.HashMap; import java.util.List; import android.annotation.SystemApi; import android.os.Binder; import android.os.Debug; import android.os.Handler; Loading Loading @@ -520,6 +521,18 @@ public final class MediaDrm { private native Certificate provideProvisionResponseNative(byte[] response) throws DeniedByServerException; /** * Remove provisioning from a device. Only system apps may unprovision a * device. Note that removing provisioning will invalidate any keys saved * for offline use (KEY_TYPE_OFFLINE), which may render downloaded content * unplayable until new licenses are acquired. Since provisioning is global * to the device, license invalidation will apply to all content downloaded * by any app, so appropriate warnings should be given to the user. * @hide */ @SystemApi public native void unprovisionDevice(); /** * A means of enforcing limits on the number of concurrent streams per subscriber * across devices is provided via SecureStop. This is achieved by securely Loading media/jni/android_media_MediaDrm.cpp +19 −1 Original line number Diff line number Diff line Loading @@ -966,6 +966,22 @@ static jobject android_media_MediaDrm_provideProvisionResponseNative( return certificateObj; } static void android_media_MediaDrm_unprovisionDeviceNative( JNIEnv *env, jobject thiz) { sp<IDrm> drm = GetDrm(env, thiz); if (drm == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "MediaDrm obj is null"); return; } status_t err = drm->unprovisionDevice(); throwExceptionAsNecessary(env, err, "Failed to handle provision response"); return; } static jobject android_media_MediaDrm_getSecureStops( JNIEnv *env, jobject thiz) { sp<IDrm> drm = GetDrm(env, thiz); Loading Loading @@ -1362,6 +1378,9 @@ static JNINativeMethod gMethods[] = { { "provideProvisionResponseNative", "([B)Landroid/media/MediaDrm$Certificate;", (void *)android_media_MediaDrm_provideProvisionResponseNative }, { "unprovisionDevice", "()V", (void *)android_media_MediaDrm_unprovisionDeviceNative }, { "getSecureStops", "()Ljava/util/List;", (void *)android_media_MediaDrm_getSecureStops }, Loading Loading @@ -1408,4 +1427,3 @@ int register_android_media_Drm(JNIEnv *env) { return AndroidRuntime::registerNativeMethods(env, "android/media/MediaDrm", gMethods, NELEM(gMethods)); } Loading
core/res/AndroidManifest.xml +7 −1 Original line number Diff line number Diff line Loading @@ -2812,7 +2812,13 @@ @hide This is not a third-party API (intended for system apps). --> <permission android:name="android.permission.READ_INSTALL_SESSIONS" android:label="@string/permlab_readInstallSessions" android:description="@string/permdesc_readInstallSessions" android:description="@string/permdesc_readInstallSessions" /> <!-- @SystemApi Allows an application to remove DRM certificates @hide This is not a third-party API (intended for system apps). --> <permission android:name="android.permission.REMOVE_DRM_CERTIFICATES" android:label="@string/permlab_removeDrmCertificates" android:description="@string/permdesc_removeDrmCertificates" android:protectionLevel="signature|system" /> <!-- The system process is explicitly the only one allowed to launch the Loading
core/res/res/values/strings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2167,6 +2167,11 @@ <string name="permlab_handoverStatus">Receive Android Beam transfer status</string> <string name="permdesc_handoverStatus">Allows this application to receive information about current Android Beam transfers</string> <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <string name="permlab_removeDrmCertificates">remove DRM certificates</string> <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <string name="permdesc_removeDrmCertificates">Allows an application to remove DRM certficates. Should never be needed for normal apps.</string> <!-- Policy administration --> <!-- Title of policy access to limiting the user's password choices --> Loading
media/java/android/media/MediaDrm.java +13 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import java.lang.ref.WeakReference; import java.util.UUID; import java.util.HashMap; import java.util.List; import android.annotation.SystemApi; import android.os.Binder; import android.os.Debug; import android.os.Handler; Loading Loading @@ -520,6 +521,18 @@ public final class MediaDrm { private native Certificate provideProvisionResponseNative(byte[] response) throws DeniedByServerException; /** * Remove provisioning from a device. Only system apps may unprovision a * device. Note that removing provisioning will invalidate any keys saved * for offline use (KEY_TYPE_OFFLINE), which may render downloaded content * unplayable until new licenses are acquired. Since provisioning is global * to the device, license invalidation will apply to all content downloaded * by any app, so appropriate warnings should be given to the user. * @hide */ @SystemApi public native void unprovisionDevice(); /** * A means of enforcing limits on the number of concurrent streams per subscriber * across devices is provided via SecureStop. This is achieved by securely Loading
media/jni/android_media_MediaDrm.cpp +19 −1 Original line number Diff line number Diff line Loading @@ -966,6 +966,22 @@ static jobject android_media_MediaDrm_provideProvisionResponseNative( return certificateObj; } static void android_media_MediaDrm_unprovisionDeviceNative( JNIEnv *env, jobject thiz) { sp<IDrm> drm = GetDrm(env, thiz); if (drm == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "MediaDrm obj is null"); return; } status_t err = drm->unprovisionDevice(); throwExceptionAsNecessary(env, err, "Failed to handle provision response"); return; } static jobject android_media_MediaDrm_getSecureStops( JNIEnv *env, jobject thiz) { sp<IDrm> drm = GetDrm(env, thiz); Loading Loading @@ -1362,6 +1378,9 @@ static JNINativeMethod gMethods[] = { { "provideProvisionResponseNative", "([B)Landroid/media/MediaDrm$Certificate;", (void *)android_media_MediaDrm_provideProvisionResponseNative }, { "unprovisionDevice", "()V", (void *)android_media_MediaDrm_unprovisionDeviceNative }, { "getSecureStops", "()Ljava/util/List;", (void *)android_media_MediaDrm_getSecureStops }, Loading Loading @@ -1408,4 +1427,3 @@ int register_android_media_Drm(JNIEnv *env) { return AndroidRuntime::registerNativeMethods(env, "android/media/MediaDrm", gMethods, NELEM(gMethods)); }