To remove the old DRM support totally because we added the
Gloria Wang [Tue, 21 Jun 2011 23:18:13 +0000 (16:18 -0700)]
new Forward Lock support in Download Provider.

Change-Id: I71faf19527104455b666cba73a052cd0d4b7d70e

AndroidManifest.xml
ui/src/com/android/providers/downloads/ui/DownloadAdapter.java

index d41702d..fefece2 100644 (file)
 
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
     <uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER" />
-    <uses-permission android:name="android.permission.ACCESS_DRM" />
     <uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" />
     <uses-permission android:name="android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-    <uses-permission android:name="android.permission.INSTALL_DRM" />
     <uses-permission android:name="android.permission.ACCESS_ALL_DOWNLOADS" />
     <uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" />
 
index 33f9531..34664ff 100644 (file)
@@ -23,7 +23,6 @@ import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
 import android.database.Cursor;
-import android.drm.mobile1.DrmRawContent;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.text.format.Formatter;
@@ -173,21 +172,17 @@ public class DownloadAdapter extends CursorAdapter {
             return;
         }
 
-        if (DrmRawContent.DRM_MIMETYPE_MESSAGE_STRING.equalsIgnoreCase(mediaType)) {
-            iconView.setImageResource(R.drawable.ic_launcher_drm_file);
+        Intent intent = new Intent(Intent.ACTION_VIEW);
+        intent.setDataAndType(Uri.fromParts("file", "", null), mediaType);
+        PackageManager pm = mContext.getPackageManager();
+        List<ResolveInfo> list = pm.queryIntentActivities(intent,
+                PackageManager.MATCH_DEFAULT_ONLY);
+        if (list.size() == 0) {
+            // no icon found for this mediatype. use "unknown" icon
+            iconView.setImageResource(R.drawable.ic_download_misc_file_type);
         } else {
-            Intent intent = new Intent(Intent.ACTION_VIEW);
-            intent.setDataAndType(Uri.fromParts("file", "", null), mediaType);
-            PackageManager pm = mContext.getPackageManager();
-            List<ResolveInfo> list = pm.queryIntentActivities(intent,
-                    PackageManager.MATCH_DEFAULT_ONLY);
-            if (list.size() == 0) {
-                // no icon found for this mediatype. use "unknown" icon
-                iconView.setImageResource(R.drawable.ic_download_misc_file_type);
-            } else {
-                Drawable icon = list.get(0).activityInfo.loadIcon(pm);
-                iconView.setImageDrawable(icon);
-            }
+            Drawable icon = list.get(0).activityInfo.loadIcon(pm);
+            iconView.setImageDrawable(icon);
         }
         iconView.setVisibility(View.VISIBLE);
     }