summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2012-10-16 23:34:06 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-16 23:34:07 -0700
commitf52c1e102bb6510399509e0df335fcc13a98b9ae (patch)
tree5d6393191b3b1f66d5a28c5a4b61ae9c9553073c /src
parent85ff828f443f176c3ae3d6677cd6433e8abf59e5 (diff)
parentf36e53f7c59380670327a600b2766b3b42edbc2c (diff)
downloadandroid_packages_apps_Snap-f52c1e102bb6510399509e0df335fcc13a98b9ae.tar.gz
android_packages_apps_Snap-f52c1e102bb6510399509e0df335fcc13a98b9ae.tar.bz2
android_packages_apps_Snap-f52c1e102bb6510399509e0df335fcc13a98b9ae.zip
Merge "Add permission to GalleryProvider." into gb-ub-photos-arches
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java18
-rw-r--r--src/com/android/gallery3d/ui/ActionModeHandler.java2
2 files changed, 10 insertions, 10 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index ba9bf8c42..413167fbb 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -592,11 +592,10 @@ public class PhotoPage extends ActivityState implements
private Intent createShareIntent(Path path) {
DataManager manager = mActivity.getDataManager();
int type = manager.getMediaType(path);
- Intent intent = new Intent(Intent.ACTION_SEND);
- intent.setType(MenuExecutor.getMimeType(type));
- Uri uri = manager.getContentUri(path);
- intent.putExtra(Intent.EXTRA_STREAM, uri);
- return intent;
+ return new Intent(Intent.ACTION_SEND)
+ .setType(MenuExecutor.getMimeType(type))
+ .putExtra(Intent.EXTRA_STREAM, manager.getContentUri(path))
+ .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
}
private Intent createSharePanoramaIntent(Path path) {
@@ -605,11 +604,10 @@ public class PhotoPage extends ActivityState implements
if ((supported & MediaObject.SUPPORT_PANORAMA360) == 0) {
return null;
}
- Intent intent = new Intent(Intent.ACTION_SEND);
- intent.setType(GalleryUtils.MIME_TYPE_PANORAMA360);
- Uri uri = manager.getContentUri(path);
- intent.putExtra(Intent.EXTRA_STREAM, uri);
- return intent;
+ return new Intent(Intent.ACTION_SEND)
+ .setType(GalleryUtils.MIME_TYPE_PANORAMA360)
+ .putExtra(Intent.EXTRA_STREAM, manager.getContentUri(path))
+ .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
}
private void launchPhotoEditor() {
diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java
index 8cebdddad..3384b88e3 100644
--- a/src/com/android/gallery3d/ui/ActionModeHandler.java
+++ b/src/com/android/gallery3d/ui/ActionModeHandler.java
@@ -280,6 +280,7 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi
intent.setType(GalleryUtils.MIME_TYPE_PANORAMA360);
intent.putExtra(Intent.EXTRA_STREAM, uris.get(0));
}
+ intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
}
return intent;
@@ -315,6 +316,7 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi
intent.setAction(Intent.ACTION_SEND).setType(mimeType);
intent.putExtra(Intent.EXTRA_STREAM, uris.get(0));
}
+ intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
setNfcBeamPushUris(uris.toArray(new Uri[uris.size()]));
} else {
setNfcBeamPushUris(null);