Bug 777591 - Part 2: Fix Favicon deprecation warning. r=blassey

This commit is contained in:
Chris Peterson 2012-07-27 09:52:57 -07:00
parent 4bfc87bd67
commit 7b703c6eec
2 changed files with 4 additions and 3 deletions

View File

@ -269,7 +269,7 @@ public class Favicons {
" with favicon URL = " + mFaviconUrl);
if (mFaviconUrl.startsWith("jar:jar:")) {
return GeckoJarReader.getBitmapDrawable(mFaviconUrl);
return GeckoJarReader.getBitmapDrawable(GeckoApp.mAppContext.getResources(), mFaviconUrl);
}
URI uri;

View File

@ -4,6 +4,7 @@
package org.mozilla.gecko.util;
import android.content.res.Resources;
import android.graphics.drawable.BitmapDrawable;
import android.util.Log;
@ -25,7 +26,7 @@ public final class GeckoJarReader {
private GeckoJarReader() {}
public static BitmapDrawable getBitmapDrawable(String url) {
public static BitmapDrawable getBitmapDrawable(Resources resources, String url) {
Stack<String> jarUrls = parseUrl(url);
InputStream inputStream = null;
BitmapDrawable bitmap = null;
@ -36,7 +37,7 @@ public final class GeckoJarReader {
zip = getZipFile(jarUrls.pop());
inputStream = getStream(zip, jarUrls);
if (inputStream != null) {
bitmap = new BitmapDrawable(inputStream);
bitmap = new BitmapDrawable(resources, inputStream);
}
} catch (IOException ex) {
Log.e(LOGTAG, "Exception ", ex);