Singularization of duplicated multi user strings.

Many multi-user strings were duplicated between SettingsLib, Settings,
System UI and Car projects. This CL removes those duplicates.

List of singularized strings: "Guest", "Remove guest", "Add user",
"Remove guest?", "Too many incorrect attempts...."

Bug: 191386817
Test: NA
Change-Id: I8d9629a1a9628cab9f049df84f706bd04ee75cc2
This commit is contained in:
Yasin Kilicdere
2022-03-17 23:08:52 +00:00
parent a12da0a8e8
commit 4564bce03c
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] -->
<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 -->
<plurals name="lockpassword_password_too_short">
<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>
<!-- User settings add user or restricted profile menu [CHAR LIMIT=35] -->
<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] -->
<string name="user_summary_restricted_profile">Restricted profile</string>
@@ -7702,12 +7691,6 @@
<!-- Delete button text [CHAR LIMIT=25] -->
<string name="user_delete_button">Delete</string>
<!-- 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] -->
<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] -->

View File

@@ -255,7 +255,8 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
// Device, profile, or secondary user is wiped
final String message = getWipeMessage(userType);
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) {
switch (userType) {
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:
return mDevicePolicyManager.getResources().getString(
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:
return getString(R.string.lock_failed_attempts_now_wiping_user);
return getString(com.android.settingslib.R.string.failed_attempts_now_wiping_user);
default:
throw new IllegalArgumentException("Unrecognized user type:" + userType);
}

View File

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

View File

@@ -310,7 +310,7 @@ public class UserSettings extends SettingsPreferenceFragment
mAddUser = findPreference(KEY_ADD_USER);
if (!mUserCaps.mCanAddRestrictedProfile) {
// 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);
@@ -425,9 +425,9 @@ public class UserSettings extends SettingsPreferenceFragment
if (isCurrentUserGuest()) {
// No need to load profile information
mMePreference.setIcon(getEncircledDefaultIcon());
mMePreference.setTitle(
mGuestUserAutoCreated ? com.android.settingslib.R.string.guest_reset_guest
: R.string.user_exit_guest_title);
mMePreference.setTitle(mGuestUserAutoCreated
? com.android.settingslib.R.string.guest_reset_guest
: com.android.settingslib.R.string.guest_exit_guest);
mMePreference.setSelectable(true);
// removing a guest will result in switching back to the admin user
mMePreference.setEnabled(canSwitchUserNow());
@@ -704,7 +704,7 @@ public class UserSettings extends SettingsPreferenceFragment
}
case DIALOG_CONFIRM_EXIT_GUEST: {
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)
.setPositiveButton(R.string.user_exit_guest_dialog_remove,
new DialogInterface.OnClickListener() {
@@ -1157,7 +1157,7 @@ public class UserSettings extends SettingsPreferenceFragment
mAddGuest.setIcon(centerAndTint(icon));
mAddGuest.setSelectable(true);
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.setEnabled(false);
} else {

View File

@@ -373,7 +373,7 @@ public class UserDetailsSettingsTest {
mFragment.initialize(mActivity, mArguments);
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);
}