Merge "Add user switcher related strings to SettingsLib." into rvc-dev
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index e61d70f..9112602 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -1352,5 +1352,14 @@
<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>
+ <!-- Label for switching to other user in the user switcher [CHAR LIMIT=35] -->
+ <string name="user_switch_to_user">Switch to <xliff:g id="user_name" example="John Doe">%s</xliff:g></string>
+
+ <!-- Label for adding a new guest in the user switcher [CHAR LIMIT=35] -->
+ <string name="guest_new_guest">Add guest</string>
+ <!-- Label for exiting and removing the guest session in the user switcher [CHAR LIMIT=35] -->
+ <string name="guest_exit_guest">Remove guest</string>
+ <!-- Name for the guest user [CHAR LIMIT=35] -->
+ <string name="guest_nickname">Guest</string>
</resources>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index b779130..d17b81d 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -1151,15 +1151,6 @@
<!-- Name for a freshly added user [CHAR LIMIT=30] -->
<string name="user_new_user_name">New user</string>
- <!-- Name for the guest user [CHAR LIMIT=35] -->
- <string name="guest_nickname">Guest</string>
-
- <!-- Label for adding a new guest in the user switcher [CHAR LIMIT=35] -->
- <string name="guest_new_guest">Add guest</string>
-
- <!-- Label for exiting and removing the guest session in the user switcher [CHAR LIMIT=35] -->
- <string name="guest_exit_guest">Remove guest</string>
-
<!-- Title of the confirmation dialog when exiting guest session [CHAR LIMIT=NONE] -->
<string name="guest_exit_guest_dialog_title">Remove guest?</string>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
index 9ce31d0..69eaaa4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
@@ -360,7 +360,7 @@
if (record.isGuest && record.info == null) {
// No guest user. Create one.
UserInfo guest = mUserManager.createGuest(
- mContext, mContext.getString(R.string.guest_nickname));
+ mContext, mContext.getString(com.android.settingslib.R.string.guest_nickname));
if (guest == null) {
// Couldn't create guest, most likely because there already exists one, we just
// haven't reloaded the user list yet.
@@ -583,7 +583,7 @@
if (mUsers.isEmpty()) return null;
UserRecord item = mUsers.get(0);
if (item == null || item.info == null) return null;
- if (item.isGuest) return context.getString(R.string.guest_nickname);
+ if (item.isGuest) return context.getString(com.android.settingslib.R.string.guest_nickname);
return item.info.name;
}
@@ -671,10 +671,11 @@
public String getName(Context context, UserRecord item) {
if (item.isGuest) {
if (item.isCurrent) {
- return context.getString(R.string.guest_exit_guest);
+ return context.getString(com.android.settingslib.R.string.guest_exit_guest);
} else {
return context.getString(
- item.info == null ? R.string.guest_new_guest : R.string.guest_nickname);
+ item.info == null ? com.android.settingslib.R.string.guest_new_guest
+ : com.android.settingslib.R.string.guest_nickname);
}
} else if (item.isAddUser) {
return context.getString(R.string.user_add_user);