Fixing issue where default widget previews were not using large icons on tablet.

Change-Id: I66469f52172be8ee526dc71cc5b6aa797f6a3289
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 4d8a9cf..d90e39d 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -932,7 +932,7 @@
         Bitmap preview = Bitmap.createBitmap(bitmapSize, bitmapSize, Config.ARGB_8888);
 
         // Render the icon
-        Drawable icon = mIconCache.getFullResIcon(info, mPackageManager);
+        Drawable icon = mIconCache.getFullResIcon(info);
         renderDrawableToBitmap(icon, preview, offset, offset, mAppIconSize, mAppIconSize);
         return preview;
     }
@@ -1014,7 +1014,7 @@
                 Drawable icon = null;
                 int hoffset = (int) (bitmapWidth / 2 - mAppIconSize * iconScale / 2);
                 int yoffset = (int) (bitmapHeight / 2 - mAppIconSize * iconScale / 2);
-                if (info.icon > 0) icon = mPackageManager.getDrawable(packageName, info.icon, null);
+                if (info.icon > 0) icon = mIconCache.getFullResIcon(packageName, info.icon);
                 if (icon == null) icon = resources.getDrawable(R.drawable.ic_launcher_application);
 
                 renderDrawableToBitmap(icon, preview, hoffset, yoffset,
diff --git a/src/com/android/launcher2/IconCache.java b/src/com/android/launcher2/IconCache.java
index 7f3ae86..a0412af 100644
--- a/src/com/android/launcher2/IconCache.java
+++ b/src/com/android/launcher2/IconCache.java
@@ -86,10 +86,25 @@
         return (d != null) ? d : getFullResDefaultActivityIcon();
     }
 
-    public Drawable getFullResIcon(ResolveInfo info, PackageManager packageManager) {
+    public Drawable getFullResIcon(String packageName, int iconId) {
         Resources resources;
         try {
-            resources = packageManager.getResourcesForApplication(
+            resources = mPackageManager.getResourcesForApplication(packageName);
+        } catch (PackageManager.NameNotFoundException e) {
+            resources = null;
+        }
+        if (resources != null) {
+            if (iconId != 0) {
+                return getFullResIcon(resources, iconId);
+            }
+        }
+        return getFullResDefaultActivityIcon();
+    }
+
+    public Drawable getFullResIcon(ResolveInfo info) {
+        Resources resources;
+        try {
+            resources = mPackageManager.getResourcesForApplication(
                     info.activityInfo.applicationInfo);
         } catch (PackageManager.NameNotFoundException e) {
             resources = null;
@@ -198,7 +213,7 @@
             }
 
             entry.icon = Utilities.createIconBitmap(
-                    getFullResIcon(info, mPackageManager), mContext);
+                    getFullResIcon(info), mContext);
         }
         return entry;
     }