summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChih-Chung Chang <>2009-03-25 01:51:03 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-25 01:51:03 -0700
commit47bf4ced40df23a26db78fe5aec5dfce98ed797e (patch)
tree0806ceb16575c4de0db1ca11d624a14cc682a266 /src
parent095afa19556bf550262e3cccb9edacc04e6f726a (diff)
downloadLegacyCamera-47bf4ced40df23a26db78fe5aec5dfce98ed797e.zip
LegacyCamera-47bf4ced40df23a26db78fe5aec5dfce98ed797e.tar.gz
LegacyCamera-47bf4ced40df23a26db78fe5aec5dfce98ed797e.tar.bz2
Automated import from //branches/donutburger/...@142525,142525
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/MenuHelper.java10
-rw-r--r--src/com/android/camera/VideoCamera.java1
-rw-r--r--src/com/android/camera/ViewImage.java1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java
index 9fae480..17d3edb 100644
--- a/src/com/android/camera/MenuHelper.java
+++ b/src/com/android/camera/MenuHelper.java
@@ -124,6 +124,15 @@ public class MenuHelper {
}
}
+ // This is a hack before we find a solution to pass a permission to other
+ // applications. See bug #1735149.
+ // Checks if the URI starts with "content://mms".
+ public static boolean isMMSUri(Uri uri) {
+ return (uri != null) &&
+ uri.getScheme().equals("content") &&
+ uri.getAuthority().equals("mms");
+ }
+
static MenuItemsResult addImageMenuItems(
Menu menu,
int inclusions,
@@ -229,6 +238,7 @@ public class MenuHelper {
onInvoke.run(new MenuCallback() {
public void run(Uri u, ImageManager.IImage image) {
if (image == null) return;
+ if (isMMSUri(u)) return;
if (!isImage && getImageFileSize(image) > SHARE_FILE_LENGTH_LIMIT ) {
Toast.makeText(activity,
R.string.too_large_to_attach, Toast.LENGTH_LONG).show();
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 186d827..c8d5f7d 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -295,6 +295,7 @@ public class VideoCamera extends Activity implements View.OnClickListener,
}
private void startShareVideoActivity() {
+ if (MenuHelper.isMMSUri(mCurrentVideoUri)) return;
if (mCurrentVideoFileLength > SHARE_FILE_LENGTH_LIMIT) {
Toast.makeText(VideoCamera.this,
R.string.too_large_to_attach, Toast.LENGTH_LONG).show();
diff --git a/src/com/android/camera/ViewImage.java b/src/com/android/camera/ViewImage.java
index ad2ce77..c7de24e 100644
--- a/src/com/android/camera/ViewImage.java
+++ b/src/com/android/camera/ViewImage.java
@@ -1493,6 +1493,7 @@ public class ViewImage extends Activity implements View.OnClickListener
case R.id.share: {
Uri u = mAllImages.getImageAt(mCurrentPosition).fullSizeImageUri();
+ if (MenuHelper.isMMSUri(u)) return;
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setType("image/jpeg");