Merge "Singularization of duplicated multi user strings." into tm-dev

This commit is contained in:
Yasin Kilicdere
2022-03-24 12:03:29 +00:00
committed by Android (Google) Code Review
5 changed files with 15 additions and 29 deletions

View File

@@ -1586,15 +1586,6 @@
<!-- Content of the dialog shown when the user only has one attempt left to provide the work lock password before the work profile is removed. [CHAR LIMIT=NONE] --> <!-- Content of the dialog shown when the user only has one attempt left to provide the work lock password before the work profile is removed. [CHAR LIMIT=NONE] -->
<string name="lock_last_password_attempt_before_wipe_profile">If you enter an incorrect password on the next attempt, your work profile and its data will be deleted</string> <string name="lock_last_password_attempt_before_wipe_profile">If you enter an incorrect password on the next attempt, your work profile and its data will be deleted</string>
<!-- Content of the dialog shown when the user has failed to provide the device lock too many times and the device is wiped. [CHAR LIMIT=NONE] -->
<string name="lock_failed_attempts_now_wiping_device">Too many incorrect attempts. This device\'s data will be deleted.</string>
<!-- Content of the dialog shown when the user has failed to provide the user lock too many times and the user is removed. [CHAR LIMIT=NONE] -->
<string name="lock_failed_attempts_now_wiping_user">Too many incorrect attempts. This user will be deleted.</string>
<!-- Content of the dialog shown when the user has failed to provide the work lock too many times and the work profile is removed. [CHAR LIMIT=NONE] -->
<string name="lock_failed_attempts_now_wiping_profile">Too many incorrect attempts. This work profile and its data will be deleted.</string>
<!-- Button label to dismiss the dialog telling the user the work profile has been wiped. [CHAR LIMIT=40] -->
<string name="lock_failed_attempts_now_wiping_dialog_dismiss">Dismiss</string>
<!-- Hint shown in dialog screen when password is too short --> <!-- Hint shown in dialog screen when password is too short -->
<plurals name="lockpassword_password_too_short"> <plurals name="lockpassword_password_too_short">
<item quantity="one">Must contain at least <xliff:g id="count" example="1">%d</xliff:g> character</item> <item quantity="one">Must contain at least <xliff:g id="count" example="1">%d</xliff:g> character</item>
@@ -7640,8 +7631,6 @@
<string name="user_list_title">Users &amp; profiles</string> <string name="user_list_title">Users &amp; profiles</string>
<!-- User settings add user or restricted profile menu [CHAR LIMIT=35] --> <!-- User settings add user or restricted profile menu [CHAR LIMIT=35] -->
<string name="user_add_user_or_profile_menu">Add user or profile</string> <string name="user_add_user_or_profile_menu">Add user or profile</string>
<!-- User settings add user menu [CHAR LIMIT=35] -->
<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>
@@ -7701,12 +7690,6 @@
<!-- Delete button text [CHAR LIMIT=25] --> <!-- Delete button text [CHAR LIMIT=25] -->
<string name="user_delete_button">Delete</string> <string name="user_delete_button">Delete</string>
<!-- TODO: Remove it once the same entry in SettingsLib is translated. --> <!-- TODO: Remove it once the same entry in SettingsLib is translated. -->
<!-- Title for Guest user [CHAR LIMIT=35] -->
<string name="user_guest">Guest</string>
<!-- Label for item to exit guest mode [CHAR LIMIT=35] -->
<string name="user_exit_guest_title">Remove guest</string>
<!-- Title of dialog to user to confirm exiting guest. [CHAR LIMIT=50] -->
<string name="user_exit_guest_confirm_title">Remove guest?</string>
<!-- Message to user to confirm exiting guest. [CHAR LIMIT=none] --> <!-- Message to user to confirm exiting guest. [CHAR LIMIT=none] -->
<string name="user_exit_guest_confirm_message">All apps and data in this session will be deleted.</string> <string name="user_exit_guest_confirm_message">All apps and data in this session will be deleted.</string>
<!-- Label for button in confirmation dialog when exiting guest session [CHAR LIMIT=35] --> <!-- Label for button in confirmation dialog when exiting guest session [CHAR LIMIT=35] -->

View File

@@ -255,7 +255,8 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
// Device, profile, or secondary user is wiped // Device, profile, or secondary user is wiped
final String message = getWipeMessage(userType); final String message = getWipeMessage(userType);
LastTryDialog.show(fragmentManager, null /* title */, message, LastTryDialog.show(fragmentManager, null /* title */, message,
R.string.lock_failed_attempts_now_wiping_dialog_dismiss, true /* dismiss */); com.android.settingslib.R.string.failed_attempts_now_wiping_dialog_dismiss,
true /* dismiss */);
} }
} }
@@ -277,13 +278,15 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
private String getWipeMessage(int userType) { private String getWipeMessage(int userType) {
switch (userType) { switch (userType) {
case USER_TYPE_PRIMARY: case USER_TYPE_PRIMARY:
return getString(R.string.lock_failed_attempts_now_wiping_device); return getString(com.android.settingslib
.R.string.failed_attempts_now_wiping_device);
case USER_TYPE_MANAGED_PROFILE: case USER_TYPE_MANAGED_PROFILE:
return mDevicePolicyManager.getResources().getString( return mDevicePolicyManager.getResources().getString(
WORK_PROFILE_LOCK_ATTEMPTS_FAILED, WORK_PROFILE_LOCK_ATTEMPTS_FAILED,
() -> getString(R.string.lock_failed_attempts_now_wiping_profile)); () -> getString(com.android.settingslib
.R.string.failed_attempts_now_wiping_profile));
case USER_TYPE_SECONDARY: case USER_TYPE_SECONDARY:
return getString(R.string.lock_failed_attempts_now_wiping_user); return getString(com.android.settingslib.R.string.failed_attempts_now_wiping_user);
default: default:
throw new IllegalArgumentException("Unrecognized user type:" + userType); throw new IllegalArgumentException("Unrecognized user type:" + userType);
} }

View File

@@ -297,7 +297,7 @@ public class UserDetailsSettings extends SettingsPreferenceFragment
!mDefaultGuestRestrictions.getBoolean(UserManager.DISALLOW_OUTGOING_CALLS)); !mDefaultGuestRestrictions.getBoolean(UserManager.DISALLOW_OUTGOING_CALLS));
mRemoveUserPref.setTitle(mGuestUserAutoCreated mRemoveUserPref.setTitle(mGuestUserAutoCreated
? com.android.settingslib.R.string.guest_reset_guest ? com.android.settingslib.R.string.guest_reset_guest
: R.string.user_exit_guest_title); : com.android.settingslib.R.string.guest_exit_guest);
if (mGuestUserAutoCreated) { if (mGuestUserAutoCreated) {
mRemoveUserPref.setEnabled((mUserInfo.flags & UserInfo.FLAG_INITIALIZED) != 0); mRemoveUserPref.setEnabled((mUserInfo.flags & UserInfo.FLAG_INITIALIZED) != 0);
} }

View File

@@ -310,7 +310,7 @@ public class UserSettings extends SettingsPreferenceFragment
mAddUser = findPreference(KEY_ADD_USER); mAddUser = findPreference(KEY_ADD_USER);
if (!mUserCaps.mCanAddRestrictedProfile) { if (!mUserCaps.mCanAddRestrictedProfile) {
// Label should only mention adding a "user", not a "profile" // Label should only mention adding a "user", not a "profile"
mAddUser.setTitle(R.string.user_add_user_menu); mAddUser.setTitle(com.android.settingslib.R.string.user_add_user);
} }
mAddUser.setOnPreferenceClickListener(this); mAddUser.setOnPreferenceClickListener(this);
@@ -425,9 +425,9 @@ public class UserSettings extends SettingsPreferenceFragment
if (isCurrentUserGuest()) { if (isCurrentUserGuest()) {
// No need to load profile information // No need to load profile information
mMePreference.setIcon(getEncircledDefaultIcon()); mMePreference.setIcon(getEncircledDefaultIcon());
mMePreference.setTitle( mMePreference.setTitle(mGuestUserAutoCreated
mGuestUserAutoCreated ? com.android.settingslib.R.string.guest_reset_guest ? com.android.settingslib.R.string.guest_reset_guest
: R.string.user_exit_guest_title); : com.android.settingslib.R.string.guest_exit_guest);
mMePreference.setSelectable(true); mMePreference.setSelectable(true);
// removing a guest will result in switching back to the admin user // removing a guest will result in switching back to the admin user
mMePreference.setEnabled(canSwitchUserNow()); mMePreference.setEnabled(canSwitchUserNow());
@@ -704,7 +704,7 @@ public class UserSettings extends SettingsPreferenceFragment
} }
case DIALOG_CONFIRM_EXIT_GUEST: { case DIALOG_CONFIRM_EXIT_GUEST: {
Dialog dlg = new AlertDialog.Builder(context) Dialog dlg = new AlertDialog.Builder(context)
.setTitle(R.string.user_exit_guest_confirm_title) .setTitle(com.android.settingslib.R.string.guest_remove_guest_dialog_title)
.setMessage(R.string.user_exit_guest_confirm_message) .setMessage(R.string.user_exit_guest_confirm_message)
.setPositiveButton(R.string.user_exit_guest_dialog_remove, .setPositiveButton(R.string.user_exit_guest_dialog_remove,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@@ -1157,7 +1157,7 @@ public class UserSettings extends SettingsPreferenceFragment
mAddGuest.setIcon(centerAndTint(icon)); mAddGuest.setIcon(centerAndTint(icon));
mAddGuest.setSelectable(true); mAddGuest.setSelectable(true);
if (mGuestUserAutoCreated && mGuestCreationScheduled.get()) { if (mGuestUserAutoCreated && mGuestCreationScheduled.get()) {
mAddGuest.setTitle(com.android.settingslib.R.string.user_guest); mAddGuest.setTitle(com.android.internal.R.string.guest_name);
mAddGuest.setSummary(R.string.guest_resetting); mAddGuest.setSummary(R.string.guest_resetting);
mAddGuest.setEnabled(false); mAddGuest.setEnabled(false);
} else { } else {

View File

@@ -373,7 +373,7 @@ public class UserDetailsSettingsTest {
mFragment.initialize(mActivity, mArguments); mFragment.initialize(mActivity, mArguments);
verify(mRemoveUserPref).setOnPreferenceClickListener(mFragment); verify(mRemoveUserPref).setOnPreferenceClickListener(mFragment);
verify(mRemoveUserPref).setTitle(R.string.user_exit_guest_title); verify(mRemoveUserPref).setTitle(com.android.settingslib.R.string.guest_exit_guest);
verify(mFragment, never()).removePreference(KEY_REMOVE_USER); verify(mFragment, never()).removePreference(KEY_REMOVE_USER);
} }