From a1902f4d26a5c87dddf52e2e855bcd6ed9734ab2 Mon Sep 17 00:00:00 2001 From: Gloria Wang Date: Tue, 21 Jun 2011 16:18:13 -0700 Subject: To remove the old DRM support totally because we added the new Forward Lock support in Download Provider. Change-Id: I71faf19527104455b666cba73a052cd0d4b7d70e --- .../providers/downloads/ui/DownloadAdapter.java | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'ui') diff --git a/ui/src/com/android/providers/downloads/ui/DownloadAdapter.java b/ui/src/com/android/providers/downloads/ui/DownloadAdapter.java index 33f9531d..34664ff3 100644 --- a/ui/src/com/android/providers/downloads/ui/DownloadAdapter.java +++ b/ui/src/com/android/providers/downloads/ui/DownloadAdapter.java @@ -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 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 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); } -- cgit v1.2.3