diff options
author | Ben Murdoch <benm@google.com> | 2014-09-22 15:13:22 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-22 15:13:22 +0000 |
commit | b97f51f504e21a92a767dfe4a6ca21ad196006fc (patch) | |
tree | eaaee379e22345ec7204448a865df384c35cf5a3 | |
parent | 257d565a9d374fd3a22d4732004f77ee1459083b (diff) | |
parent | 253bd01f659ed14aeb2352a0296ba9bf58a0b37e (diff) | |
download | packages_apps_Browser-b97f51f504e21a92a767dfe4a6ca21ad196006fc.zip packages_apps_Browser-b97f51f504e21a92a767dfe4a6ca21ad196006fc.tar.gz packages_apps_Browser-b97f51f504e21a92a767dfe4a6ca21ad196006fc.tar.bz2 |
am 253bd01f: am a1f40f93: Pass ClipData in media capture Intent.
* commit '253bd01f659ed14aeb2352a0296ba9bf58a0b37e':
Pass ClipData in media capture Intent.
-rw-r--r-- | src/com/android/browser/UploadHandler.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/browser/UploadHandler.java b/src/com/android/browser/UploadHandler.java index ab4aff6..87c7897 100644 --- a/src/com/android/browser/UploadHandler.java +++ b/src/com/android/browser/UploadHandler.java @@ -18,6 +18,7 @@ package com.android.browser; import android.app.Activity; import android.content.ActivityNotFoundException; +import android.content.ClipData; import android.content.Intent; import android.net.Uri; import android.provider.MediaStore; @@ -36,6 +37,8 @@ public class UploadHandler { private final static String VIDEO_MIME_TYPE = "video/*"; private final static String AUDIO_MIME_TYPE = "audio/*"; + private final static String FILE_PROVIDER_AUTHORITY = "com.android.browser-classic.file"; + /* * The Object used to inform the WebView of the file to upload. */ @@ -158,7 +161,7 @@ public class UploadHandler { File mediaFile = File.createTempFile( String.valueOf(System.currentTimeMillis()), suffix, mediaPath); return FileProvider.getUriForFile(mController.getActivity(), - "com.android.browser-classic.file", mediaFile); + FILE_PROVIDER_AUTHORITY, mediaFile); } catch (java.io.IOException e) { throw new RuntimeException(e); } @@ -171,6 +174,8 @@ public class UploadHandler { intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); intent.putExtra(MediaStore.EXTRA_OUTPUT, mCapturedMedia); + intent.setClipData(ClipData.newUri(mController.getActivity().getContentResolver(), + FILE_PROVIDER_AUTHORITY, mCapturedMedia)); return intent; } |