diff options
author | Santosh Madhava <smadhava@google.com> | 2011-03-07 19:47:26 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-07 19:47:26 -0800 |
commit | 165c77b9e4b0e3e204cf529b1fcbfbbe25f0d9b1 (patch) | |
tree | f3af87965f85418014fe6f025f929e02ebcc045f | |
parent | c87b1101a91b8fba5c11df39dc44233d137c8e99 (diff) | |
parent | 5893b453fc762d18e759a391a442600be4924489 (diff) | |
download | frameworks_base-165c77b9e4b0e3e204cf529b1fcbfbbe25f0d9b1.zip frameworks_base-165c77b9e4b0e3e204cf529b1fcbfbbe25f0d9b1.tar.gz frameworks_base-165c77b9e4b0e3e204cf529b1fcbfbbe25f0d9b1.tar.bz2 |
am 5893b453: am 0e8dc72d: Merge "Fix for issue 3453519: (Java/JNI) do not allow editing of DRM protected contents" into honeycomb-mr1
* commit '5893b453fc762d18e759a391a442600be4924489':
Fix for issue 3453519: (Java/JNI) do not allow editing of DRM protected contents
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. |