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

Commit

Permalink
Use original uid
Browse files Browse the repository at this point in the history
Refs #1561
Refs #1563
  • Loading branch information
M66B committed Mar 16, 2014
1 parent 665e825 commit dae7d95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/biz/bokhorst/xprivacy/ApplicationInfoEx.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

@SuppressLint("DefaultLocale")
public class ApplicationInfoEx implements Comparable<ApplicationInfoEx> {
private int mUid;
private TreeMap<String, ApplicationInfo> mMapAppInfo = null;
private Map<String, PackageInfo> mMapPkgInfo = new HashMap<String, PackageInfo>();

Expand All @@ -39,6 +40,7 @@ public class ApplicationInfoEx implements Comparable<ApplicationInfoEx> {
private long mUpdateTime = -1;

public ApplicationInfoEx(Context context, int uid) {
mUid = uid;
mMapAppInfo = new TreeMap<String, ApplicationInfo>();
PackageManager pm = context.getPackageManager();
String[] packages = pm.getPackagesForUid(uid);
Expand Down Expand Up @@ -185,11 +187,7 @@ public boolean isFrozen(Context context) {
}

public int getUid() {
// All listed uid's are the same
if (mMapAppInfo.size() > 0)
return mMapAppInfo.firstEntry().getValue().uid;
else
return -1;
return mUid;
}

public int getState(Context context) {
Expand Down Expand Up @@ -261,7 +259,6 @@ public boolean isIsolated() {

@Override
public String toString() {
// All uid's are the same
return String.format("%d %s", getUid(), TextUtils.join(", ", getApplicationName()));
}

Expand Down
2 changes: 1 addition & 1 deletion src/biz/bokhorst/xprivacy/PrivacyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ private AlertDialog.Builder getOnDemandDialogBuilder(final PRestriction restrict
view.setBackgroundColor(resources.getColor(R.color.color_dangerous_dark));

ivAppIcon.setImageDrawable(appInfo.getIcon(context));
tvUid.setText(Integer.toString(restriction.uid));
tvUid.setText(Integer.toString(appInfo.getUid()));
tvAppName.setText(TextUtils.join(", ", appInfo.getApplicationName()));

String defaultAction = resources.getString(result.restricted ? R.string.title_deny : R.string.title_allow);
Expand Down

0 comments on commit dae7d95

Please sign in to comment.