Bring back DRM mimetypes.
Jeff Sharkey [Fri, 19 Oct 2012 21:42:24 +0000 (14:42 -0700)]
I don't like DRM, but other people do.

Bug: 7370549
Change-Id: I44220404eab6e6cc85ea16cfcf58474135c03f83

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

index 356375b..7eca95c 100644 (file)
@@ -16,6 +16,7 @@
 
 package com.android.providers.downloads;
 
+import static android.app.DownloadManager.COLUMN_LOCAL_FILENAME;
 import static android.app.DownloadManager.COLUMN_LOCAL_URI;
 import static android.app.DownloadManager.COLUMN_MEDIA_TYPE;
 import static android.app.DownloadManager.COLUMN_URI;
@@ -46,7 +47,9 @@ public class OpenHelper {
             }
 
             final Uri localUri = getCursorUri(cursor, COLUMN_LOCAL_URI);
-            final String mimeType = getCursorString(cursor, COLUMN_MEDIA_TYPE);
+            final String filename = getCursorString(cursor, COLUMN_LOCAL_FILENAME);
+            String mimeType = getCursorString(cursor, COLUMN_MEDIA_TYPE);
+            mimeType = DownloadDrmHelper.getOriginalMimeType(context, filename, mimeType);
 
             final Intent intent = new Intent(Intent.ACTION_VIEW);
             intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);