Merge "Move strings related to user creation to SettingsLib." into rvc-dev
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0475597..a5bbfa7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -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>
     <!-- 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>
-    <!-- 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]-->
     <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] -->
     <string name="Accounts_settings_title">Accounts</string>
     <!-- Main Settings screen setting option title for the item to take you to the location screen -->
@@ -6893,10 +6891,7 @@
     <string name="user_add_user_menu">Add user</string>
     <!-- User settings summary for a restricted profile [CHAR LIMIT=50] -->
     <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] -->
     <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] -->
@@ -6909,35 +6904,11 @@
     <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]-->
     <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] -->
     <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>
     <!-- Message to secondary users that only owner can manage users [CHAR LIMIT=none] -->
     <string name="user_cannot_manage_message" product="default">Only the phone\u2019s owner can manage users.</string>
@@ -6950,10 +6921,7 @@
     <string name="user_lockscreen_settings">Lock screen settings</string>
     <!-- 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>
-    <!-- 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] -->
     <string name="user_confirm_remove_self_title">Delete yourself?</string>
     <!-- User removal confirmation title [CHAR LIMIT=25] -->
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index 6397af8..38ef199 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -562,10 +562,10 @@
                 final boolean longMessageDisplayed = preferences.getBoolean(
                         KEY_ADD_USER_LONG_MESSAGE_DISPLAYED, false);
                 final int messageResId = longMessageDisplayed
-                        ? R.string.user_add_user_message_short
-                        : R.string.user_add_user_message_long;
+                        ? com.android.settingslib.R.string.user_add_user_message_short
+                        : com.android.settingslib.R.string.user_add_user_message_long;
                 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)
                         .setPositiveButton(android.R.string.ok,
                                 new DialogInterface.OnClickListener() {
@@ -584,21 +584,25 @@
             }
             case DIALOG_SETUP_USER: {
                 Dialog dlg = new AlertDialog.Builder(context)
-                        .setTitle(R.string.user_setup_dialog_title)
-                        .setMessage(R.string.user_setup_dialog_message)
-                        .setPositiveButton(R.string.user_setup_button_setup_now,
+                        .setTitle(com.android.settingslib.R.string.user_setup_dialog_title)
+                        .setMessage(com.android.settingslib.R.string.user_setup_dialog_message)
+                        .setPositiveButton(
+                                com.android.settingslib.R.string.user_setup_button_setup_now,
                                 new DialogInterface.OnClickListener() {
                                     public void onClick(DialogInterface dialog, int which) {
                                         switchUserNow(mAddedUserId);
                                     }
                                 })
-                        .setNegativeButton(R.string.user_setup_button_setup_later, null)
+                        .setNegativeButton(
+                                com.android.settingslib.R.string.user_setup_button_setup_later,
+                                null)
                         .create();
                 return dlg;
             }
             case DIALOG_SETUP_PROFILE: {
                 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,
                                 new DialogInterface.OnClickListener() {
                                     public void onClick(DialogInterface dialog, int which) {
@@ -612,11 +616,15 @@
             case DIALOG_CHOOSE_USER_TYPE: {
                 List<HashMap<String, String>> data = new ArrayList<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_SUMMARY, getString(R.string.user_add_user_item_summary));
+                addUserItem.put(KEY_TITLE, getString(
+                        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>();
-                addProfileItem.put(KEY_TITLE, getString(R.string.user_add_profile_item_title));
-                addProfileItem.put(KEY_SUMMARY, getString(R.string.user_add_profile_item_summary));
+                addProfileItem.put(KEY_TITLE, getString(
+                        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(addProfileItem);
                 AlertDialog.Builder builder = new AlertDialog.Builder(context);
@@ -624,7 +632,7 @@
                         data, R.layout.two_line_list_item,
                         new String[]{KEY_TITLE, KEY_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,
                         new DialogInterface.OnClickListener() {
                             @Override
@@ -638,8 +646,8 @@
             }
             case DIALOG_NEED_LOCKSCREEN: {
                 Dialog dlg = new AlertDialog.Builder(context)
-                        .setMessage(R.string.user_need_lock_message)
-                        .setPositiveButton(R.string.user_set_lock_button,
+                        .setMessage(com.android.settingslib.R.string.user_need_lock_message)
+                        .setPositiveButton(com.android.settingslib.R.string.user_set_lock_button,
                                 new DialogInterface.OnClickListener() {
                                     @Override
                                     public void onClick(DialogInterface dialog, int which) {
@@ -672,7 +680,7 @@
                         this,
                         Utils.getUserIcon(getPrefContext(), mUserManager, info),
                         info.name,
-                        getString(R.string.profile_info_settings_title),
+                        getString(com.android.settingslib.R.string.profile_info_settings_title),
                         new EditUserInfoController.OnContentChangedCallback() {
                             @Override
                             public void onPhotoChanged(UserHandle user, Drawable photo) {
@@ -699,7 +707,8 @@
                 synchronized (mUserLock) {
                     mPendingUserIcon = UserIcons.getDefaultUserIcon(getPrefContext().getResources(),
                             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);
             }
@@ -707,7 +716,8 @@
                 synchronized (mUserLock) {
                     mPendingUserIcon = UserIcons.getDefaultUserIcon(getPrefContext().getResources(),
                             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);
             }
@@ -724,8 +734,8 @@
                     mPendingUserIcon,
                     mPendingUserName,
                     getString(userType == USER_TYPE_USER
-                            ? R.string.user_info_settings_title
-                            : R.string.profile_info_settings_title),
+                            ? com.android.settingslib.R.string.user_info_settings_title
+                            : com.android.settingslib.R.string.profile_info_settings_title),
                     new EditUserInfoController.OnContentChangedCallback() {
                         @Override
                         public void onPhotoChanged(UserHandle user, Drawable photo) {