Backout 0708b8629399 and a2aa2637a1b7 to fix commit message. r=fixup

This commit is contained in:
Wes Johnston 2013-10-15 10:40:09 -07:00
Родитель 9273cefb95
Коммит e516e626dd
1 изменённых файлов: 1 добавлений и 32 удалений

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

@ -27,7 +27,6 @@ import org.mozilla.gecko.R;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.NoSuchFieldException;
import java.net.MalformedURLException;
import java.net.URL;
@ -82,19 +81,6 @@ public final class BitmapUtils {
return;
}
if(data.startsWith("-moz-icon://")) {
Uri imageUri = Uri.parse(data);
String resource = imageUri.getSchemeSpecificPart();
resource = resource.substring(resource.lastIndexOf('/') + 1);
try {
Drawable d = context.getPackageManager().getApplicationIcon(resource);
loader.onBitmapFound(d);
} catch(Exception ex) { }
return;
}
if(data.startsWith("drawable://")) {
Uri imageUri = Uri.parse(data);
int id = getResource(imageUri, R.drawable.ic_status_logo);
@ -296,28 +282,11 @@ public final class BitmapUtils {
if ("drawable".equals(scheme)) {
String resource = resourceUrl.getSchemeSpecificPart();
resource = resource.substring(resource.lastIndexOf('/') + 1);
try {
final Class<R.drawable> drawableClass = R.drawable.class;
final Field f = drawableClass.getField(resource);
icon = f.getInt(null);
} catch (final NoSuchFieldException e1) {
// just means the resource doesn't exist for fennec. Check in Android resources
try {
final Class<android.R.drawable> drawableClass = android.R.drawable.class;
final Field f = drawableClass.getField(resource);
icon = f.getInt(null);
} catch (final NoSuchFieldException e2) {
// This drawable doesn't seem to exist...
} catch(Exception e3) {
Log.i(LOGTAG, "Exception getting drawable", e3);
}
} catch (Exception e4) {
Log.i(LOGTAG, "Exception getting drawable", e4);
}
} catch (final Exception e) {} // just means the resource doesn't exist
resourceUrl = null;
}
return icon;