diff options
author | Michael Jurka <mikejurka@google.com> | 2012-04-13 14:44:29 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-04-13 14:52:51 -0700 |
commit | 3a9fcedbcd235372cd2ab64f825a0b5b3937f59e (patch) | |
tree | 56feecf8020f7e7aa2e7f0a9c5324ebc6f806832 /src/com/android/launcher2/Utilities.java | |
parent | 8c198fb862d17d911703cd73960dceb524070215 (diff) | |
download | android_packages_apps_Trebuchet-3a9fcedbcd235372cd2ab64f825a0b5b3937f59e.tar.gz android_packages_apps_Trebuchet-3a9fcedbcd235372cd2ab64f825a0b5b3937f59e.tar.bz2 android_packages_apps_Trebuchet-3a9fcedbcd235372cd2ab64f825a0b5b3937f59e.zip |
Fix warnings and remove dead code
Change-Id: I574d823fedf4b752c3df5a72599b390f708823ac
Diffstat (limited to 'src/com/android/launcher2/Utilities.java')
-rw-r--r-- | src/com/android/launcher2/Utilities.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java index 0387011a4..b27f7bb11 100644 --- a/src/com/android/launcher2/Utilities.java +++ b/src/com/android/launcher2/Utilities.java @@ -41,6 +41,7 @@ import com.android.launcher.R; * 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 @@ final class Utilities { 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 class Utilities { 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 @@ final class Utilities { 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); } } } |