am a4a7b739: am c66eb698: Merge "Disable app notifications checkbox for uninstalled apps" into lmp-mr1-dev

* commit 'a4a7b739ac22413f886180440d6ccfba1e373c31':
  Disable app notifications checkbox for uninstalled apps
This commit is contained in:
Alexandra Gherghina
2014-11-07 10:44:53 +00:00
committed by Android Git Automerger

View File

@@ -420,6 +420,9 @@ public class InstalledAppDetails extends Fragment
mNotificationSwitch.setChecked(enabled); mNotificationSwitch.setChecked(enabled);
if (Utils.isSystemPackage(mPm, mPackageInfo)) { if (Utils.isSystemPackage(mPm, mPackageInfo)) {
mNotificationSwitch.setEnabled(false); mNotificationSwitch.setEnabled(false);
} else if ((mPackageInfo.applicationInfo.flags & ApplicationInfo.FLAG_INSTALLED) == 0) {
// App is not installed on the current user
mNotificationSwitch.setEnabled(false);
} else { } else {
mNotificationSwitch.setEnabled(true); mNotificationSwitch.setEnabled(true);
mNotificationSwitch.setOnCheckedChangeListener(this); mNotificationSwitch.setOnCheckedChangeListener(this);