summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/profiles
diff options
context:
space:
mode:
authorRaj Yengisetty <raj@cyngn.com>2015-01-13 17:37:02 +0800
committerAdnan Begovic <adnan@cyngn.com>2015-10-26 16:11:14 -0700
commit460f7bf8321f38c14eaf44058d1d1cd6faf23f11 (patch)
tree0086c2f13c3be9bf3cf8b8b478cb245189746f4d /src/com/android/settings/profiles
parentceeca10dd769494cf7233c3f1bee9d056bbeb648 (diff)
downloadpackages_apps_Settings-460f7bf8321f38c14eaf44058d1d1cd6faf23f11.zip
packages_apps_Settings-460f7bf8321f38c14eaf44058d1d1cd6faf23f11.tar.gz
packages_apps_Settings-460f7bf8321f38c14eaf44058d1d1cd6faf23f11.tar.bz2
System Profiles: Do not allow user to delete active profile
Change-Id: I6c643c13070ebbae3d7b999728f4a2fc65babb5e
Diffstat (limited to 'src/com/android/settings/profiles')
-rw-r--r--src/com/android/settings/profiles/SetupActionsFragment.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java
index a13047c..6b9c962 100644
--- a/src/com/android/settings/profiles/SetupActionsFragment.java
+++ b/src/com/android/settings/profiles/SetupActionsFragment.java
@@ -400,6 +400,20 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
}
private void requestRemoveProfileDialog() {
+ Profile current = mProfileManager.getActiveProfile();
+ if (mProfile.getUuid().equals(current.getUuid())) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ builder.setMessage(getString(R.string.profile_remove_current_profile));
+ builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ dialog.dismiss();
+ }
+ });
+ builder.show();
+ return;
+ }
+
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage(getString(R.string.profile_remove_dialog_message, mProfile.getName()));
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {