Merge "Add user switcher related strings to SettingsLib." into rvc-dev am: 66041721d7 am: 71a605714f
Change-Id: I5c6fab6d4e9896fb7182603b67b901822065574e
This commit is contained in:
@@ -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>
|
<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] -->
|
<!-- User settings dialog button to set screen lock [CHAR LIMIT=25] -->
|
||||||
<string name="user_set_lock_button">Set lock</string>
|
<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>
|
</resources>
|
||||||
|
|||||||
@@ -1151,15 +1151,6 @@
|
|||||||
<!-- Name for a freshly added user [CHAR LIMIT=30] -->
|
<!-- Name for a freshly added user [CHAR LIMIT=30] -->
|
||||||
<string name="user_new_user_name">New user</string>
|
<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] -->
|
<!-- Title of the confirmation dialog when exiting guest session [CHAR LIMIT=NONE] -->
|
||||||
<string name="guest_exit_guest_dialog_title">Remove guest?</string>
|
<string name="guest_exit_guest_dialog_title">Remove guest?</string>
|
||||||
|
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ public class UserSwitcherController implements Dumpable {
|
|||||||
if (record.isGuest && record.info == null) {
|
if (record.isGuest && record.info == null) {
|
||||||
// No guest user. Create one.
|
// No guest user. Create one.
|
||||||
UserInfo guest = mUserManager.createGuest(
|
UserInfo guest = mUserManager.createGuest(
|
||||||
mContext, mContext.getString(R.string.guest_nickname));
|
mContext, mContext.getString(com.android.settingslib.R.string.guest_nickname));
|
||||||
if (guest == null) {
|
if (guest == null) {
|
||||||
// Couldn't create guest, most likely because there already exists one, we just
|
// Couldn't create guest, most likely because there already exists one, we just
|
||||||
// haven't reloaded the user list yet.
|
// haven't reloaded the user list yet.
|
||||||
@@ -583,7 +583,7 @@ public class UserSwitcherController implements Dumpable {
|
|||||||
if (mUsers.isEmpty()) return null;
|
if (mUsers.isEmpty()) return null;
|
||||||
UserRecord item = mUsers.get(0);
|
UserRecord item = mUsers.get(0);
|
||||||
if (item == null || item.info == null) return null;
|
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;
|
return item.info.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -671,10 +671,11 @@ public class UserSwitcherController implements Dumpable {
|
|||||||
public String getName(Context context, UserRecord item) {
|
public String getName(Context context, UserRecord item) {
|
||||||
if (item.isGuest) {
|
if (item.isGuest) {
|
||||||
if (item.isCurrent) {
|
if (item.isCurrent) {
|
||||||
return context.getString(R.string.guest_exit_guest);
|
return context.getString(com.android.settingslib.R.string.guest_exit_guest);
|
||||||
} else {
|
} else {
|
||||||
return context.getString(
|
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) {
|
} else if (item.isAddUser) {
|
||||||
return context.getString(R.string.user_add_user);
|
return context.getString(R.string.user_add_user);
|
||||||
|
|||||||
Reference in New Issue
Block a user