diff options
author | Santosh Madhava <smadhava@google.com> | 2011-03-04 18:37:51 -0800 |
---|---|---|
committer | Santosh Madhava <smadhava@google.com> | 2011-03-04 18:37:51 -0800 |
commit | 895a28e14e6c88b4ff3b1f1cdf02d22f7b3b52ca (patch) | |
tree | a8bcc334f58fedb673efd660736fb14fb41ae29e /media | |
parent | 4d3e7fb7ab00c190aa7ce4f8a4d5174909067ccc (diff) | |
download | frameworks_base-895a28e14e6c88b4ff3b1f1cdf02d22f7b3b52ca.zip frameworks_base-895a28e14e6c88b4ff3b1f1cdf02d22f7b3b52ca.tar.gz frameworks_base-895a28e14e6c88b4ff3b1f1cdf02d22f7b3b52ca.tar.bz2 |
Fix for issue 3453519: (Java/JNI) do not allow editing of DRM protected contents
Change-Id: I376483c42b5bed8d2a1765804c2261c18d720a0c
Diffstat (limited to 'media')
4 files changed, 14 insertions, 6 deletions
diff --git a/media/java/android/media/videoeditor/AudioTrack.java b/media/java/android/media/videoeditor/AudioTrack.java index b2f547b..7069b23 100755 --- a/media/java/android/media/videoeditor/AudioTrack.java +++ b/media/java/android/media/videoeditor/AudioTrack.java @@ -140,7 +140,7 @@ public class AudioTrack { try { properties = mMANativeHelper.getMediaProperties(filename); } catch (Exception e) { - throw new IllegalArgumentException("Unsupported file or file not found"); + throw new IllegalArgumentException(e.getMessage() + " : " + filename); } switch (mMANativeHelper.getFileType(properties.fileType)) { case MediaProperties.FILE_3GP: diff --git a/media/java/android/media/videoeditor/MediaVideoItem.java b/media/java/android/media/videoeditor/MediaVideoItem.java index c91d796..4758de6 100755 --- a/media/java/android/media/videoeditor/MediaVideoItem.java +++ b/media/java/android/media/videoeditor/MediaVideoItem.java @@ -115,7 +115,7 @@ public class MediaVideoItem extends MediaItem { try { properties = mMANativeHelper.getMediaProperties(filename); } catch ( Exception e) { - throw new IllegalArgumentException("Unsupported file or file not found: " + filename); + throw new IllegalArgumentException(e.getMessage() + " : " + filename); } switch (mMANativeHelper.getFileType(properties.fileType)) { diff --git a/media/jni/mediaeditor/VideoEditorOsal.cpp b/media/jni/mediaeditor/VideoEditorOsal.cpp index 423e93f..035f59a 100755 --- a/media/jni/mediaeditor/VideoEditorOsal.cpp +++ b/media/jni/mediaeditor/VideoEditorOsal.cpp @@ -207,6 +207,7 @@ static const VideoEdit_Osal_Result gkRESULTS[] = VIDEOEDIT_OSAL_RESULT_INIT(M4MCS_ERR_AUDIOBITRATE_TOO_HIGH ), VIDEOEDIT_OSAL_RESULT_INIT(M4MCS_ERR_OUTPUT_FILE_SIZE_TOO_SMALL ), VIDEOEDIT_OSAL_RESULT_INIT(M4MCS_ERR_NOMORE_SPACE ), + VIDEOEDIT_OSAL_RESULT_INIT(M4MCS_ERR_FILE_DRM_PROTECTED ), // M4READER_Common.h VIDEOEDIT_OSAL_RESULT_INIT(M4ERR_READER_UNKNOWN_STREAM_TYPE ), diff --git a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp index 73a7c9c..3b795ce 100755 --- a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp +++ b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp @@ -204,10 +204,17 @@ jobject videoEditProp_getProperties( result = getClipProperties( pEnv, thiz, pFile, clipType, pClipProperties); - // Check if the creation succeeded. - videoEditJava_checkAndThrowIllegalArgumentException( - &gotten, pEnv,(M4NO_ERROR != result), - "Invalid File or File not found"); + if (M4MCS_ERR_FILE_DRM_PROTECTED == result) { + // Check if the creation succeeded. + videoEditJava_checkAndThrowIllegalArgumentException( + &gotten, pEnv,(M4NO_ERROR != result), + "Invalid File - DRM Protected "); + } else { + // Check if the creation succeeded. + videoEditJava_checkAndThrowIllegalArgumentException( + &gotten, pEnv,(M4NO_ERROR != result), + "Invalid File or File not found "); + } /** * Max resolution supported is 1280 x 720. |