Allow viewing content:// Uris from Downloads.
Tomasz Mikolajewski [Mon, 9 May 2016 03:30:30 +0000 (12:30 +0900)]
Bug: 28476442
Change-Id: I12a35a2c35c16ddf899637dfb85c30006c169fd7

src/com/android/providers/downloads/OpenHelper.java

index 7a74c88..27ab86b 100644 (file)
@@ -97,13 +97,10 @@ public class OpenHelper {
                 intent.putExtra(Intent.EXTRA_ORIGINATING_URI, remoteUri);
                 intent.putExtra(Intent.EXTRA_REFERRER, getRefererUri(context, id));
                 intent.putExtra(Intent.EXTRA_ORIGINATING_UID, getOriginatingUid(context, id));
-            } else if ("file".equals(localUri.getScheme())) {
+            } else {
                 intent.setDataAndType(documentUri, mimeType);
                 intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION
                         | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
-            } else {
-                throw new UnsupportedOperationException(
-                        "Unsupported scheme: " + localUri.getScheme());
             }
 
             return intent;