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

@@ -27,8 +27,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:textOff="@string/off"
android:textOn="@string/on"
android:textOff="@string/tare_off"
android:textOn="@string/tare_on"
android:showText="true"
android:background="?android:attr/colorBackground" />
<TextView

View File

@@ -26,10 +26,6 @@
<string name="deny">Deny</string>
<!-- Used in confirmation dialogs as the action that the user will tap to turn on the feature. [CHAR LIMIT=40]-->
<string name="confirmation_turn_on">Turn on</string>
<!-- State enabled. [CHAR LIMIT=NONE] -->
<string name="on">On</string>
<!-- State is disabled. [CHAR LIMIT=NONE] -->
<string name="off">Off</string>
<!-- Device Info screen. Used for a status item's value when the proper value is not known -->
<string name="device_info_default">Unknown</string>
@@ -567,6 +563,8 @@
<string name="location_settings_title">Location</string>
<!-- Used in the location settings to control turning on/off the feature entirely [CHAR LIMIT=60] -->
<string name="location_settings_primary_switch_title">Use location</string>
<!-- Summary for Location settings when location is off [CHAR LIMIT=NONE] -->
<string name="location_settings_summary_location_off">Off</string>
<!-- Summary for Location settings when location is on, explaining how many apps have location permission [CHAR LIMIT=NONE]-->
<string name="location_settings_summary_location_on">{count, plural,
=1 {On - # app has access to location}
@@ -1601,6 +1599,8 @@
<string name="android_beam_settings_title">Android Beam</string>
<!-- Used to describe the on state of the Android Beam feature [CHAR LIMIT=NONE] -->
<string name="android_beam_on_summary">Ready to transmit app content via NFC</string>
<!-- Used to describe the off state of the Android Beam feature [CHAR LIMIT=NONE] -->
<string name="android_beam_off_summary">Off</string>
<!-- Used to describe the enabled state of the Android Beam feature when NFC, which it relies on, is turned off [CHAR LIMIT=NONE] -->
<string name="nfc_disabled_summary">Unavailable because NFC is turned off</string>
<!-- Explanation of the Android Beam feature in the Android Beam settings panel. The use of "beam" here is as a verb and not considered trademarked. [CHAR LIMIT=NONE] -->
@@ -2200,6 +2200,8 @@
<string name="emergency_address_summary">Used as your location when you make an emergency call over Wi\u2011Fi</string>
<!-- Message of private dns that provides a help link. [CHAR LIMIT=NONE] -->
<string name="private_dns_help_message"><annotation id="url">Learn more</annotation> about Private DNS features</string>
<!-- Message to display when private dns is on. [CHAR LIMIT=10] -->
<string name="private_dns_mode_on">On</string>
<!-- Message to display when wifi calling needs activation [CHAR LIMIT=NONE] -->
<string name="wifi_calling_settings_activation_instructions">Activate Wi\u2011Fi Calling</string>
@@ -2233,6 +2235,10 @@
<string name="display_settings">Display</string>
<!-- Sound & display settings screen, accelerometer-based rotation check box label -->
<string name="accelerometer_title">Auto-rotate screen</string>
<!-- Sound & display settings screen, locked rotation check box label [CHAR LIMIT=30] -->
<string name="auto_rotate_option_off">Off</string>
<!-- Sound & display settings screen, accelerometer-based rotation check box label [CHAR LIMIT=30] -->
<string name="auto_rotate_option_on">On</string>
<!-- Sound & display settings screen, face-based rotation check box label [CHAR LIMIT=30] -->
<string name="auto_rotate_option_face_based">On - Face-based</string>
<!-- SmartAutoRotatePreferenceFragment settings screen, face-based rotation switch label [CHAR LIMIT=30] -->
@@ -2270,6 +2276,10 @@
<string name="auto_brightness_title">Adaptive brightness</string>
<!-- Description about the feature adaptive brightness -->
<string name="auto_brightness_description">Your screen brightness will automatically adjust to your environment and activities. You can move the slider manually to help adaptive brightness learn your preferences.</string>
<!-- Setting option summary when adaptive brightness is on [CHAR LIMIT=NONE] -->
<string name="auto_brightness_summary_on">On</string>
<!-- Setting option summary when adaptive brightness is off [CHAR LIMIT=NONE] -->
<string name="auto_brightness_summary_off">Off</string>
<!-- Display settings screen, display white balance settings title [CHAR LIMIT=30] -->
<string name="display_white_balance_title">Display white balance</string>
@@ -2471,6 +2481,7 @@
<string name="sim_lock_settings">SIM lock settings</string>
<!-- Security & screen lock settings screen, SIM lock setting option name [CHAR LIMIT=40] -->
<string name="sim_lock_settings_category">SIM lock</string>
<!-- Security & screen lock settings screen, SIM card lock setting summary when on [CHAR LIMIT=NONE] -->
<!-- SIM lock settings screen, setting check box label [CHAR LIMIT=40] -->
<string name="sim_pin_toggle">Lock SIM</string>
<!-- SIM card lock settings screen, setting option name to change the SIM PIN [CHAR LIMIT=40] -->
@@ -2604,6 +2615,10 @@
<string name="meid_multi_sim">MEID (sim slot <xliff:g id="meid_slot_id">%1$d</xliff:g>)</string>
<!-- About phone screen, title for primary MEID for multi-sim devices -->
<string name="meid_multi_sim_primary">MEID (sim slot <xliff:g id="meid_slot_id_primary">%1$d</xliff:g>) (primary)</string>
<!-- The status text when (Wi-Fi or Bluetooth) scanning is on. [CHAR LIMIT=100] -->
<string name="scanning_status_text_on">On</string>
<!-- The status text when (Wi-Fi or Bluetooth) scanning is off. [CHAR LIMIT=100] -->
<string name="scanning_status_text_off">Off</string>
<!-- About phone, status item title. The phone MEID number of the current LTE/CDMA device. [CHAR LIMIT=30] -->
<string name="status_meid_number">MEID</string>
<!-- About phone, status item title. The ICCID of the current LTE device. [CHAR LIMIT=30] -->
@@ -4506,6 +4521,10 @@
<string name="accessibility_vibration_settings_title">Vibration &amp; haptics</string>
<!-- Summary for preference screen for configuring vibrations. [CHAR LIMIT=NONE] -->
<string name="accessibility_vibration_settings_summary">Control the vibration strength for different usages</string>
<!-- "Vibration & haptics" preference's state when enabled. This text is shown next to the "Vibration & haptics" preference title. [CHAR LIMIT=NONE] -->
<string name="accessibility_vibration_settings_state_on">On</string>
<!-- "Vibration & haptics" preference's state when disabled. This text is shown next to the "Vibration & haptics" preference title. [CHAR LIMIT=NONE] -->
<string name="accessibility_vibration_settings_state_off">Off</string>
<!-- Summary for vibration preference shown when it is disabled because the device is in silent mode. [CHAR LIMIT=NONE] -->
<string name="accessibility_vibration_setting_disabled_for_silent_mode_summary">Setting disabled because device is set to silent</string>
<!-- Title for the category of preferences to configure device vibrations related to calls. [CHAR LIMIT=NONE] -->
@@ -4648,6 +4667,10 @@
<string name="accessibility_summary_shortcut_enabled">Shortcut on</string>
<!-- Preference's shortcut when disabled. [CHAR LIMIT=NONE] -->
<string name="accessibility_summary_shortcut_disabled">Off</string>
<!-- Preference's state when enabled. [CHAR LIMIT=NONE] -->
<string name="accessibility_summary_state_enabled">On</string>
<!-- Preference's state when disabled. [CHAR LIMIT=NONE] -->
<string name="accessibility_summary_state_disabled">Off</string>
<!-- Accessibility service's preference's state when enabled but not running (like maybe it crashed). -->
<string name="accessibility_summary_state_stopped">Not working. Tap for info.</string>
<!-- Accessibility service's description when enabled but not running (like maybe it crashed). -->
@@ -4716,6 +4739,11 @@
<!-- Title for accessibility menu item to launch a settings activity. [CHAR LIMIT=15] -->
<string name="accessibility_menu_item_settings">Settings</string>
<!-- Summary for the enabled state of an accessibility feature. [CHAR LIMIT=10] -->
<string name="accessibility_feature_state_on">On</string>
<!-- Summary for the disabled state of an accessibility feature. [CHAR LIMIT=10] -->
<string name="accessibility_feature_state_off">Off</string>
<!-- Title for the preference category containing the video caption preview. [CHAR LIMIT=35] -->
<string name="captioning_preview_title">Preview</string>
<!-- Title for the preference catgeory containing standard video caption options. [CHAR LIMIT=35] -->
@@ -4897,6 +4925,8 @@
<string name="print_settings">Printing</string>
<!-- Print setting summary in settings screen [CHAR LIMIT=50] -->
<string name="print_settings_summary_no_service">Off</string>
<string name="print_settings_summary">{count, plural,
=1 {1 print service on}
other {# print services on}
@@ -4923,6 +4953,11 @@
<!-- Title for print menu item to launch the add printers activity. [CHAR LIMIT=25] -->
<string name="print_menu_item_add_printers">Add printers</string>
<!-- Summary for the enabled state of a print feature. [CHAR LIMIT=10] -->
<string name="print_feature_state_on">On</string>
<!-- Summary for the disabled state of a print feature. [CHAR LIMIT=10] -->
<string name="print_feature_state_off">Off</string>
<!-- Title of the action bar button to got to Play Store to download a print service. [CHAR LIMIT=25] -->
<string name="print_menu_item_add_service">Add service</string>
@@ -5544,6 +5579,10 @@
<string name="adaptive_connectivity_title">Adaptive connectivity</string>
<!-- Summary of Adaptive connectivity preference. [CHAR LIMIT=NONE] -->
<string name="adaptive_connectivity_summary">Extends battery life and improves device performance by automatically managing your network connections</string>
<!-- Switch on text of Adaptive connectivity preference. [CHAR LIMIT=NONE]-->
<string name="adaptive_connectivity_switch_on">On</string>
<!-- Switch off text of Adaptive connectivity preference. [CHAR LIMIT=NONE]-->
<string name="adaptive_connectivity_switch_off">Off</string>
<!-- Title for adaptive connectivity main switch preferences. [CHAR LIMIT=50] -->
<string name="adaptive_connectivity_main_switch_title">Use adaptive connectivity</string>
@@ -5636,6 +5675,10 @@
<!-- Backup and reset Settings screen --><skip />
<!-- Backup and reset settings menu and activity title -->
<string name="privacy_settings_title">Backup</string>
<!-- Summary for the Backup settings when it is turned on. -->
<string name="backup_summary_state_on">On</string>
<!-- Summary for the Backup settings when it is turned off. -->
<string name="backup_summary_state_off">Off</string>
<!-- Backup section title -->
<string name="backup_section_title">Backup &amp; restore</string>
<!-- Personal data section title -->
@@ -7102,6 +7145,9 @@
<!-- Sound: Summary for the spatializer effect. [CHAR LIMIT=NONE]-->
<string name="spatial_audio_text">Audio from compatible media becomes more immersive</string>
<!-- Sound: Summary for the Spatial audio setting when it is off. [CHAR LIMIT=NONE]-->
<string name="spatial_summary_off">Off</string>
<!-- Sound: Summary for the Spatial audio setting when it is on with one output device enabled. [CHAR LIMIT=NONE]-->
<string name="spatial_summary_on_one">On / <xliff:g id="output device" example="Phone speaker">%1$s</xliff:g></string>
@@ -7294,6 +7340,9 @@
<!-- Sound settings screen, summary format of do not disturb when on with extra info. [CHAR LIMIT=NONE] -->
<string name="zen_mode_sound_summary_on_with_info">On / <xliff:g name="dnd_summary" example="No sound except alarms and media">%1$s</xliff:g></string>
<!-- Sound settings screen, summary format of do not disturb when on with no extra information. [CHAR LIMIT=NONE] -->
<string name="zen_mode_sound_summary_on">On</string>
<!-- Do not disturb: Summary for zen mode duration setting indicating user will be prompted to set dnd duration whenever dnd is manually toggled on [CHAR LIMIT=NONE]-->
<string name="zen_mode_duration_summary_always_prompt">Ask every time</string>
@@ -8425,6 +8474,19 @@
<!-- PIN entry dialog title for entering the administrator PIN [CHAR LIMIT=none] -->
<string name="restr_pin_enter_admin_pin">Enter admin PIN</string>
<!-- Switch On/Off -->
<string name="switch_on_text">On</string>
<string name="switch_off_text">Off</string>
<!-- Switch text for nfc feature being on [CHAR LIMIT=NONE] -->
<string name="nfc_setting_on">On</string>
<!-- Switch text for nfc feature being off [CHAR LIMIT=NONE] -->
<string name="nfc_setting_off">Off</string>
<!-- The subtext when screen pinning feature is enabled. [CHAR LIMIT=28] -->
<string name="screen_pinning_switch_on_text">On</string>
<!-- The subtext when screen pinning feature is disabled. [CHAR LIMIT=28] -->
<string name="screen_pinning_switch_off_text">Off</string>
<!-- [CHAR LIMIT=28] Screen pinning title -->
<string name="screen_pinning_title">App pinning</string>
<!-- [CHAR LIMIT=none] Screen pinning introduction -->
@@ -8578,7 +8640,11 @@
<!-- Label for notification settings for an specific app [CHAR LIMIT=40] -->
<string name="notifications_label">Notifications</string>
<!-- App notification summary with notifications enabled [CHAR LIMIT=40] -->
<string name="notifications_enabled">On</string>
<!-- App notification summary with notifications enabled [CHAR LIMIT=40] -->
<string name="notifications_enabled_with_info"><xliff:g id="notifications_sent" example="~6 per week">%1$s</xliff:g> / <xliff:g id="notifications_categories_off" example="3 categories turned off">%2$s</xliff:g> </string>
<!-- Label for showing apps with blocked notifications in list [CHAR LIMIT=30] -->
<string name="notifications_disabled">Off</string>
<!-- Permissions preference summary [CHAR LIMIT=40] -->
<string name="notifications_categories_off">{count, plural,
@@ -9413,6 +9479,12 @@
<!-- Description of message shown when app is blocklisted for background data access [CHAR LIMIT=NONE] -->
<string name="restrict_background_blocklisted">Background data is turned off</string>
<!-- Summary for the Data Saver feature being on [CHAR LIMIT=NONE] -->
<string name="data_saver_on">On</string>
<!-- Summary for the Data Saver feature being off [CHAR LIMIT=NONE] -->
<string name="data_saver_off">Off</string>
<!-- Switch label to enable the Data Saver feature [CHAR LIMIT=NONE] -->
<string name="data_saver_switch_title">Use Data Saver</string>
@@ -9431,9 +9503,15 @@
<!-- Summary for suggestion adding more fingerprints [CHAR LIMIT=55] -->
<string name="suggestion_additional_fingerprints_summary">Unlock with a different finger</string>
<!-- Summary of battery saver when on [CHAR LIMIT=NONE] -->
<string name="battery_saver_on_summary">On</string>
<!-- Summary of battery saver when it is off and scheduled [CHAR LIMIT=NONE] -->
<string name="battery_saver_off_scheduled_summary">Will turn on at <xliff:g id="battery_percentage" example="15%">%1$s</xliff:g></string>
<!-- Summary of battery saver when it is off and scheduled [CHAR LIMIT=NONE] -->
<string name="battery_saver_off_summary">Off</string>
<!-- Preference title for battery usage list page[CHAR_LIMIT=50]-->
<string name="app_battery_usage_title">App battery usage</string>
@@ -9579,6 +9657,9 @@
<!-- Title of screen controlling which apps have access to send premium SMS messages [CHAR LIMIT=60] -->
<string name="premium_sms_access">Premium SMS access</string>
<!-- Summary for Bluetooth when disabled. [CHAR LIMIT=NONE] -->
<string name="bluetooth_disabled">Off</string>
<!-- Summary for Bluetooth when connected to one device. [CHAR LIMIT=NONE] -->
<string name="bluetooth_connected_summary">Connected to <xliff:g name="device">%1$s</xliff:g></string>
@@ -9815,6 +9896,10 @@
<!-- Title text for the assist gesture [CHAR LIMIT=60] DO NOT TRANSLATE -->
<string name="assist_gesture_title" translatable="false">Assist gesture</string>
<!-- Switch text for each gesture setting state -->
<string name="gesture_setting_on">On</string>
<string name="gesture_setting_off">Off</string>
<!-- setting enable OEM unlock Checkbox's summary to explain this Checkbox is disabled because the bootloader has been unlocked [CHAR_LIMIT=60] -->
<string name="oem_unlock_enable_disabled_summary_bootloader_unlocked">Bootloader is already unlocked</string>
<!-- setting enable OEM unlock Checkbox's summary to explain this Checkbox is disabled because there is no connectivity or the device is locked by the carrier [CHAR_LIMIT=60] -->
@@ -10618,6 +10703,9 @@
<!-- Label for the on position of a switch on the mobile network details page which allows
disabling/enabling a SIM. The SIM is enabled in this state. [CHAR LIMIT=40] -->
<string name="mobile_network_use_sim_on">Use SIM</string>
<!-- Label for the off position of a switch on the mobile network details page which allows
disabling/enabling a SIM. The SIM is disabled in this state. [CHAR LIMIT=40] -->
<string name="mobile_network_use_sim_off">Off</string>
<!-- Text shown in an information footer on the SIM details page for a physical SIM notifying
the user that the way to disable this SIM is to physically remove it. This is in contrast
to eSIM's, which can disabled using an on/off toggle switch. [CHAR LIMIT=NONE] -->
@@ -11437,6 +11525,10 @@
<!-- TARE settings title in developer options; "TARE" is the name of the feature and cannot be
translated. [CHAR LIMIT=40] -->
<string name="tare_settings">TARE Settings</string>
<!-- Summary for the TARE feature being on (ie. enabled) [CHAR LIMIT=NONE] -->
<string name="tare_on">On</string>
<!-- Summary for the TARE feature being off (ie. disabled) [CHAR LIMIT=NONE] -->
<string name="tare_off">Off</string>
<!-- Allows user to revert the TARE settings to their default values [CHAR LIMIT=40] -->
<string name="tare_revert">Revert to Default Settings</string>
<!-- Allows user to view AlarmManager policy factors. Alarm in this context is referring to the

View File

@@ -266,8 +266,8 @@ public class AccessibilitySettings extends DashboardFragment {
: context.getText(R.string.accessibility_summary_shortcut_disabled);
} else {
serviceState = serviceEnabled
? context.getText(R.string.on)
: context.getText(R.string.off);
? context.getText(R.string.accessibility_summary_state_enabled)
: context.getText(R.string.accessibility_summary_state_disabled);
}
final CharSequence serviceSummary = info.loadSummary(context.getPackageManager());

View File

@@ -422,7 +422,7 @@ public abstract class AccessibilityShortcutPreferenceFragment extends Restricted
}
if (!mShortcutPreference.isChecked()) {
return context.getText(R.string.off);
return context.getText(R.string.switch_off_text);
}
final int shortcutTypes = PreferredShortcuts.retrieveUserShortcutType(context,

View File

@@ -130,7 +130,8 @@ public final class AccessibilityUtil {
static CharSequence getSummary(Context context, String settingsSecureKey) {
final boolean enabled = Settings.Secure.getInt(context.getContentResolver(),
settingsSecureKey, State.OFF) == State.ON;
final int resId = enabled ? R.string.on : R.string.off;
final int resId = enabled ? R.string.accessibility_feature_state_on
: R.string.accessibility_feature_state_off;
return context.getResources().getText(resId);
}

View File

@@ -53,7 +53,7 @@ public class AutoclickPreferenceController extends BasePreferenceController {
final boolean enabled = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_AUTOCLICK_ENABLED, OFF) == ON;
if (!enabled) {
return mContext.getResources().getText(R.string.off);
return mContext.getResources().getText(R.string.accessibility_feature_state_off);
}
final int delayMillis = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,

View File

@@ -87,7 +87,8 @@ public class MagnificationGesturesPreferenceController extends TogglePreferenceC
resId = R.string.accessibility_screen_magnification_short_summary;
} else {
final boolean enabled = isChecked();
resId = (enabled ? R.string.on : R.string.off);
resId = (enabled ? R.string.accessibility_feature_state_on :
R.string.accessibility_feature_state_off);
}
return mContext.getString(resId);
}

View File

@@ -94,7 +94,8 @@ public class MagnificationNavbarPreferenceController extends TogglePreferenceCon
resId = R.string.accessibility_screen_magnification_navbar_short_summary;
} else {
final boolean enabled = isChecked();
resId = (enabled ? R.string.on : R.string.off);
resId = (enabled ? R.string.accessibility_feature_state_on :
R.string.accessibility_feature_state_off);
}
return mContext.getText(resId);
}

View File

@@ -658,7 +658,7 @@ public abstract class ToggleFeaturePreferenceFragment extends DashboardFragment
}
if (!mShortcutPreference.isChecked()) {
return context.getText(R.string.off);
return context.getText(R.string.switch_off_text);
}
final int shortcutTypes = PreferredShortcuts.retrieveUserShortcutType(context,

View File

@@ -431,7 +431,7 @@ public class ToggleScreenMagnificationPreferenceFragment extends
@Override
protected CharSequence getShortcutTypeSummary(Context context) {
if (!mShortcutPreference.isChecked()) {
return context.getText(R.string.off);
return context.getText(R.string.switch_off_text);
}
final int shortcutTypes = PreferredShortcuts.retrieveUserShortcutType(context,
@@ -752,6 +752,6 @@ public class ToggleScreenMagnificationPreferenceFragment extends
final int uerShortcutType = getUserShortcutTypeFromSettings(context);
return (uerShortcutType != AccessibilityUtil.UserShortcutType.EMPTY)
? context.getText(R.string.accessibility_summary_shortcut_enabled)
: context.getText(R.string.off);
: context.getText(R.string.accessibility_summary_shortcut_disabled);
}
}

View File

@@ -44,6 +44,9 @@ public class VibrationPreferenceController extends BasePreferenceController {
public CharSequence getSummary() {
final boolean isVibrateOn = Settings.System.getInt(mContext.getContentResolver(),
Settings.System.VIBRATE_ON, ON) == ON;
return mContext.getText(isVibrateOn ? R.string.on : R.string.off);
return mContext.getText(
isVibrateOn
? R.string.accessibility_vibration_settings_state_on
: R.string.accessibility_vibration_settings_state_off);
}
}

View File

@@ -99,11 +99,11 @@ public class AppNotificationPreferenceController extends AppInfoPreferenceContro
return "";
}
if (appRow.banned) {
return context.getText(R.string.off);
return context.getText(R.string.notifications_disabled);
} else if (appRow.channelCount == 0) {
return NotificationBackend.getSentSummary(context, appRow.sentByApp, false);
} else if (appRow.channelCount == appRow.blockedChannelCount) {
return context.getText(R.string.off);
return context.getText(R.string.notifications_disabled);
} else {
if (appRow.blockedChannelCount == 0) {
return NotificationBackend.getSentSummary(context, appRow.sentByApp, false);

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);

View File

@@ -74,7 +74,7 @@ public final class BluetoothSummaryUpdater extends SummaryUpdater implements Blu
@Override
public String getSummary() {
if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
return mContext.getString(R.string.off);
return mContext.getString(R.string.bluetooth_disabled);
}
switch (mBluetoothAdapter.getConnectionState()) {
case BluetoothAdapter.STATE_CONNECTED:
@@ -95,7 +95,7 @@ public final class BluetoothSummaryUpdater extends SummaryUpdater implements Blu
final Set<BluetoothDevice> devices = mBluetoothAdapter.getBondedDevices();
if (devices == null) {
Log.e(TAG, "getConnectedDeviceSummary, bonded devices are null");
return mContext.getString(R.string.off);
return mContext.getString(R.string.bluetooth_disabled);
} else if (devices.isEmpty()) {
Log.e(TAG, "getConnectedDeviceSummary, no bonded devices");
return mContext.getString(R.string.disconnected);

View File

@@ -54,9 +54,9 @@ public class NfcAndPaymentFragmentController extends BasePreferenceController {
public CharSequence getSummary() {
if (mNfcAdapter != null) {
if (mNfcAdapter.isEnabled()) {
return mContext.getText(R.string.on);
return mContext.getText(R.string.nfc_setting_on);
} else {
return mContext.getText(R.string.off);
return mContext.getText(R.string.nfc_setting_off);
}
}
return null;

View File

@@ -44,7 +44,7 @@ public class DataSaverPreference extends Preference implements DataSaverBackend.
@Override
public void onDataSaverChanged(boolean isDataSaving) {
setSummary(isDataSaving ? R.string.on : R.string.off);
setSummary(isDataSaving ? R.string.data_saver_on : R.string.data_saver_off);
}
@Override

View File

@@ -57,7 +57,9 @@ public class AutoBrightnessPreferenceController extends TogglePreferenceControll
@Override
public CharSequence getSummary() {
return mContext.getText(isChecked() ? R.string.on : R.string.off);
return mContext.getText(isChecked()
? R.string.auto_brightness_summary_on
: R.string.auto_brightness_summary_off);
}
@Override

View File

@@ -175,7 +175,7 @@ public class SmartAutoRotatePreferenceController extends TogglePreferenceControl
@Override
public CharSequence getSummary() {
int activeStringId = R.string.off;
int activeStringId = R.string.auto_rotate_option_off;
if (!RotationPolicy.isRotationLocked(mContext)) {
final int cameraRotate = Settings.Secure.getIntForUser(
mContext.getContentResolver(),
@@ -186,7 +186,7 @@ public class SmartAutoRotatePreferenceController extends TogglePreferenceControl
&& !isCameraLocked()
&& !isPowerSaveMode()
? R.string.auto_rotate_option_face_based
: R.string.on;
: R.string.auto_rotate_option_on;
}
return mContext.getString(activeStringId);
}

View File

@@ -95,7 +95,8 @@ public class EmergencyGestureEntrypointPreferenceController extends BasePreferen
public CharSequence getSummary() {
return mContext.getText(
mEmergencyNumberUtils.getEmergencyGestureEnabled()
? R.string.on : R.string.off);
? R.string.gesture_setting_on
: R.string.gesture_setting_off);
}
/**

View File

@@ -97,7 +97,7 @@ public class BatterySaverController extends BasePreferenceController
public CharSequence getSummary() {
final boolean isPowerSaveOn = mPowerManager.isPowerSaveMode();
if (isPowerSaveOn) {
return mContext.getString(R.string.on);
return mContext.getString(R.string.battery_saver_on_summary);
}
final ContentResolver resolver = mContext.getContentResolver();
@@ -109,7 +109,7 @@ public class BatterySaverController extends BasePreferenceController
return percent != 0 ?
mContext.getString(R.string.battery_saver_off_scheduled_summary,
Utils.formatPercentage(percent)) :
mContext.getString(R.string.off);
mContext.getString(R.string.battery_saver_off_summary);
} else {
return mContext.getString(R.string.battery_saver_pref_auto_routine_summary);
}

View File

@@ -128,7 +128,8 @@ public class AssistGestureSettingsPreferenceController extends GesturePreference
if (!mAssistOnly) {
isEnabled = isEnabled || isSilenceGestureEnabled();
}
return mContext.getText(isEnabled ? R.string.on : R.string.off);
return mContext.getText(
isEnabled ? R.string.gesture_setting_on : R.string.gesture_setting_off);
}
@Override

View File

@@ -60,7 +60,8 @@ public abstract class GesturePreferenceController extends TogglePreferenceContro
@Override
public CharSequence getSummary() {
return mContext.getText(isChecked() ? R.string.on : R.string.off);
return mContext.getText(
isChecked() ? R.string.gesture_setting_on : R.string.gesture_setting_off);
}
@Override

View File

@@ -51,7 +51,7 @@ public class OneHandedEnablePreferenceController extends BasePreferenceControlle
public CharSequence getSummary() {
return mContext.getText(
OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)
? R.string.on : R.string.off);
? R.string.gesture_setting_on : R.string.gesture_setting_off);
}
@Override

View File

@@ -104,7 +104,7 @@ public class PreventRingingParentPreferenceController extends TogglePreferenceCo
break;
// VOLUME_HUSH_OFF
default:
summary = mContext.getText(R.string.off);
summary = mContext.getText(R.string.switch_off_text);
}
preference.setEnabled(true);
mPreference.setSwitchEnabled(true);

View File

@@ -66,7 +66,7 @@ public class SpellCheckerPreferenceController extends AbstractPreferenceControll
return;
}
if (!mTextServicesManager.isSpellCheckerEnabled()) {
preference.setSummary(R.string.off);
preference.setSummary(R.string.switch_off_text);
} else {
final SpellCheckerInfo sci = mTextServicesManager.getCurrentSpellChecker();
if (sci != null) {

View File

@@ -44,7 +44,8 @@ public class LocationForWorkPreferenceController extends LocationBasePreferenceC
final boolean switchState = mPreference.isChecked();
mUserManager.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, !switchState,
Utils.getManagedProfile(mUserManager));
mPreference.setSummary(switchState ? R.string.on : R.string.off);
mPreference.setSummary(switchState
? R.string.switch_on_text : R.string.switch_off_text);
return true;
}
return false;
@@ -80,11 +81,11 @@ public class LocationForWorkPreferenceController extends LocationBasePreferenceC
mLocationEnabler.isManagedProfileRestrictedByBase();
if (isRestrictedByBase || !enabled) {
mPreference.setChecked(false);
summaryResId = enabled ? R.string.off
summaryResId = enabled ? R.string.switch_off_text
: R.string.location_app_permission_summary_location_off;
} else {
mPreference.setChecked(true);
summaryResId = R.string.on;
summaryResId = R.string.switch_on_text;
}
mPreference.setSummary(summaryResId);
}

View File

@@ -46,7 +46,8 @@ public class LocationServicesBluetoothScanningPreferenceController extends
public CharSequence getSummary() {
final boolean bleScanOn = Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 0) == 1;
final int resId = bleScanOn ? R.string.on : R.string.off;
int resId =
bleScanOn ? R.string.scanning_status_text_on : R.string.scanning_status_text_off;
return mContext.getString(resId);
}

View File

@@ -47,7 +47,8 @@ public class LocationServicesWifiScanningPreferenceController extends BasePrefer
@Override
public CharSequence getSummary() {
final boolean wifiScanOn = mWifiManager.isScanAlwaysAvailable();
final int resId = wifiScanOn ? R.string.on : R.string.off;
int resId =
wifiScanOn ? R.string.scanning_status_text_on : R.string.scanning_status_text_off;
return mContext.getString(resId);
}

View File

@@ -58,7 +58,7 @@ public class TopLevelLocationPreferenceController extends BasePreferenceControll
}
return sSummary;
} else {
return mContext.getString(R.string.off);
return mContext.getString(R.string.location_settings_summary_location_off);
}
}

View File

@@ -48,7 +48,7 @@ public class AdaptiveConnectivityPreferenceController extends BasePreferenceCont
public CharSequence getSummary() {
return Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1) == 1
? mContext.getString(R.string.on)
: mContext.getString(R.string.off);
? mContext.getString(R.string.adaptive_connectivity_switch_on)
: mContext.getString(R.string.adaptive_connectivity_switch_off);
}
}

View File

@@ -130,7 +130,7 @@ public class PrivateDnsPreferenceController extends BasePreferenceController
case PRIVATE_DNS_MODE_OFF:
return res.getString(R.string.private_dns_mode_off);
case PRIVATE_DNS_MODE_OPPORTUNISTIC:
return dnsesResolved ? res.getString(R.string.on)
return dnsesResolved ? res.getString(R.string.private_dns_mode_on)
: res.getString(R.string.private_dns_mode_opportunistic);
case PRIVATE_DNS_MODE_PROVIDER_HOSTNAME:
return dnsesResolved

View File

@@ -65,7 +65,7 @@ public class AndroidBeamEnabler extends BaseNfcEnabler {
if (mNfcAdapter.isNdefPushEnabled() && mPreference.isEnabled()) {
mPreference.setSummary(R.string.android_beam_on_summary);
} else {
mPreference.setSummary(R.string.off);
mPreference.setSummary(R.string.android_beam_off_summary);
}
break;
case NfcAdapter.STATE_TURNING_ON:

View File

@@ -44,7 +44,7 @@ public class BubbleSummaryNotificationPreferenceController extends BasePreferenc
return mContext.getString(
areBubblesEnabled()
? R.string.notifications_bubble_setting_on_summary
: R.string.off);
: R.string.switch_off_text);
}
@Override

View File

@@ -71,7 +71,7 @@ public class SpatialAudioParentPreferenceController extends BasePreferenceContro
return mContext.getString(R.string.spatial_summary_on_one,
mContext.getString(R.string.spatial_audio_wired_headphones));
} else {
return mContext.getString(R.string.off);
return mContext.getString(R.string.spatial_summary_off);
}
}
}

View File

@@ -194,7 +194,7 @@ public class ZenModeSettings extends ZenModeSettingsBase {
String description = ZenModeConfig.getDescription(mContext, true, config, false);
if (description == null) {
return mContext.getString(R.string.on);
return mContext.getString(R.string.zen_mode_sound_summary_on);
} else {
return mContext.getString(R.string.zen_mode_sound_summary_on_with_info,
description);

View File

@@ -274,7 +274,7 @@ public class ZenModeSettingsFooterPreferenceController extends AbstractZenModePr
}
private int getAllowRes(boolean allow) {
return allow ? R.string.on : R.string.off;
return allow ? R.string.zen_mode_sound_summary_on : R.string.switch_off_text;
}
@Override

View File

@@ -165,7 +165,7 @@ public class ZenRulePreference extends PrimarySwitchPreference {
}
return (rule == null || !rule.isEnabled())
? mContext.getResources().getString(R.string.off)
: mContext.getResources().getString(R.string.on);
? mContext.getResources().getString(R.string.switch_off_text)
: mContext.getResources().getString(R.string.switch_on_text);
}
}

View File

@@ -117,7 +117,7 @@ public class PrintSettingPreferenceController extends BasePreferenceController i
final List<PrintServiceInfo> services =
mPrintManager.getPrintServices(PrintManager.ENABLED_SERVICES);
if (services == null || services.isEmpty()) {
return mContext.getText(R.string.off);
return mContext.getText(R.string.print_settings_summary_no_service);
} else {
return StringUtil.getIcuPluralsString(mContext, services.size(),
R.string.print_settings_summary);

View File

@@ -204,9 +204,9 @@ public class PrintSettingsFragment extends ProfileSettingsPreferenceFragment
preference.setPersistent(false);
if (service.isEnabled()) {
preference.setSummary(getString(R.string.on));
preference.setSummary(getString(R.string.print_feature_state_on));
} else {
preference.setSummary(getString(R.string.off));
preference.setSummary(getString(R.string.print_feature_state_off));
}
Drawable drawable = service.getResolveInfo().loadIcon(pm);

View File

@@ -38,7 +38,7 @@ public class ScreenPinningPreferenceController extends BasePreferenceController
public CharSequence getSummary() {
return Settings.System.getInt(mContext.getContentResolver(),
Settings.System.LOCK_TO_APP_ENABLED, 0) != 0
? mContext.getText(R.string.on)
: mContext.getText(R.string.off);
? mContext.getText(R.string.screen_pinning_switch_on_text)
: mContext.getText(R.string.screen_pinning_switch_off_text);
}
}

View File

@@ -134,7 +134,7 @@ public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedC
lp.setMarginEnd(switchBarMarginEnd);
setBackgroundColor(mBackgroundColor);
setSwitchBarText(R.string.on, R.string.off);
setSwitchBarText(R.string.switch_on_text, R.string.switch_off_text);
addOnSwitchChangeListener(
(switchView, isChecked) -> setTextViewLabelAndBackground(isChecked));

View File

@@ -87,7 +87,7 @@ public final class WifiSummaryUpdater extends SummaryUpdater {
@Override
public String getSummary() {
if (!mWifiTracker.enabled) {
return mContext.getString(R.string.off);
return mContext.getString(R.string.switch_off_text);
}
if (!mWifiTracker.connected) {
return mContext.getString(R.string.disconnected);

View File

@@ -194,7 +194,7 @@ public class AccessibilitySettingsTest {
mServiceInfo, SERVICE_ENABLED);
assertThat(summary).isEqualTo(
mContext.getString(R.string.on));
mContext.getString(R.string.accessibility_summary_state_enabled));
}
@Test
@@ -205,13 +205,13 @@ public class AccessibilitySettingsTest {
mServiceInfo, SERVICE_DISABLED);
assertThat(summary).isEqualTo(
mContext.getString(R.string.off));
mContext.getString(R.string.accessibility_summary_state_disabled));
}
@Test
public void getServiceSummary_enableServiceAndHasSummary_showsEnabledSummary() {
final String service_enabled = mContext.getString(
R.string.on);
R.string.accessibility_summary_state_enabled);
doReturn(DEFAULT_SUMMARY).when(mServiceInfo).loadSummary(any());
final CharSequence summary = AccessibilitySettings.getServiceSummary(mContext,
@@ -225,7 +225,7 @@ public class AccessibilitySettingsTest {
@Test
public void getServiceSummary_disableServiceAndHasSummary_showsCombineDisabledSummary() {
final String service_disabled = mContext.getString(
R.string.off);
R.string.accessibility_summary_state_disabled);
doReturn(DEFAULT_SUMMARY).when(mServiceInfo).loadSummary(any());
final CharSequence summary = AccessibilitySettings.getServiceSummary(mContext,

View File

@@ -80,7 +80,7 @@ public final class AccessibilityUtilTest {
final CharSequence result = AccessibilityUtil.getSummary(mContext, SECURE_TEST_KEY);
assertThat(result)
.isEqualTo(mContext.getText(R.string.on));
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_on));
}
@Test
@@ -90,7 +90,7 @@ public final class AccessibilityUtilTest {
final CharSequence result = AccessibilityUtil.getSummary(mContext, SECURE_TEST_KEY);
assertThat(result)
.isEqualTo(mContext.getText(R.string.off));
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_off));
}
@Test
@@ -98,7 +98,7 @@ public final class AccessibilityUtilTest {
final CharSequence result = AccessibilityUtil.getSummary(mContext, SECURE_TEST_KEY);
assertThat(result)
.isEqualTo(mContext.getText(R.string.off));
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_off));
}
@Test

View File

@@ -60,7 +60,7 @@ public class AutoclickPreferenceControllerTest {
Settings.Secure.ACCESSIBILITY_AUTOCLICK_ENABLED, OFF);
assertThat(mController.getSummary())
.isEqualTo(mContext.getText(R.string.off));
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_off));
}
@Test

View File

@@ -58,7 +58,7 @@ public class CaptioningPreferenceControllerTest {
Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, ON);
assertThat(mController.getSummary()).isEqualTo(
mContext.getText(R.string.on));
mContext.getText(R.string.accessibility_feature_state_on));
}
@Test
@@ -67,6 +67,6 @@ public class CaptioningPreferenceControllerTest {
Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF);
assertThat(mController.getSummary()).isEqualTo(
mContext.getText(R.string.off));
mContext.getText(R.string.accessibility_feature_state_off));
}
}

View File

@@ -52,7 +52,7 @@ public class ColorInversionPreferenceControllerTest {
DISPLAY_INVERSION_ENABLED, State.ON);
assertThat(mController.getSummary().toString().contains(
mContext.getText(R.string.on))).isTrue();
mContext.getText(R.string.accessibility_feature_state_on))).isTrue();
}
@Test
@@ -61,7 +61,7 @@ public class ColorInversionPreferenceControllerTest {
DISPLAY_INVERSION_ENABLED, State.OFF);
assertThat(mController.getSummary().toString().contains(
mContext.getText(R.string.off))).isTrue();
mContext.getText(R.string.accessibility_feature_state_off))).isTrue();
}
@Retention(RetentionPolicy.SOURCE)

View File

@@ -50,7 +50,7 @@ public class DaltonizerPreferenceControllerTest {
Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, ON);
assertThat(mController.getSummary().toString().contains(
mContext.getText(R.string.on))).isTrue();
mContext.getText(R.string.accessibility_feature_state_on))).isTrue();
}
@Test
@@ -59,6 +59,6 @@ public class DaltonizerPreferenceControllerTest {
Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, OFF);
assertThat(mController.getSummary().toString().contains(
mContext.getText(R.string.off))).isTrue();
mContext.getText(R.string.accessibility_feature_state_off))).isTrue();
}
}

View File

@@ -64,13 +64,13 @@ public class MagnificationGesturesPreferenceControllerTest {
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, ON);
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getString(R.string.on));
.isEqualTo(mContext.getString(R.string.accessibility_feature_state_on));
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, OFF);
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getString(R.string.off));
.isEqualTo(mContext.getString(R.string.accessibility_feature_state_off));
}
@Test

View File

@@ -89,13 +89,13 @@ public class MagnificationNavbarPreferenceControllerTest {
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, ON);
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getText(R.string.on));
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_on));
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, OFF);
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getText(R.string.off));
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_off));
}
@Test

View File

@@ -92,7 +92,7 @@ public class VibrationPreferenceControllerTest {
controller.updateState(mPreference);
assertThat(mPreference.getSummary().toString()).isEqualTo(
mContext.getString(R.string.on));
mContext.getString(R.string.accessibility_vibration_settings_state_on));
}
@Test
@@ -103,7 +103,7 @@ public class VibrationPreferenceControllerTest {
controller.updateState(mPreference);
assertThat(mPreference.getSummary().toString()).isEqualTo(
mContext.getString(R.string.on));
mContext.getString(R.string.accessibility_vibration_settings_state_on));
}
@Test
@@ -114,7 +114,7 @@ public class VibrationPreferenceControllerTest {
controller.updateState(mPreference);
assertThat(mPreference.getSummary().toString()).isEqualTo(
mContext.getString(R.string.off));
mContext.getString(R.string.accessibility_vibration_settings_state_off));
}
private VibrationPreferenceController createPreferenceController() {

View File

@@ -73,7 +73,7 @@ public class BackupDataPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getString(R.string.on));
.isEqualTo(mContext.getString(R.string.accessibility_feature_state_on));
}
@Test
@@ -83,7 +83,7 @@ public class BackupDataPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getString(R.string.off));
.isEqualTo(mContext.getString(R.string.accessibility_feature_state_off));
}
@Test

View File

@@ -90,7 +90,7 @@ public class BackupSettingsHelperTest {
String backupSummary = mBackupSettingsHelper.getSummary();
assertThat(backupSummary).isEqualTo(mContext.getString(R.string.on));
assertThat(backupSummary).isEqualTo(mContext.getString(R.string.backup_summary_state_on));
}
@Test
@@ -100,7 +100,7 @@ public class BackupSettingsHelperTest {
String backupSummary = mBackupSettingsHelper.getSummary();
assertThat(backupSummary).isEqualTo(mContext.getString(R.string.off));
assertThat(backupSummary).isEqualTo(mContext.getString(R.string.backup_summary_state_off));
}
@Test

View File

@@ -132,7 +132,7 @@ public class BluetoothSummaryUpdaterTest {
mSummaryUpdater.onBluetoothStateChanged(BluetoothAdapter.STATE_OFF);
verify(mListener).onSummaryChanged(mContext.getString(R.string.off));
verify(mListener).onSummaryChanged(mContext.getString(R.string.bluetooth_disabled));
}
@Test
@@ -197,12 +197,12 @@ public class BluetoothSummaryUpdaterTest {
mShadowBluetoothAdapter.setEnabled(false);
mSummaryUpdater.onBluetoothStateChanged(BluetoothAdapter.STATE_OFF);
verify(mListener).onSummaryChanged(mContext.getString(R.string.off));
verify(mListener).onSummaryChanged(mContext.getString(R.string.bluetooth_disabled));
// Turning ON means not enabled
mSummaryUpdater.onBluetoothStateChanged(BluetoothAdapter.STATE_TURNING_ON);
// There should still be only one invocation of disabled message
verify(mListener).onSummaryChanged(mContext.getString(R.string.off));
verify(mListener).onSummaryChanged(mContext.getString(R.string.bluetooth_disabled));
mShadowBluetoothAdapter.setEnabled(true);
mDeviceConnected[0] = false;

View File

@@ -92,13 +92,13 @@ public class NfcAndPaymentFragmentControllerTest {
public void getSummary_nfcOn_shouldProvideOnSummary() {
mShadowNfcAdapter.setEnabled(true);
assertThat(mController.getSummary().toString()).contains(
mContext.getString(R.string.on));
mContext.getString(R.string.switch_on_text));
}
@Test
public void getSummary_nfcOff_shouldProvideOffSummary() {
mShadowNfcAdapter.setEnabled(false);
assertThat(mController.getSummary().toString()).contains(
mContext.getString(R.string.off));
mContext.getString(R.string.switch_off_text));
}
}

View File

@@ -109,7 +109,7 @@ public class AutoBrightnessPreferenceControllerTest {
mController.setChecked(true);
assertThat(mController.getSummary())
.isEqualTo(mContext.getText(R.string.on));
.isEqualTo(mContext.getText(R.string.auto_brightness_summary_on));
}
@Test
@@ -117,7 +117,7 @@ public class AutoBrightnessPreferenceControllerTest {
mController.setChecked(false);
assertThat(mController.getSummary())
.isEqualTo(mContext.getText(R.string.off));
.isEqualTo(mContext.getText(R.string.auto_brightness_summary_off));
}
@Test

View File

@@ -86,9 +86,9 @@ public class SmartAutoRotatePreferenceControllerTest {
doReturn(PACKAGE_NAME).when(mPackageManager).getRotationResolverPackageName();
doReturn(PackageManager.PERMISSION_GRANTED).when(mPackageManager).checkPermission(
Manifest.permission.CAMERA, PACKAGE_NAME);
when(mContext.getString(R.string.off))
when(mContext.getString(R.string.auto_rotate_option_off))
.thenReturn("Off");
when(mContext.getString(R.string.on))
when(mContext.getString(R.string.auto_rotate_option_on))
.thenReturn("On");
when(mContext.getString(R.string.auto_rotate_option_face_based))
.thenReturn("On - Face-based");

View File

@@ -67,7 +67,7 @@ public class OneHandedEnablePreferenceControllerTest {
OneHandedSettingsUtils.setOneHandedModeEnabled(mContext, true);
assertThat(mController.getSummary())
.isEqualTo(mContext.getText(R.string.on));
.isEqualTo(mContext.getText(R.string.switch_on_text));
}
@Test
@@ -75,6 +75,6 @@ public class OneHandedEnablePreferenceControllerTest {
OneHandedSettingsUtils.setOneHandedModeEnabled(mContext, false);
assertThat(mController.getSummary())
.isEqualTo(mContext.getText(R.string.off));
.isEqualTo(mContext.getText(R.string.switch_off_text));
}
}

View File

@@ -137,7 +137,7 @@ public class PreventRingingParentPreferenceControllerTest {
VOLUME_HUSH_OFF);
mController.updateState(mPreference);
assertThat(mPreference.getSummary()).isEqualTo(mContext.getResources().getText(
R.string.off));
R.string.switch_off_text));
}
@Test

View File

@@ -97,7 +97,7 @@ public class SpellCheckerPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mAppContext.getString(R.string.off));
.isEqualTo(mAppContext.getString(R.string.switch_off_text));
}
@Test

View File

@@ -97,7 +97,7 @@ public class LocationForWorkPreferenceControllerTest {
verify(mUserManager)
.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, false, mUserHandle);
verify(mPreference).setSummary(R.string.on);
verify(mPreference).setSummary(R.string.switch_on_text);
}
@Test
@@ -109,7 +109,7 @@ public class LocationForWorkPreferenceControllerTest {
verify(mUserManager)
.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, true, mUserHandle);
verify(mPreference).setSummary(R.string.off);
verify(mPreference).setSummary(R.string.switch_off_text);
}
@Test
@@ -147,7 +147,7 @@ public class LocationForWorkPreferenceControllerTest {
mController.onLocationModeChanged(Settings.Secure.LOCATION_MODE_BATTERY_SAVING, false);
verify(mPreference).setEnabled(true);
verify(mPreference).setSummary(R.string.on);
verify(mPreference).setSummary(R.string.switch_on_text);
}
@Test

View File

@@ -53,7 +53,7 @@ public class TopLevelLocationPreferenceControllerTest {
public void getSummary_whenLocationIsOff_shouldReturnStringForOff() {
mLocationManager.setLocationEnabledForUser(false, android.os.Process.myUserHandle());
assertThat(mController.getSummary()).isEqualTo(
mContext.getString(R.string.off));
mContext.getString(R.string.location_settings_summary_location_off));
}
@Test

View File

@@ -74,7 +74,7 @@ public class AdaptiveConnectivityPreferenceControllerTest {
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1);
assertThat(mController.getSummary()).isEqualTo(mContext.getString(R.string.on));
assertThat(mController.getSummary()).isEqualTo(mContext.getString(R.string.switch_on_text));
}
@Test
@@ -83,6 +83,6 @@ public class AdaptiveConnectivityPreferenceControllerTest {
Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 0);
assertThat(mController.getSummary())
.isEqualTo(mContext.getString(R.string.off));
.isEqualTo(mContext.getString(R.string.switch_off_text));
}
}

View File

@@ -224,7 +224,7 @@ public class PrivateDnsPreferenceControllerTest {
when(lp.getValidatedPrivateDnsServers()).thenReturn(NON_EMPTY_ADDRESS_LIST);
updateLinkProperties(lp);
mController.updateState(mPreference);
verify(mPreference).setSummary(getResourceString(R.string.on));
verify(mPreference).setSummary(getResourceString(R.string.private_dns_mode_on));
reset(mPreference);
lp = mock(LinkProperties.class);

View File

@@ -141,7 +141,7 @@ public class TetherPreferenceControllerTest {
when(mTetheringManager.getTetherableWifiRegexs()).thenReturn(new String[]{"456"});
mController.updateSummary();
verify(mPreference).setSummary(R.string.off);
verify(mPreference).setSummary(R.string.switch_off_text);
}
@Test
@@ -172,7 +172,7 @@ public class TetherPreferenceControllerTest {
ReflectionHelpers.getField(mController, "mAirplaneModeObserver");
observer.onChange(true, Settings.Global.getUriFor(Settings.Global.AIRPLANE_MODE_ON));
verify(mPreference).setSummary(R.string.off);
verify(mPreference).setSummary(R.string.switch_off_text);
}
@Test

View File

@@ -145,7 +145,7 @@ public class PrintSettingsPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getString(R.string.off));
.isEqualTo(mContext.getString(R.string.print_settings_summary_no_service));
}
@Test

View File

@@ -76,7 +76,7 @@ public class ScreenPinningPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getString(R.string.off));
.isEqualTo(mContext.getString(R.string.switch_off_text));
}
@Test
@@ -87,7 +87,7 @@ public class ScreenPinningPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getString(R.string.on));
.isEqualTo(mContext.getString(R.string.switch_on_text));
}
@Test

View File

@@ -55,8 +55,8 @@ public class SwitchBarTest {
@Test
public void cycleChecked_defaultLabel_shouldUpdateTextAndBackground() {
final int defaultOnText = R.string.on;
final int defaultOffText = R.string.off;
final int defaultOnText = R.string.switch_on_text;
final int defaultOffText = R.string.switch_off_text;
assertThat(((TextView) mBar.findViewById(R.id.switch_text)).getText())
.isEqualTo(mContext.getString(defaultOffText));

View File

@@ -110,7 +110,7 @@ public class WifiSummaryUpdaterTest {
mWifiTracker.enabled = false;
assertThat(mSummaryUpdater.getSummary())
.isEqualTo(mContext.getString(R.string.off));
.isEqualTo(mContext.getString(R.string.switch_off_text));
}
@Test