From 0f0fd043d8c26187bcdd3bcbda8ab8f01b6861a2 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Tue, 7 Jan 2014 14:12:04 -0800 Subject: [PATCH] Bug 921557 - (Part 2) Update other deprecated BitmapDrawable constructor usage. r=wesj --- mobile/android/base/Tab.java | 2 +- mobile/android/base/preferences/SearchEnginePreference.java | 2 +- mobile/android/base/prompts/Prompt.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/android/base/Tab.java b/mobile/android/base/Tab.java index 828a3b6a25b1..be368183d13c 100644 --- a/mobile/android/base/Tab.java +++ b/mobile/android/base/Tab.java @@ -207,7 +207,7 @@ public class Tab { public void run() { if (b != null) { try { - mThumbnail = new BitmapDrawable(b); + mThumbnail = new BitmapDrawable(mAppContext.getResources(), b); if (mState == Tab.STATE_SUCCESS) saveThumbnailToDB(); } catch (OutOfMemoryError oom) { diff --git a/mobile/android/base/preferences/SearchEnginePreference.java b/mobile/android/base/preferences/SearchEnginePreference.java index 37f39d3e9c98..3c6bf9e5bcac 100644 --- a/mobile/android/base/preferences/SearchEnginePreference.java +++ b/mobile/android/base/preferences/SearchEnginePreference.java @@ -193,7 +193,7 @@ public class SearchEnginePreference extends Preference implements View.OnLongCli // Copy the icon from this object to the prompt we produce. We lazily create the drawable, // as the user may not ever actually tap this object. if (mPromptIcon == null && mIconBitmap != null) { - mPromptIcon = new BitmapDrawable(mFaviconView.getBitmap()); + mPromptIcon = new BitmapDrawable(getContext().getResources(), mFaviconView.getBitmap()); } // Icons are hidden until Bug 926711 is fixed. diff --git a/mobile/android/base/prompts/Prompt.java b/mobile/android/base/prompts/Prompt.java index 743f288ef4d1..32e015c13207 100644 --- a/mobile/android/base/prompts/Prompt.java +++ b/mobile/android/base/prompts/Prompt.java @@ -586,7 +586,7 @@ public class Prompt implements OnClickListener, OnCancelListener, OnItemClickLis // We want the icon to be of a specific size. Some do not // follow this rule so we have to resize them. Bitmap bitmap = ((BitmapDrawable) item.icon).getBitmap(); - d = new BitmapDrawable(Bitmap.createScaledBitmap(bitmap, mIconSize, mIconSize, true)); + d = new BitmapDrawable(res, Bitmap.createScaledBitmap(bitmap, mIconSize, mIconSize, true)); } else if (item.inGroup) { // We don't currently support "indenting" items with icons d = getBlankDrawable(res);