Index: ui/android/java/src/org/chromium/ui/SelectFileDialog.java |
diff --git a/ui/android/java/src/org/chromium/ui/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/SelectFileDialog.java |
index 91533b52cf0f1a9a8a3b4bac233cd60cbbf86966..f05d188392256bd8a9d9551f9f827e4675c1f645 100644 |
--- a/ui/android/java/src/org/chromium/ui/SelectFileDialog.java |
+++ b/ui/android/java/src/org/chromium/ui/SelectFileDialog.java |
@@ -160,21 +160,10 @@ class SelectFileDialog implements WindowAndroid.IntentCallback{ |
// We get back a content:// URI from the system if the user picked a file from the |
// gallery. The ContentView has functionality that will convert that content:// URI to |
// a file path on disk that Chromium understands. |
- Cursor c = contentResolver.query(results.getData(), |
- new String[] { MediaStore.MediaColumns.DATA }, null, null, null); |
- if (c != null) { |
- if (c.getCount() == 1) { |
- c.moveToFirst(); |
- String path = c.getString(0); |
- if (path != null) { |
- // Not all providers support the MediaStore.DATA column. For example, |
- // Gallery3D (com.android.gallery3d.provider) does not support it for |
- // Picasa Web Album images. |
- nativeOnFileSelected(mNativeSelectFileDialog, path); |
- success = true; |
- } |
- } |
- c.close(); |
+ if (results.getScheme() != null |
+ && results.getScheme().equals(ContentResolver.SCHEME_CONTENT)) { |
+ nativeOnFileSelected(mNativeSelectFileDialog, results.getData().toString()); |
+ success = true; |
} |
} |
if (!success) { |