summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-05-15 16:56:59 -0700
committerOwen Lin <owenlin@google.com>2012-05-16 10:04:50 -0700
commitded2316db6f1b2ebd23b68577c8a4a11282118de (patch)
tree8182adaaeab513da4feb06a1f36820269a65765b /src
parent4fa3d5bb57d166d915225b60e9f659e9c91fb9b3 (diff)
downloadandroid_packages_apps_Snap-ded2316db6f1b2ebd23b68577c8a4a11282118de.tar.gz
android_packages_apps_Snap-ded2316db6f1b2ebd23b68577c8a4a11282118de.tar.bz2
android_packages_apps_Snap-ded2316db6f1b2ebd23b68577c8a4a11282118de.zip
Hide the share button if the shared URI is not "content:".
bug:6494818 Change-Id: I70a2997c07c19433cadee34fa348d27445bf2647
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 95e345121..629894abb 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -19,6 +19,7 @@ package com.android.gallery3d.app;
import android.app.ActionBar;
import android.app.Activity;
import android.content.AsyncQueryHandler;
+import android.content.ContentResolver;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.database.Cursor;
@@ -142,7 +143,10 @@ public class MovieActivity extends Activity {
getMenuInflater().inflate(R.menu.movie, menu);
ShareActionProvider provider = GalleryActionBar.initializeShareActionProvider(menu);
- if (provider != null) {
+ // Document says EXTRA_STREAM should be a content: Uri
+ // So, we only share the video if it's "content:".
+ if (provider != null && ContentResolver.SCHEME_CONTENT
+ .equals(mUri.getScheme())) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("video/*");
intent.putExtra(Intent.EXTRA_STREAM, mUri);