am 68e4d688: am 279678e1: Merge "Show a default icon for permissions that lack a group." into mnc-dev
* commit '68e4d688ba4c4b4bd23a8acc8c807d2f8b446342': Show a default icon for permissions that lack a group.
This commit is contained in:
@@ -98,18 +98,12 @@ public class AppSecurityPermissions {
|
|||||||
super(info);
|
super(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Drawable loadGroupIcon(PackageManager pm) {
|
public Drawable loadGroupIcon(Context context, PackageManager pm) {
|
||||||
if (icon != 0) {
|
if (icon != 0) {
|
||||||
return loadUnbadgedIcon(pm);
|
return loadUnbadgedIcon(pm);
|
||||||
} else {
|
} else {
|
||||||
ApplicationInfo appInfo;
|
return context.getDrawable(R.drawable.ic_perm_device_info);
|
||||||
try {
|
|
||||||
appInfo = pm.getApplicationInfo(packageName, 0);
|
|
||||||
return appInfo.loadUnbadgedIcon(pm);
|
|
||||||
} catch (NameNotFoundException e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +157,7 @@ public class AppSecurityPermissions {
|
|||||||
PackageManager pm = getContext().getPackageManager();
|
PackageManager pm = getContext().getPackageManager();
|
||||||
Drawable icon = null;
|
Drawable icon = null;
|
||||||
if (first) {
|
if (first) {
|
||||||
icon = grp.loadGroupIcon(pm);
|
icon = grp.loadGroupIcon(getContext(), pm);
|
||||||
}
|
}
|
||||||
CharSequence label = perm.mLabel;
|
CharSequence label = perm.mLabel;
|
||||||
if (perm.mNew && newPermPrefix != null) {
|
if (perm.mNew && newPermPrefix != null) {
|
||||||
@@ -213,7 +207,7 @@ public class AppSecurityPermissions {
|
|||||||
builder.setMessage(sbuilder.toString());
|
builder.setMessage(sbuilder.toString());
|
||||||
}
|
}
|
||||||
builder.setCancelable(true);
|
builder.setCancelable(true);
|
||||||
builder.setIcon(mGroup.loadGroupIcon(pm));
|
builder.setIcon(mGroup.loadGroupIcon(getContext(), pm));
|
||||||
addRevokeUIIfNecessary(builder);
|
addRevokeUIIfNecessary(builder);
|
||||||
mDialog = builder.show();
|
mDialog = builder.show();
|
||||||
mDialog.setCanceledOnTouchOutside(true);
|
mDialog.setCanceledOnTouchOutside(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user