Fix warnings and remove dead code

Change-Id: I574d823fedf4b752c3df5a72599b390f708823ac
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java
index 0387011..b27f7bb 100644
--- a/src/com/android/launcher2/Utilities.java
+++ b/src/com/android/launcher2/Utilities.java
@@ -41,6 +41,7 @@
  * Various utilities shared amongst the Launcher's classes.
  */
 final class Utilities {
+    @SuppressWarnings("unused")
     private static final String TAG = "Launcher.Utilities";
 
     private static int sIconWidth = -1;
@@ -83,7 +84,8 @@
             return icon;
         } else {
             // Icon is too small, render to a larger bitmap
-            return createIconBitmap(new BitmapDrawable(icon), context);
+            final Resources resources = context.getResources();
+            return createIconBitmap(new BitmapDrawable(resources, icon), context);
         }
     }
 
@@ -142,7 +144,9 @@
             final int left = (textureWidth-width) / 2;
             final int top = (textureHeight-height) / 2;
 
-            if (false) {
+            @SuppressWarnings("all") // suppress dead code warning
+            final boolean debug = false;
+            if (debug) {
                 // draw a big box for the icon for debugging
                 canvas.drawColor(sColors[sColorIndex]);
                 if (++sColorIndex >= sColors.length) sColorIndex = 0;
@@ -205,7 +209,8 @@
             if (bitmap.getWidth() == sIconWidth && bitmap.getHeight() == sIconHeight) {
                 return bitmap;
             } else {
-                return createIconBitmap(new BitmapDrawable(bitmap), context);
+                final Resources resources = context.getResources();
+                return createIconBitmap(new BitmapDrawable(resources, bitmap), context);
             }
         }
     }