Move strings related to user creation to SettingsLib.
Test: Build, manually check device. Bug: 147653252 Bug: 152038380 Change-Id: I921d7907eca5c6bd6585f89e5dd5b6b6222bc745
This commit is contained in:
@@ -649,12 +649,10 @@
|
|||||||
<string name="owner_info_settings_status"><xliff:g id="count" example="90">%1$d</xliff:g> / <xliff:g id="count" example="100">%2$d</xliff:g></string>
|
<string name="owner_info_settings_status"><xliff:g id="count" example="90">%1$d</xliff:g> / <xliff:g id="count" example="100">%2$d</xliff:g></string>
|
||||||
<!-- Hint text shown in owner info edit text [CHAR LIMIT=50] -->
|
<!-- Hint text shown in owner info edit text [CHAR LIMIT=50] -->
|
||||||
<string name="owner_info_settings_edit_text_hint">E.g., Joe\u2019s Android.</string>
|
<string name="owner_info_settings_edit_text_hint">E.g., Joe\u2019s Android.</string>
|
||||||
<!-- Text shown for title of user info setting [CHAR LIMIT=20]-->
|
|
||||||
<string name="user_info_settings_title">User info</string>
|
|
||||||
<!-- Text shown next to checkbox for showing profile info on LockScreen [CHAR LIMIT=50]-->
|
<!-- Text shown next to checkbox for showing profile info on LockScreen [CHAR LIMIT=50]-->
|
||||||
<string name="show_profile_info_on_lockscreen_label">Show profile info on lock screen</string>
|
<string name="show_profile_info_on_lockscreen_label">Show profile info on lock screen</string>
|
||||||
<!-- Text shown for title of profile info setting [CHAR LIMIT=20]-->
|
|
||||||
<string name="profile_info_settings_title">Profile info</string>
|
|
||||||
<!-- Main Settings screen setting option title for the item to take you to the Accounts screen [CHAR LIMIT=22] -->
|
<!-- Main Settings screen setting option title for the item to take you to the Accounts screen [CHAR LIMIT=22] -->
|
||||||
<string name="Accounts_settings_title">Accounts</string>
|
<string name="Accounts_settings_title">Accounts</string>
|
||||||
<!-- Main Settings screen setting option title for the item to take you to the location screen -->
|
<!-- Main Settings screen setting option title for the item to take you to the location screen -->
|
||||||
@@ -6895,10 +6893,7 @@
|
|||||||
<string name="user_add_user_menu">Add user</string>
|
<string name="user_add_user_menu">Add user</string>
|
||||||
<!-- User settings summary for a restricted profile [CHAR LIMIT=50] -->
|
<!-- User settings summary for a restricted profile [CHAR LIMIT=50] -->
|
||||||
<string name="user_summary_restricted_profile">Restricted profile</string>
|
<string name="user_summary_restricted_profile">Restricted profile</string>
|
||||||
<!-- User settings warning that restricted profile needs a screen lock [CHAR LIMIT=NONE] -->
|
|
||||||
<string name="user_need_lock_message">Before you can create a restricted profile, you\u2019ll need to set up a screen lock to protect your apps and personal data.</string>
|
|
||||||
<!-- User settings dialog button to set screen lock [CHAR LIMIT=25] -->
|
|
||||||
<string name="user_set_lock_button">Set lock</string>
|
|
||||||
<!-- User summary to indicate that user is currently not set up [CHAR LIMIT=100] -->
|
<!-- User summary to indicate that user is currently not set up [CHAR LIMIT=100] -->
|
||||||
<string name="user_summary_not_set_up">Not set up</string>
|
<string name="user_summary_not_set_up">Not set up</string>
|
||||||
<!-- User summary to indicate that restricted profile is currently not set up [CHAR LIMIT=100] -->
|
<!-- User summary to indicate that restricted profile is currently not set up [CHAR LIMIT=100] -->
|
||||||
@@ -6911,34 +6906,10 @@
|
|||||||
<string name="user_you">You (<xliff:g id="name" example="Name">%s</xliff:g>)</string>
|
<string name="user_you">You (<xliff:g id="name" example="Name">%s</xliff:g>)</string>
|
||||||
<!-- Title for the preference to enter the nickname of the userto display in the user switcher [CHAR LIMIT=25]-->
|
<!-- Title for the preference to enter the nickname of the userto display in the user switcher [CHAR LIMIT=25]-->
|
||||||
<string name="user_nickname">Nickname</string>
|
<string name="user_nickname">Nickname</string>
|
||||||
<!-- Title for add user type dialog [CHAR LIMIT=45] -->
|
|
||||||
<string name="user_add_user_type_title">Add</string>
|
|
||||||
<!-- Summary for add user action, when it's disabled [CHAR LIMIT=100] -->
|
<!-- Summary for add user action, when it's disabled [CHAR LIMIT=100] -->
|
||||||
<string name="user_add_max_count">You can add up to <xliff:g id="user_count">%1$d</xliff:g> users</string>
|
<string name="user_add_max_count">You can add up to <xliff:g id="user_count">%1$d</xliff:g> users</string>
|
||||||
<!-- Summary for add user entry in the choice dialog [CHAR LIMIT=none] -->
|
|
||||||
<string name="user_add_user_item_summary">Users have their own apps and content</string>
|
|
||||||
<!-- Summary for add restricted profile entry in the choice dialog [CHAR LIMIT=none] -->
|
|
||||||
<string name="user_add_profile_item_summary">You can restrict access to apps and content from your account</string>
|
|
||||||
<!-- Button text for adding a regular user [CHAR LIMIT=25] -->
|
|
||||||
<string name="user_add_user_item_title">User</string>
|
|
||||||
<!-- Button text for adding a restricted profile [CHAR LIMIT=25] -->
|
|
||||||
<string name="user_add_profile_item_title">Restricted profile</string>
|
|
||||||
<!-- Title for add user confirmation dialog [CHAR LIMIT=30] -->
|
|
||||||
<string name="user_add_user_title">Add new user?</string>
|
|
||||||
<!-- Message for add user confirmation dialog - long version. [CHAR LIMIT=none] -->
|
|
||||||
<string name="user_add_user_message_long">You can share this device with other people by creating additional users. Each user has their own space, which they can customize with apps, wallpaper, and so on. Users can also adjust device settings like Wi\u2011Fi that affect everyone.\n\nWhen you add a new user, that person needs to set up their space.\n\nAny user can update apps for all other users. Accessibility settings and services may not transfer to the new user.</string>
|
|
||||||
<!-- Message for add user confirmation dialog - short version. [CHAR LIMIT=none] -->
|
|
||||||
<string name="user_add_user_message_short">When you add a new user, that person needs to set up their space.\n\nAny user can update apps for all other users. </string>
|
|
||||||
<!-- Title of dialog to setup a new user [CHAR LIMIT=30] -->
|
|
||||||
<string name="user_setup_dialog_title">Set up user now?</string>
|
|
||||||
<!-- Message in dialog to setup a new user after creation [CHAR LIMIT=none] -->
|
|
||||||
<string name="user_setup_dialog_message">Make sure the person is available to take the device and set up their space</string>
|
|
||||||
<!-- Message in dialog to setup a new restricted profile after creation [CHAR LIMIT=none] -->
|
|
||||||
<string name="user_setup_profile_dialog_message">Set up profile now?</string>
|
|
||||||
<!-- Button text to setup the new user now [CHAR LIMIT=25] -->
|
|
||||||
<string name="user_setup_button_setup_now">Set up now</string>
|
|
||||||
<!-- Button text to setup the new user later [CHAR LIMIT=25] -->
|
|
||||||
<string name="user_setup_button_setup_later">Not now</string>
|
|
||||||
<!-- Message to secondary users that only owner can manage users [CHAR LIMIT=none] -->
|
<!-- Message to secondary users that only owner can manage users [CHAR LIMIT=none] -->
|
||||||
<string name="user_cannot_manage_message" product="tablet">Only the tablet\u2019s owner can manage users.</string>
|
<string name="user_cannot_manage_message" product="tablet">Only the tablet\u2019s owner can manage users.</string>
|
||||||
<!-- Message to secondary users that only owner can manage users [CHAR LIMIT=none] -->
|
<!-- Message to secondary users that only owner can manage users [CHAR LIMIT=none] -->
|
||||||
@@ -6952,10 +6923,7 @@
|
|||||||
<string name="user_lockscreen_settings">Lock screen settings</string>
|
<string name="user_lockscreen_settings">Lock screen settings</string>
|
||||||
<!-- User settings item to allow creating new users from locks screen [CHAR LIMIT=50] -->
|
<!-- User settings item to allow creating new users from locks screen [CHAR LIMIT=50] -->
|
||||||
<string name="user_add_on_lockscreen_menu">Add users from lock screen</string>
|
<string name="user_add_on_lockscreen_menu">Add users from lock screen</string>
|
||||||
<!-- User details new user name [CHAR LIMIT=30] -->
|
|
||||||
<string name="user_new_user_name">New user</string>
|
|
||||||
<!-- User details new restricted profile name [CHAR LIMIT=30] -->
|
|
||||||
<string name="user_new_profile_name">New profile</string>
|
|
||||||
<!-- User (self) removal confirmation title [CHAR LIMIT=30] -->
|
<!-- User (self) removal confirmation title [CHAR LIMIT=30] -->
|
||||||
<string name="user_confirm_remove_self_title">Delete yourself?</string>
|
<string name="user_confirm_remove_self_title">Delete yourself?</string>
|
||||||
<!-- User removal confirmation title [CHAR LIMIT=25] -->
|
<!-- User removal confirmation title [CHAR LIMIT=25] -->
|
||||||
|
@@ -562,10 +562,10 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
final boolean longMessageDisplayed = preferences.getBoolean(
|
final boolean longMessageDisplayed = preferences.getBoolean(
|
||||||
KEY_ADD_USER_LONG_MESSAGE_DISPLAYED, false);
|
KEY_ADD_USER_LONG_MESSAGE_DISPLAYED, false);
|
||||||
final int messageResId = longMessageDisplayed
|
final int messageResId = longMessageDisplayed
|
||||||
? R.string.user_add_user_message_short
|
? com.android.settingslib.R.string.user_add_user_message_short
|
||||||
: R.string.user_add_user_message_long;
|
: com.android.settingslib.R.string.user_add_user_message_long;
|
||||||
Dialog dlg = new AlertDialog.Builder(context)
|
Dialog dlg = new AlertDialog.Builder(context)
|
||||||
.setTitle(R.string.user_add_user_title)
|
.setTitle(com.android.settingslib.R.string.user_add_user_title)
|
||||||
.setMessage(messageResId)
|
.setMessage(messageResId)
|
||||||
.setPositiveButton(android.R.string.ok,
|
.setPositiveButton(android.R.string.ok,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@@ -584,21 +584,25 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
case DIALOG_SETUP_USER: {
|
case DIALOG_SETUP_USER: {
|
||||||
Dialog dlg = new AlertDialog.Builder(context)
|
Dialog dlg = new AlertDialog.Builder(context)
|
||||||
.setTitle(R.string.user_setup_dialog_title)
|
.setTitle(com.android.settingslib.R.string.user_setup_dialog_title)
|
||||||
.setMessage(R.string.user_setup_dialog_message)
|
.setMessage(com.android.settingslib.R.string.user_setup_dialog_message)
|
||||||
.setPositiveButton(R.string.user_setup_button_setup_now,
|
.setPositiveButton(
|
||||||
|
com.android.settingslib.R.string.user_setup_button_setup_now,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
switchUserNow(mAddedUserId);
|
switchUserNow(mAddedUserId);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.user_setup_button_setup_later, null)
|
.setNegativeButton(
|
||||||
|
com.android.settingslib.R.string.user_setup_button_setup_later,
|
||||||
|
null)
|
||||||
.create();
|
.create();
|
||||||
return dlg;
|
return dlg;
|
||||||
}
|
}
|
||||||
case DIALOG_SETUP_PROFILE: {
|
case DIALOG_SETUP_PROFILE: {
|
||||||
Dialog dlg = new AlertDialog.Builder(context)
|
Dialog dlg = new AlertDialog.Builder(context)
|
||||||
.setMessage(R.string.user_setup_profile_dialog_message)
|
.setMessage(
|
||||||
|
com.android.settingslib.R.string.user_setup_profile_dialog_message)
|
||||||
.setPositiveButton(android.R.string.ok,
|
.setPositiveButton(android.R.string.ok,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
@@ -612,11 +616,15 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
case DIALOG_CHOOSE_USER_TYPE: {
|
case DIALOG_CHOOSE_USER_TYPE: {
|
||||||
List<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
|
List<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
|
||||||
HashMap<String, String> addUserItem = new HashMap<String, String>();
|
HashMap<String, String> addUserItem = new HashMap<String, String>();
|
||||||
addUserItem.put(KEY_TITLE, getString(R.string.user_add_user_item_title));
|
addUserItem.put(KEY_TITLE, getString(
|
||||||
addUserItem.put(KEY_SUMMARY, getString(R.string.user_add_user_item_summary));
|
com.android.settingslib.R.string.user_add_user_item_title));
|
||||||
|
addUserItem.put(KEY_SUMMARY, getString(
|
||||||
|
com.android.settingslib.R.string.user_add_user_item_summary));
|
||||||
HashMap<String, String> addProfileItem = new HashMap<String, String>();
|
HashMap<String, String> addProfileItem = new HashMap<String, String>();
|
||||||
addProfileItem.put(KEY_TITLE, getString(R.string.user_add_profile_item_title));
|
addProfileItem.put(KEY_TITLE, getString(
|
||||||
addProfileItem.put(KEY_SUMMARY, getString(R.string.user_add_profile_item_summary));
|
com.android.settingslib.R.string.user_add_profile_item_title));
|
||||||
|
addProfileItem.put(KEY_SUMMARY, getString(
|
||||||
|
com.android.settingslib.R.string.user_add_profile_item_summary));
|
||||||
data.add(addUserItem);
|
data.add(addUserItem);
|
||||||
data.add(addProfileItem);
|
data.add(addProfileItem);
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
@@ -624,7 +632,7 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
data, R.layout.two_line_list_item,
|
data, R.layout.two_line_list_item,
|
||||||
new String[]{KEY_TITLE, KEY_SUMMARY},
|
new String[]{KEY_TITLE, KEY_SUMMARY},
|
||||||
new int[]{R.id.title, R.id.summary});
|
new int[]{R.id.title, R.id.summary});
|
||||||
builder.setTitle(R.string.user_add_user_type_title);
|
builder.setTitle(com.android.settingslib.R.string.user_add_user_type_title);
|
||||||
builder.setAdapter(adapter,
|
builder.setAdapter(adapter,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -638,8 +646,8 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
case DIALOG_NEED_LOCKSCREEN: {
|
case DIALOG_NEED_LOCKSCREEN: {
|
||||||
Dialog dlg = new AlertDialog.Builder(context)
|
Dialog dlg = new AlertDialog.Builder(context)
|
||||||
.setMessage(R.string.user_need_lock_message)
|
.setMessage(com.android.settingslib.R.string.user_need_lock_message)
|
||||||
.setPositiveButton(R.string.user_set_lock_button,
|
.setPositiveButton(com.android.settingslib.R.string.user_set_lock_button,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
@@ -672,7 +680,7 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
this,
|
this,
|
||||||
Utils.getUserIcon(getPrefContext(), mUserManager, info),
|
Utils.getUserIcon(getPrefContext(), mUserManager, info),
|
||||||
info.name,
|
info.name,
|
||||||
getString(R.string.profile_info_settings_title),
|
getString(com.android.settingslib.R.string.profile_info_settings_title),
|
||||||
new EditUserInfoController.OnContentChangedCallback() {
|
new EditUserInfoController.OnContentChangedCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onPhotoChanged(UserHandle user, Drawable photo) {
|
public void onPhotoChanged(UserHandle user, Drawable photo) {
|
||||||
@@ -699,7 +707,8 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
synchronized (mUserLock) {
|
synchronized (mUserLock) {
|
||||||
mPendingUserIcon = UserIcons.getDefaultUserIcon(getPrefContext().getResources(),
|
mPendingUserIcon = UserIcons.getDefaultUserIcon(getPrefContext().getResources(),
|
||||||
new Random(System.currentTimeMillis()).nextInt(8), false);
|
new Random(System.currentTimeMillis()).nextInt(8), false);
|
||||||
mPendingUserName = getString(R.string.user_new_user_name);
|
mPendingUserName = getString(
|
||||||
|
com.android.settingslib.R.string.user_new_user_name);
|
||||||
}
|
}
|
||||||
return buildAddUserProfileEditorDialog(USER_TYPE_USER);
|
return buildAddUserProfileEditorDialog(USER_TYPE_USER);
|
||||||
}
|
}
|
||||||
@@ -707,7 +716,8 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
synchronized (mUserLock) {
|
synchronized (mUserLock) {
|
||||||
mPendingUserIcon = UserIcons.getDefaultUserIcon(getPrefContext().getResources(),
|
mPendingUserIcon = UserIcons.getDefaultUserIcon(getPrefContext().getResources(),
|
||||||
new Random(System.currentTimeMillis()).nextInt(8), false);
|
new Random(System.currentTimeMillis()).nextInt(8), false);
|
||||||
mPendingUserName = getString(R.string.user_new_profile_name);
|
mPendingUserName = getString(
|
||||||
|
com.android.settingslib.R.string.user_new_profile_name);
|
||||||
}
|
}
|
||||||
return buildAddUserProfileEditorDialog(USER_TYPE_RESTRICTED_PROFILE);
|
return buildAddUserProfileEditorDialog(USER_TYPE_RESTRICTED_PROFILE);
|
||||||
}
|
}
|
||||||
@@ -724,8 +734,8 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
mPendingUserIcon,
|
mPendingUserIcon,
|
||||||
mPendingUserName,
|
mPendingUserName,
|
||||||
getString(userType == USER_TYPE_USER
|
getString(userType == USER_TYPE_USER
|
||||||
? R.string.user_info_settings_title
|
? com.android.settingslib.R.string.user_info_settings_title
|
||||||
: R.string.profile_info_settings_title),
|
: com.android.settingslib.R.string.profile_info_settings_title),
|
||||||
new EditUserInfoController.OnContentChangedCallback() {
|
new EditUserInfoController.OnContentChangedCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onPhotoChanged(UserHandle user, Drawable photo) {
|
public void onPhotoChanged(UserHandle user, Drawable photo) {
|
||||||
|
Reference in New Issue
Block a user