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

@@ -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 {