OSDN Git Service

Grant read URI permission for playback of video capture
authorAlan Newberger <alann@google.com>
Tue, 10 Mar 2015 18:14:32 +0000 (11:14 -0700)
committerAlan Newberger <alann@google.com>
Tue, 10 Mar 2015 18:14:32 +0000 (11:14 -0700)
Current implementation of video capture UI configured MediaRecorder to
output directly into supplied URI, which per recommendation should be
a content: URI. We pass this URI to another app to play back the video,
and should pass along the read permission.

Bug: 19675889
Change-Id: I37f8ae3702a9f1ed9dbaac9416104c0c0bfb6dd0

src/com/android/camera/VideoModule.java

index d00af6d..742ce25 100644 (file)
@@ -602,6 +602,7 @@ public class VideoModule extends CameraModule
 
     private void startPlayVideoActivity() {
         Intent intent = new Intent(Intent.ACTION_VIEW);
+        intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
         intent.setDataAndType(mCurrentVideoUri, convertOutputFormatToMimeType(mProfile.fileFormat));
         try {
             mActivity.launchActivityByIntent(intent);