summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/data/UriImage.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/data/UriImage.java')
-rw-r--r--src/com/android/gallery3d/data/UriImage.java16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/com/android/gallery3d/data/UriImage.java b/src/com/android/gallery3d/data/UriImage.java
index 05850bbb3..b5bfe964b 100644
--- a/src/com/android/gallery3d/data/UriImage.java
+++ b/src/com/android/gallery3d/data/UriImage.java
@@ -23,7 +23,6 @@ import android.graphics.BitmapFactory.Options;
import android.graphics.BitmapRegionDecoder;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
-import android.webkit.MimeTypeMap;
import com.android.gallery3d.app.GalleryApp;
import com.android.gallery3d.common.BitmapUtils;
@@ -58,22 +57,11 @@ public class UriImage extends MediaItem {
private GalleryApp mApplication;
- public UriImage(GalleryApp application, Path path, Uri uri) {
+ public UriImage(GalleryApp application, Path path, Uri uri, String contentType) {
super(path, nextVersionNumber());
mUri = uri;
mApplication = Utils.checkNotNull(application);
- mContentType = getMimeType(uri);
- }
-
- private String getMimeType(Uri uri) {
- if (ContentResolver.SCHEME_FILE.equals(uri.getScheme())) {
- String extension =
- MimeTypeMap.getFileExtensionFromUrl(uri.toString());
- String type = MimeTypeMap.getSingleton()
- .getMimeTypeFromExtension(extension.toLowerCase());
- if (type != null) return type;
- }
- return mApplication.getContentResolver().getType(uri);
+ mContentType = contentType;
}
@Override