packages/apps/Gallery2
修订版 | cd09872e859075aa8b5b90a151b0cae901bf4810 (tree) |
---|---|
时间 | 2011-08-25 10:31:38 |
作者 | Ray Chen <raychen@goog...> |
Commiter | Ray Chen |
Fix 5027908 Crash in MMS while attaching a picture from Picasa
Change-Id: I7f67a7da5191f0ec8fbe3fc3c2d79e54394c4715
@@ -46,6 +46,17 @@ import java.io.OutputStream; | ||
46 | 46 | public class GalleryProvider extends ContentProvider { |
47 | 47 | private static final String TAG = "GalleryProvider"; |
48 | 48 | |
49 | + public static final String AUTHORITY = "com.android.gallery3d.provider"; | |
50 | + public static final Uri BASE_URI = Uri.parse("content://" + AUTHORITY); | |
51 | + private static final String[] SUPPORTED_PICASA_COLUMNS = { | |
52 | + ImageColumns.DISPLAY_NAME, | |
53 | + ImageColumns.SIZE, | |
54 | + ImageColumns.MIME_TYPE, | |
55 | + ImageColumns.DATE_TAKEN, | |
56 | + ImageColumns.LATITUDE, | |
57 | + ImageColumns.LONGITUDE, | |
58 | + ImageColumns.ORIENTATION}; | |
59 | + | |
49 | 60 | private DataManager mDataManager; |
50 | 61 | private DownloadCache mDownloadCache; |
51 | 62 | private static Uri sBaseUri; |
@@ -151,6 +162,7 @@ public class GalleryProvider extends ContentProvider { | ||
151 | 162 | |
152 | 163 | private Cursor queryPicasaItem(MediaObject image, String[] projection, |
153 | 164 | String selection, String[] selectionArgs, String sortOrder) { |
165 | + if (projection == null) projection = SUPPORTED_PICASA_COLUMNS; | |
154 | 166 | Object[] columnValues = new Object[projection.length]; |
155 | 167 | double latitude = PicasaSource.getLatitude(image); |
156 | 168 | double longitude = PicasaSource.getLongitude(image); |