зеркало из https://github.com/mozilla/gecko-dev.git
Bug 777591 - Part 2: Fix Favicon deprecation warning. r=blassey
This commit is contained in:
Родитель
c7bb810dd1
Коммит
33e8bb6ab0
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче