Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Make Andy happy ;-)
Browse files Browse the repository at this point in the history
Refs #2095
  • Loading branch information
M66B committed Dec 25, 2014
1 parent c8519f1 commit 80a9e36
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/biz/bokhorst/xprivacy/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1904,6 +1905,8 @@ private class HolderTask extends AsyncTask<Object, Object, Object> {
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;
Expand All @@ -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);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 80a9e36

Please sign in to comment.