summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/users
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2014-06-11 16:18:16 -0400
committerJulia Reynolds <juliacr@google.com>2014-06-11 17:14:14 -0400
commitb9195d25ee6b390362381adfaf1a00d339ffde34 (patch)
tree49c62cd02c78245548713282b7f3bcbca465bc01 /src/com/android/settings/users
parentc92af83b0c94eaf99f1c4d9675b39b4a73a958cc (diff)
downloadpackages_apps_Settings-b9195d25ee6b390362381adfaf1a00d339ffde34.zip
packages_apps_Settings-b9195d25ee6b390362381adfaf1a00d339ffde34.tar.gz
packages_apps_Settings-b9195d25ee6b390362381adfaf1a00d339ffde34.tar.bz2
Remove PIN from users page - use disallow_add/remove_user restrictions.
Bug: 14081992 Change-Id: If4973d64ae54da602a2682dee5b868ff66273856
Diffstat (limited to 'src/com/android/settings/users')
-rw-r--r--src/com/android/settings/users/UserPreference.java4
-rw-r--r--src/com/android/settings/users/UserSettings.java11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/com/android/settings/users/UserPreference.java b/src/com/android/settings/users/UserPreference.java
index 9f53aa5..56ca114 100644
--- a/src/com/android/settings/users/UserPreference.java
+++ b/src/com/android/settings/users/UserPreference.java
@@ -58,11 +58,13 @@ public class UserPreference extends Preference {
@Override
protected void onBindView(View view) {
+ UserManager um = (UserManager) getContext().getSystemService(Context.USER_SERVICE);
View deleteDividerView = view.findViewById(R.id.divider_delete);
View manageDividerView = view.findViewById(R.id.divider_manage);
View deleteView = view.findViewById(R.id.trash_user);
if (deleteView != null) {
- if (mDeleteClickListener != null) {
+ if (mDeleteClickListener != null
+ && !um.hasUserRestriction(UserManager.DISALLOW_REMOVE_USER)) {
deleteView.setOnClickListener(mDeleteClickListener);
deleteView.setTag(this);
} else {
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index 901ee50..8d27c65 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -64,12 +64,12 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.settings.ChooseLockGeneric;
import com.android.settings.OwnerInfoSettings;
import com.android.settings.R;
-import com.android.settings.RestrictedSettingsFragment;
import com.android.settings.SelectableEditTextPreference;
import com.android.settings.SettingsActivity;
+import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
-public class UserSettings extends RestrictedSettingsFragment
+public class UserSettings extends SettingsPreferenceFragment
implements OnPreferenceClickListener, OnClickListener, DialogInterface.OnDismissListener,
Preference.OnPreferenceChangeListener {
@@ -136,10 +136,6 @@ public class UserSettings extends RestrictedSettingsFragment
private SparseArray<Bitmap> mUserIcons = new SparseArray<Bitmap>();
private boolean mIsOwner = UserHandle.myUserId() == UserHandle.USER_OWNER;
- public UserSettings() {
- super(RestrictedSettingsFragment.RESTRICTIONS_PIN_SET);
- }
-
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
@@ -204,7 +200,8 @@ public class UserSettings extends RestrictedSettingsFragment
}
mAddUser = findPreference(KEY_ADD_USER);
if (!mIsOwner || UserManager.getMaxSupportedUsers() < 2
- || !UserManager.supportsMultipleUsers()) {
+ || !UserManager.supportsMultipleUsers()
+ || mUserManager.hasUserRestriction(UserManager.DISALLOW_ADD_USER)) {
removePreference(KEY_ADD_USER);
} else {
mAddUser.setOnPreferenceClickListener(this);