summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-07-18 18:11:46 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-18 18:11:46 -0700
commit6ba9e021d40b0232c5d46afb366cf986b3fa9ce4 (patch)
treeb1f8c554d3f692dbcf981dc49d40b79480e0a6ef /src/com
parent1840494bdafaf4d95722f25caada8cf28c074f49 (diff)
parentf0b63c2c3ec65e8864d5b76a993e87f592170a3d (diff)
downloadpackages_apps_settings-6ba9e021d40b0232c5d46afb366cf986b3fa9ce4.zip
packages_apps_settings-6ba9e021d40b0232c5d46afb366cf986b3fa9ce4.tar.gz
packages_apps_settings-6ba9e021d40b0232c5d46afb366cf986b3fa9ce4.tar.bz2
Merge "Fix issue #4999758: Disabling a system app should require..."
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/applications/InstalledAppDetails.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index ab46661..a84b8bb 100644
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -147,6 +147,7 @@ public class InstalledAppDetails extends Fragment
private static final int DLG_CANNOT_CLEAR_DATA = DLG_BASE + 4;
private static final int DLG_FORCE_STOP = DLG_BASE + 5;
private static final int DLG_MOVE_FAILED = DLG_BASE + 6;
+ private static final int DLG_DISABLE = DLG_BASE + 7;
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
@@ -754,6 +755,22 @@ public class InstalledAppDetails extends Fragment
.setMessage(msg)
.setNeutralButton(R.string.dlg_ok, null)
.create();
+ case DLG_DISABLE:
+ return new AlertDialog.Builder(getActivity())
+ .setTitle(getActivity().getText(R.string.app_disable_dlg_title))
+ .setIcon(android.R.drawable.ic_dialog_alert)
+ .setMessage(getActivity().getText(R.string.app_disable_dlg_text))
+ .setPositiveButton(R.string.dlg_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ // Disable the app
+ new DisableChanger(getOwner(), getOwner().mAppEntry.info,
+ PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER)
+ .execute((Object)null);
+ }
+ })
+ .setNegativeButton(R.string.dlg_cancel, null)
+ .create();
}
throw new IllegalArgumentException("unknown id " + id);
}
@@ -837,9 +854,13 @@ public class InstalledAppDetails extends Fragment
showDialogInner(DLG_FACTORY_RESET, 0);
} else {
if ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
- new DisableChanger(this, mAppEntry.info, mAppEntry.info.enabled ?
- PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER
- : PackageManager.COMPONENT_ENABLED_STATE_DEFAULT).execute((Object)null);
+ if (mAppEntry.info.enabled) {
+ showDialogInner(DLG_DISABLE, 0);
+ } else {
+ new DisableChanger(this, mAppEntry.info,
+ PackageManager.COMPONENT_ENABLED_STATE_DEFAULT)
+ .execute((Object)null);
+ }
} else {
uninstallPkg(packageName);
}