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
Родитель c7bb810dd1
Коммит 33e8bb6ab0
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);