From 80a9e36b1add8d3e9efae33fd749ce940097caee Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 25 Dec 2014 11:06:24 +0100 Subject: [PATCH] Make Andy happy ;-) Refs #2095 --- src/biz/bokhorst/xprivacy/ActivityMain.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/biz/bokhorst/xprivacy/ActivityMain.java b/src/biz/bokhorst/xprivacy/ActivityMain.java index c0efd8565..896514dc6 100644 --- a/src/biz/bokhorst/xprivacy/ActivityMain.java +++ b/src/biz/bokhorst/xprivacy/ActivityMain.java @@ -30,6 +30,7 @@ import android.graphics.Paint.Style; import android.graphics.Typeface; import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; @@ -1904,6 +1905,8 @@ private class HolderTask extends AsyncTask { private ViewHolder holder; private ApplicationInfoEx xAppInfo = null; private int state; + private Bitmap bicon; + private Drawable dicon; private boolean used; private boolean enabled; private boolean granted; @@ -1928,6 +1931,11 @@ protected Object doInBackground(Object... params) { // Get state state = xAppInfo.getState(ActivityMain.this); + // Get icon + bicon = xAppInfo.getIconBitmap(ActivityMain.this); + if (bicon == null) + dicon = xAppInfo.getIcon(ActivityMain.this); + // Get if used used = (PrivacyManager.getUsage(xAppInfo.getUid(), mRestrictionName, null) != 0); @@ -1988,7 +1996,10 @@ else if (state == ApplicationInfoEx.STATE_SHARED) getThemed(R.attr.color_state_restricted))); // Display icon - holder.imgIcon.setImageBitmap(xAppInfo.getIconBitmap(ActivityMain.this)); + if (bicon == null) + holder.imgIcon.setImageDrawable(dicon); + else + holder.imgIcon.setImageBitmap(bicon); holder.imgIcon.setVisibility(View.VISIBLE); // Display on demand