diff options
author | Darren Salt <devspam@moreofthesa.me.uk> | 2013-06-27 01:15:12 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2013-06-27 17:00:50 +0200 |
commit | c5f12102ef775c7e94f76cd4f1d40e13e5ad753c (patch) | |
tree | fcb52ced8545d31e295cbd8009782ffdd902fa44 /src | |
parent | 5ff97ed779fec088a71805f9a3048980da3b0094 (diff) | |
download | packages_apps_settings-c5f12102ef775c7e94f76cd4f1d40e13e5ad753c.zip packages_apps_settings-c5f12102ef775c7e94f76cd4f1d40e13e5ad753c.tar.gz packages_apps_settings-c5f12102ef775c7e94f76cd4f1d40e13e5ad753c.tar.bz2 |
Handle cancellation of the 'enabling PrivacyGuard' alert box.
I noticed that the option could remain ticked but not actually enabled
if the alert box is cancelled.
Change-Id: If9a4e88641a5e4283d6ea16c17ca4461841580e3
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/applications/InstalledAppDetails.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java index 416c92f..16f7efd 100644 --- a/src/com/android/settings/applications/InstalledAppDetails.java +++ b/src/com/android/settings/applications/InstalledAppDetails.java @@ -1181,8 +1181,7 @@ public class InstalledAppDetails extends Fragment .setNegativeButton(R.string.dlg_cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { - // Re-enable the checkbox - getOwner().mNotificationSwitch.setChecked(true); + dialog.cancel(); } }) .create(); @@ -1215,14 +1214,27 @@ public class InstalledAppDetails extends Fragment .setNegativeButton(R.string.dlg_cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { - // Re-enable the checkbox - getOwner().mPrivacyGuardSwitch.setChecked(false); + dialog.cancel(); } }) .create(); } throw new IllegalArgumentException("unknown id " + id); } + + @Override + public void onCancel(DialogInterface dialog) { + int id = getArguments().getInt("id"); + switch (id) { + case DLG_DISABLE_NOTIFICATIONS: + // Re-enable the checkbox + getOwner().mNotificationSwitch.setChecked(true); + case DLG_PRIVACY_GUARD: + // Re-enable the checkbox + getOwner().mPrivacyGuardSwitch.setChecked(false); + break; + } + } } private void uninstallPkg(String packageName, boolean allUsers, boolean andDisable) { |