Fix links to notification settings activities.

Additionally, we now show the user a list of "app-like"
things (packages with launchable activities) instead of only
non-system things. This way you can make (some) changes to
system package notifications while not having to page
through reams of random non-app packages.

Bug: 17277023
Change-Id: I920d6b941070efb75a816e6ad38b798b09a83d08
This commit is contained in:
Dan Sandler
2014-09-02 18:31:49 +02:00
parent 963ce47525
commit b58b512704
3 changed files with 83 additions and 47 deletions

View File

@@ -316,22 +316,13 @@ public class InstalledAppDetails extends Fragment
}
}
private boolean isThisASystemPackage() {
try {
PackageInfo sys = mPm.getPackageInfo("android", PackageManager.GET_SIGNATURES);
return (mPackageInfo != null && mPackageInfo.signatures != null &&
sys.signatures[0].equals(mPackageInfo.signatures[0]));
} catch (PackageManager.NameNotFoundException e) {
return false;
}
}
private boolean handleDisableable(Button button) {
boolean disableable = false;
// Try to prevent the user from bricking their phone
// by not allowing disabling of apps signed with the
// system cert and any launcher app in the system.
if (mHomePackages.contains(mAppEntry.info.packageName) || isThisASystemPackage()) {
if (mHomePackages.contains(mAppEntry.info.packageName)
|| Utils.isSystemPackage(mPm, mPackageInfo)) {
// Disable button for core system applications.
button.setText(R.string.disable_text);
} else if (mAppEntry.info.enabled) {
@@ -427,7 +418,7 @@ public class InstalledAppDetails extends Fragment
// this does not bode well
}
mNotificationSwitch.setChecked(enabled);
if (isThisASystemPackage()) {
if (Utils.isSystemPackage(mPm, mPackageInfo)) {
mNotificationSwitch.setEnabled(false);
} else {
mNotificationSwitch.setEnabled(true);