Disable app notifications checkbox for uninstalled apps

Bug: 18253810
Change-Id: I99fb2ae34b16944fd839db4e7c380b2d32f3b85d
This commit is contained in:
Alexandra Gherghina
2014-11-05 13:20:56 +00:00
parent d9ed84375d
commit 51ea7cf4dc

View File

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