OSDN Git Service

Handle 360 panorama specific MIME type.
authorMangesh Ghiware <mghiware@google.com>
Wed, 10 Oct 2012 22:56:29 +0000 (15:56 -0700)
committerMangesh Ghiware <mghiware@google.com>
Fri, 26 Oct 2012 00:29:41 +0000 (17:29 -0700)
Bug: 7407448

Change-Id: I939a061e2100c2cdc17279982de98f1d446d8aef

src/com/android/gallery3d/app/Gallery.java

index 6ca4bab..78fedd8 100644 (file)
@@ -118,7 +118,10 @@ public final class Gallery extends AbstractGalleryActivity implements OnCancelLi
 
     private String getContentType(Intent intent) {
         String type = intent.getType();
-        if (type != null) return type;
+        if (type != null) {
+            return GalleryUtils.MIME_TYPE_PANORAMA360.equals(type)
+                ? MediaItem.MIME_TYPE_JPEG : type;
+        }
 
         Uri uri = intent.getData();
         try {
@@ -192,7 +195,7 @@ public final class Gallery extends AbstractGalleryActivity implements OnCancelLi
                     startDefaultPage();
                 }
             } else {
-                Path itemPath = dm.findPathByUri(uri, intent.getType());
+                Path itemPath = dm.findPathByUri(uri, contentType);
                 Path albumPath = dm.getDefaultSetOf(itemPath);
 
                 data.putString(PhotoPage.KEY_MEDIA_ITEM_PATH, itemPath.toString());