summaryrefslogtreecommitdiffstats
path: root/graphics/tests
diff options
context:
space:
mode:
authorDan Sandler <dsandler@android.com>2015-05-14 11:44:32 -0400
committerDan Sandler <dsandler@android.com>2015-05-14 13:23:12 -0400
commit02cd9f91a6bd6d06d6d1237f8b978a0ab0b8ea32 (patch)
treecbe53eb516a0d954bfb353e7bea9cf4e6d2f8c14 /graphics/tests
parentd674f2308aa1dd8f6f6df9d3cdd552e2aec0e64e (diff)
downloadframeworks_base-02cd9f91a6bd6d06d6d1237f8b978a0ab0b8ea32.zip
frameworks_base-02cd9f91a6bd6d06d6d1237f8b978a0ab0b8ea32.tar.gz
frameworks_base-02cd9f91a6bd6d06d6d1237f8b978a0ab0b8ea32.tar.bz2
Use Context instead of Resources in Icon.createWithResource.
This works around situations where corrupted packages cause Resources.getResourcePackageName to return something that does't actually work. Bug: 21144636 Change-Id: I271518599a8eb89d493f1ceda6cb2e47fb38a4ff
Diffstat (limited to 'graphics/tests')
-rw-r--r--graphics/tests/graphicstests/src/android/graphics/drawable/IconTest.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/graphics/tests/graphicstests/src/android/graphics/drawable/IconTest.java b/graphics/tests/graphicstests/src/android/graphics/drawable/IconTest.java
index a7f8023..a214b9e 100644
--- a/graphics/tests/graphicstests/src/android/graphics/drawable/IconTest.java
+++ b/graphics/tests/graphicstests/src/android/graphics/drawable/IconTest.java
@@ -112,8 +112,7 @@ public class IconTest extends AndroidTestCase {
final Bitmap res1 = ((BitmapDrawable) getContext().getDrawable(R.drawable.landscape))
.getBitmap();
- final Icon im1 = Icon.createWithResource(getContext().getResources(),
- R.drawable.landscape);
+ final Icon im1 = Icon.createWithResource(getContext(), R.drawable.landscape);
final Drawable draw1 = im1.loadDrawable(mContext);
final Bitmap test1 = Bitmap.createBitmap(draw1.getIntrinsicWidth(),
draw1.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
@@ -223,7 +222,7 @@ public class IconTest extends AndroidTestCase {
imgs.add(bit1);
final Icon data1 = Icon.createWithData(pngdata, 0, pngdata.length);
imgs.add(data1);
- final Icon res1 = Icon.createWithResource(getContext().getResources(), R.drawable.landscape);
+ final Icon res1 = Icon.createWithResource(getContext(), R.drawable.landscape);
imgs.add(res1);
ArrayList<Icon> test = new ArrayList<>();