Revert "Remove duplicate strings."

Revert submission 19748582-settings_yesno

Reason for revert: Common strings in English could be translated into different strings in other languages.

Reverted changes: /q/submissionid:19748582-settings_yesno

Bug: 272603842
Test: build and open Settings app
Test: atest SettingsRoboTests
Change-Id: Iaad301c5513478fb95e40987ea3ccb4f923d71fa
This commit is contained in:
Lifu Tang
2023-03-15 21:37:02 +00:00
committed by Kweku Adams
parent 36d78f8fe0
commit caa1b51ef2
70 changed files with 221 additions and 113 deletions

View File

@@ -54,7 +54,8 @@ public class BackupDataPreferenceController extends BasePreferenceController {
public CharSequence getSummary() {
if (!mPSCD.isBackupGray()) {
return mPSCD.isBackupEnabled()
? mContext.getText(R.string.on) : mContext.getText(R.string.off);
? mContext.getText(R.string.accessibility_feature_state_on)
: mContext.getText(R.string.accessibility_feature_state_off);
}
return null;
}

View File

@@ -58,7 +58,8 @@ public class BackupSettingsHelper {
UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
if (userManager.getUserProfiles().size() == 1) {
try {
int resId = mBackupManager.isBackupEnabled() ? R.string.on : R.string.off;
int resId = mBackupManager.isBackupEnabled()
? R.string.backup_summary_state_on : R.string.backup_summary_state_off;
return mContext.getText(resId).toString();
} catch (RemoteException e) {
Log.e(TAG, "Error getting isBackupEnabled", e);