mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 777591 - Part 2: Fix Favicon deprecation warning. r=blassey
This commit is contained in:
parent
4bfc87bd67
commit
7b703c6eec
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user