summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/IconCache.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-07-07 15:33:20 -0700
committerMichael Jurka <mikejurka@google.com>2011-07-07 15:39:05 -0700
commit4842ed029c5861b1696a9c69caa45f9a6e6e5f7e (patch)
tree5759b1ebd017fc1a5b3837013dec17d3dfecf2f2 /src/com/android/launcher2/IconCache.java
parent20b2c91103049dca4d704a120f292d0db5870c1e (diff)
downloadandroid_packages_apps_Trebuchet-4842ed029c5861b1696a9c69caa45f9a6e6e5f7e.tar.gz
android_packages_apps_Trebuchet-4842ed029c5861b1696a9c69caa45f9a6e6e5f7e.tar.bz2
android_packages_apps_Trebuchet-4842ed029c5861b1696a9c69caa45f9a6e6e5f7e.zip
Moving a bit of code around
- Resources.NotFoundException now handled inside getFullResIcon()
Diffstat (limited to 'src/com/android/launcher2/IconCache.java')
-rw-r--r--src/com/android/launcher2/IconCache.java21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/com/android/launcher2/IconCache.java b/src/com/android/launcher2/IconCache.java
index 5c07cfb42..22691a503 100644
--- a/src/com/android/launcher2/IconCache.java
+++ b/src/com/android/launcher2/IconCache.java
@@ -69,13 +69,15 @@ public class IconCache {
com.android.internal.R.mipmap.sym_def_app_icon);
}
- public Drawable getFullResIcon(Resources resources, int iconId)
- throws Resources.NotFoundException {
- return resources.getDrawableForDensity(iconId, mIconDpi);
+ public Drawable getFullResIcon(Resources resources, int iconId) {
+ try {
+ return resources.getDrawableForDensity(iconId, mIconDpi);
+ } catch (Resources.NotFoundException e) {
+ return getFullResDefaultActivityIcon();
+ }
}
- public Drawable getFullResIcon(ResolveInfo info, PackageManager packageManager)
- throws Resources.NotFoundException {
+ public Drawable getFullResIcon(ResolveInfo info, PackageManager packageManager) {
Resources resources;
try {
resources = packageManager.getResourcesForApplication(
@@ -178,13 +180,8 @@ public class IconCache {
entry.title = info.activityInfo.name;
}
- Drawable icon;
- try {
- icon = getFullResIcon(info, mPackageManager);
- } catch (Resources.NotFoundException e) {
- icon = getFullResDefaultActivityIcon();
- }
- entry.icon = Utilities.createIconBitmap(icon, mContext);
+ entry.icon = Utilities.createIconBitmap(
+ getFullResIcon(info, mPackageManager), mContext);
}
return entry;
}