Multiuser settings revamp - followup to address comments

Bug: 15761405
Change-Id: I9c03432a2f2651a931486ce65fb3b5af37608be0
This commit is contained in:
Amith Yamasani
2014-07-02 00:06:37 +05:30
parent 0244ae05cc
commit 51c6dac50e
5 changed files with 45 additions and 62 deletions

View File

@@ -211,10 +211,8 @@ public class UserSettings extends SettingsPreferenceFragment
mAddUser.setOnPreferenceClickListener(this);
DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(
Context.DEVICE_POLICY_SERVICE);
// No restricted profiles for tablets with a device owner, or
// phones.
if (dpm.getDeviceOwner() != null
|| Utils.isVoiceCapable(context)) {
// No restricted profiles for tablets with a device owner, or phones.
if (dpm.getDeviceOwner() != null || Utils.isVoiceCapable(context)) {
mCanAddRestrictedProfile = false;
mAddUser.setTitle(R.string.user_add_user_menu);
}
@@ -431,7 +429,11 @@ public class UserSettings extends SettingsPreferenceFragment
extras.putInt(UserDetailsSettings.EXTRA_USER_ID, userId);
((SettingsActivity) getActivity()).startPreferencePanel(
UserDetailsSettings.class.getName(),
extras, -1, info.name, null, 0);
extras,
-1, /* No title res id */
info.name, /* title */
null, /* resultTo */
0 /* resultRequestCode */);
}
}
@@ -458,7 +460,7 @@ public class UserSettings extends SettingsPreferenceFragment
switch (dialogId) {
case DIALOG_CONFIRM_REMOVE: {
Dialog dlg =
RemoveUserUtil.createConfirmationDialog(getActivity(), mRemovingUserId,
Utils.createRemoveConfirmationDialog(getActivity(), mRemovingUserId,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
removeUserNow();
@@ -665,8 +667,6 @@ public class UserSettings extends SettingsPreferenceFragment
pref = new UserPreference(context, null, user.id,
showSettings ? this : null,
showDelete ? this : null);
//mIsOwner && user.isRestricted() ? this : null,
//mIsOwner ? this : null);
pref.setOnPreferenceClickListener(this);
pref.setKey("id=" + user.id);
mUserListCategory.addPreference(pref);