Remove duplicate strings.

"Yes" and "no" were redefined many times with no clear benefit, so this
consolidates them into one definition.

Bug: 243843096
Test: Build, install, and open the Settings app
Test: atest SettingsRoboTests
Change-Id: I5f84d09f223efd478461ded93aeac82bf7b128d8
This commit is contained in:
Kweku Adams
2022-08-25 21:23:50 +00:00
parent fb2090e643
commit 5949fccc7a
73 changed files with 118 additions and 246 deletions

View File

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

View File

@@ -26,6 +26,10 @@
<string name="deny">Deny</string> <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]--> <!-- 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> <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 --> <!-- Device Info screen. Used for a status item's value when the proper value is not known -->
<string name="device_info_default">Unknown</string> <string name="device_info_default">Unknown</string>
@@ -659,8 +663,6 @@
<string name="location_settings_title">Location</string> <string name="location_settings_title">Location</string>
<!-- Used in the location settings to control turning on/off the feature entirely [CHAR LIMIT=60] --> <!-- 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> <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]--> <!-- Summary for Location settings when location is on, explaining how many apps have location permission [CHAR LIMIT=NONE]-->
<plurals name="location_settings_summary_location_on"> <plurals name="location_settings_summary_location_on">
<item quantity="one">On - <xliff:g id="count">%1$d</xliff:g> app has access to location</item> <item quantity="one">On - <xliff:g id="count">%1$d</xliff:g> app has access to location</item>
@@ -2007,8 +2009,6 @@
<string name="android_beam_settings_title">Android Beam</string> <string name="android_beam_settings_title">Android Beam</string>
<!-- Used to describe the on state of the Android Beam feature [CHAR LIMIT=NONE] --> <!-- 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> <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] --> <!-- 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> <string name="nfc_disabled_summary">Unavailable because NFC is turned off</string>
<!-- Used in the Android Beam sharing preferences screen. This phrase is a trademark. [CHAR LIMIT=32] --> <!-- Used in the Android Beam sharing preferences screen. This phrase is a trademark. [CHAR LIMIT=32] -->
@@ -2745,8 +2745,6 @@
<string name="emergency_address_summary">Used as your location when you make an emergency call over Wi\u2011Fi</string> <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] --> <!-- 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> <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 setting wifi calling are not editable [CHAR LIMIT=NONE] --> <!-- Message to display when setting wifi calling are not editable [CHAR LIMIT=NONE] -->
<string name="wifi_calling_pref_managed_by_carrier">Setting managed by carrier</string> <string name="wifi_calling_pref_managed_by_carrier">Setting managed by carrier</string>
@@ -2878,10 +2876,6 @@
<string name="display_settings">Display</string> <string name="display_settings">Display</string>
<!-- Sound & display settings screen, accelerometer-based rotation check box label --> <!-- Sound & display settings screen, accelerometer-based rotation check box label -->
<string name="accelerometer_title">Auto-rotate screen</string> <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] --> <!-- Sound & display settings screen, face-based rotation check box label [CHAR LIMIT=30] -->
<string name="auto_rotate_option_face_based">On - Face-based</string> <string name="auto_rotate_option_face_based">On - Face-based</string>
<!-- SmartAutoRotatePreferenceFragment settings screen, face-based rotation switch label [CHAR LIMIT=30] --> <!-- SmartAutoRotatePreferenceFragment settings screen, face-based rotation switch label [CHAR LIMIT=30] -->
@@ -2939,10 +2933,6 @@
<string name="auto_brightness_title">Adaptive brightness</string> <string name="auto_brightness_title">Adaptive brightness</string>
<!-- Summary about the feature adaptive brightness [CHAR LIMIT=NONE] --> <!-- Summary about the feature adaptive brightness [CHAR LIMIT=NONE] -->
<string name="auto_brightness_summary">Screen brightness adjusts to environment</string> <string name="auto_brightness_summary">Screen brightness adjusts to environment</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>
<!-- Sound & display settings screen, setting option summary when preferred adaptive brightness is very low [CHAR LIMIT=100] --> <!-- Sound & display settings screen, setting option summary when preferred adaptive brightness is very low [CHAR LIMIT=100] -->
<string name="auto_brightness_summary_very_low">Preferred brightness is very low</string> <string name="auto_brightness_summary_very_low">Preferred brightness is very low</string>
<!-- Sound & display settings screen, setting option summary when preferred adaptive brightness is low [CHAR LIMIT=100] --> <!-- Sound & display settings screen, setting option summary when preferred adaptive brightness is low [CHAR LIMIT=100] -->
@@ -2953,8 +2943,6 @@
<string name="auto_brightness_summary_high">Preferred brightness is high</string> <string name="auto_brightness_summary_high">Preferred brightness is high</string>
<!-- Sound & display settings screen, setting option summary when preferred adaptive brightness is very high [CHAR LIMIT=100] --> <!-- Sound & display settings screen, setting option summary when preferred adaptive brightness is very high [CHAR LIMIT=100] -->
<string name="auto_brightness_summary_very_high">Preferred brightness is very high</string> <string name="auto_brightness_summary_very_high">Preferred brightness is very high</string>
<!-- Adaptive brightness settings screen, setting option to disable adaptive brightness [CHAR LIMIT=100] -->
<string name="auto_brightness_off_title">Off</string>
<!-- Adaptive brightness settings screen, setting option to enable adaptive brightness when user prefers very low brightness [CHAR LIMIT=100] --> <!-- Adaptive brightness settings screen, setting option to enable adaptive brightness when user prefers very low brightness [CHAR LIMIT=100] -->
<string name="auto_brightness_very_low_title">Very low</string> <string name="auto_brightness_very_low_title">Very low</string>
<!-- Adaptive brightness settings screen, setting option to enable adaptive brightness when user prefers low brightness [CHAR LIMIT=100] --> <!-- Adaptive brightness settings screen, setting option to enable adaptive brightness when user prefers low brightness [CHAR LIMIT=100] -->
@@ -2993,8 +2981,6 @@
<string name="adaptive_sleep_title">Screen attention</string> <string name="adaptive_sleep_title">Screen attention</string>
<!-- Setting option summary when adaptive sleep is on [CHAR LIMIT=NONE] --> <!-- Setting option summary when adaptive sleep is on [CHAR LIMIT=NONE] -->
<string name="adaptive_sleep_summary_on">On / Screen won\u2019t turn off if you\u2019re looking at it</string> <string name="adaptive_sleep_summary_on">On / Screen won\u2019t turn off if you\u2019re looking at it</string>
<!-- Setting option summary when adaptive sleep is off [CHAR LIMIT=NONE] -->
<string name="adaptive_sleep_summary_off">Off</string>
<!-- adaptive_sleep settings screen, title about the required permission is missing [CHAR LIMIT=NONE]--> <!-- adaptive_sleep settings screen, title about the required permission is missing [CHAR LIMIT=NONE]-->
<string name="adaptive_sleep_title_no_permission">Camera access needed</string> <string name="adaptive_sleep_title_no_permission">Camera access needed</string>
<!-- adaptive_sleep settings screen, subtitle when permission is missing [CHAR LIMIT=NONE]--> <!-- adaptive_sleep settings screen, subtitle when permission is missing [CHAR LIMIT=NONE]-->
@@ -3164,8 +3150,6 @@
<string name="screensaver_settings_summary_dock">While docked</string> <string name="screensaver_settings_summary_dock">While docked</string>
<!-- Display settings screen, summary fragment for screen saver options, activated never [CHAR LIMIT=35] --> <!-- Display settings screen, summary fragment for screen saver options, activated never [CHAR LIMIT=35] -->
<string name="screensaver_settings_summary_never">Never</string> <string name="screensaver_settings_summary_never">Never</string>
<!-- Display settings screen, summary for screen saver options, screen saver is turned off [CHAR LIMIT=20] -->
<string name="screensaver_settings_summary_off">Off</string>
<!-- Dream settings screen, action label, when to dream [CHAR LIMIT=20] --> <!-- Dream settings screen, action label, when to dream [CHAR LIMIT=20] -->
<string name="screensaver_settings_when_to_dream">When to start</string> <string name="screensaver_settings_when_to_dream">When to start</string>
<!-- Dream settings screen, action label, current selected screen saver [CHAR LIMIT=35] --> <!-- Dream settings screen, action label, current selected screen saver [CHAR LIMIT=35] -->
@@ -3201,8 +3185,6 @@
<string name="sim_lock_settings">SIM card lock settings</string> <string name="sim_lock_settings">SIM card lock settings</string>
<!-- Security & screen lock settings screen, SIM card lock setting option name [CHAR LIMIT=40] --> <!-- Security & screen lock settings screen, SIM card lock setting option name [CHAR LIMIT=40] -->
<string name="sim_lock_settings_category">SIM card lock</string> <string name="sim_lock_settings_category">SIM card lock</string>
<!-- Security & screen lock settings screen, SIM card lock setting summary when off [CHAR LIMIT=NONE] -->
<string name="sim_lock_settings_summary_off">Off</string>
<!-- Security & screen lock settings screen, SIM card lock setting summary when on [CHAR LIMIT=NONE] --> <!-- Security & screen lock settings screen, SIM card lock setting summary when on [CHAR LIMIT=NONE] -->
<string name="sim_lock_settings_summary_on">Locked</string> <string name="sim_lock_settings_summary_on">Locked</string>
<!-- Security & location settings screen, section heading for settings related to sim card locking [CHAR LIMIT=40] --> <!-- Security & location settings screen, section heading for settings related to sim card locking [CHAR LIMIT=40] -->
@@ -3367,10 +3349,6 @@
<string name="status_prl_version">PRL version</string> <string name="status_prl_version">PRL version</string>
<!-- About phone screen, title for MEID for multi-sim devices --> <!-- About phone screen, title for MEID for multi-sim devices -->
<string name="meid_multi_sim">MEID (sim slot %1$d)</string> <string name="meid_multi_sim">MEID (sim slot %1$d)</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>
<!-- The status text when both Wi-Fi scanning and Bluetooth scanning are on. [CHAR LIMIT=100] --> <!-- The status text when both Wi-Fi scanning and Bluetooth scanning are on. [CHAR LIMIT=100] -->
<string name="scanning_status_text_wifi_on_ble_on">Both Wi\u2011Fi and Bluetooth scanning are on</string> <string name="scanning_status_text_wifi_on_ble_on">Both Wi\u2011Fi and Bluetooth scanning are on</string>
<!-- The status text when Wi-Fi scanning is on and Bluetooth scanning are off. [CHAR LIMIT=100] --> <!-- The status text when Wi-Fi scanning is on and Bluetooth scanning are off. [CHAR LIMIT=100] -->
@@ -5539,10 +5517,6 @@
<string name="accessibility_vibration_settings_title">Vibration &amp; haptics</string> <string name="accessibility_vibration_settings_title">Vibration &amp; haptics</string>
<!-- Summary for preference screen for configuring vibrations. [CHAR LIMIT=NONE] --> <!-- Summary for preference screen for configuring vibrations. [CHAR LIMIT=NONE] -->
<string name="accessibility_vibration_settings_summary">Control the vibration strength for different usages</string> <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] --> <!-- 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> <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] --> <!-- Title for the category of preferences to configure device vibrations related to calls. [CHAR LIMIT=NONE] -->
@@ -5669,10 +5643,6 @@
<string name="accessibility_summary_shortcut_enabled">Shortcut on</string> <string name="accessibility_summary_shortcut_enabled">Shortcut on</string>
<!-- Preference's shortcut when disabled. [CHAR LIMIT=NONE] --> <!-- Preference's shortcut when disabled. [CHAR LIMIT=NONE] -->
<string name="accessibility_summary_shortcut_disabled">Off</string> <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). --> <!-- 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> <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). --> <!-- Accessibility service's description when enabled but not running (like maybe it crashed). -->
@@ -5764,11 +5734,6 @@
<!-- Title for accessibility menu item to launch a settings activity. [CHAR LIMIT=15] --> <!-- Title for accessibility menu item to launch a settings activity. [CHAR LIMIT=15] -->
<string name="accessibility_menu_item_settings">Settings</string> <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] --> <!-- Title for the preference category containing the video caption preview. [CHAR LIMIT=35] -->
<string name="captioning_preview_title">Preview</string> <string name="captioning_preview_title">Preview</string>
<!-- Title for the preference catgeory containing standard video caption options. [CHAR LIMIT=35] --> <!-- Title for the preference catgeory containing standard video caption options. [CHAR LIMIT=35] -->
@@ -5964,9 +5929,6 @@
<!-- Title in main settings screen for printing settings [CHAR LIMIT=15] --> <!-- Title in main settings screen for printing settings [CHAR LIMIT=15] -->
<string name="print_settings">Printing</string> <string name="print_settings">Printing</string>
<!-- Print setting summary in settings screen [CHAR LIMIT=50] -->
<string name="print_settings_summary_no_service">Off</string>
<!-- Print setting summary in settings screen [CHAR LIMIT=50] --> <!-- Print setting summary in settings screen [CHAR LIMIT=50] -->
<plurals name="print_settings_summary"> <plurals name="print_settings_summary">
<item quantity="one">1 print service on</item> <item quantity="one">1 print service on</item>
@@ -5994,11 +5956,6 @@
<!-- Title for print menu item to launch the add printers activity. [CHAR LIMIT=25] --> <!-- Title for print menu item to launch the add printers activity. [CHAR LIMIT=25] -->
<string name="print_menu_item_add_printers">Add printers</string> <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] --> <!-- 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> <string name="print_menu_item_add_service">Add service</string>
@@ -6655,10 +6612,6 @@
<string name="adaptive_connectivity_title">Adaptive connectivity</string> <string name="adaptive_connectivity_title">Adaptive connectivity</string>
<!-- Summary of Adaptive connectivity preference. [CHAR LIMIT=NONE] --> <!-- 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> <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 of preference group for credential storage settings [CHAR LIMIT=30] --> <!-- Title of preference group for credential storage settings [CHAR LIMIT=30] -->
<string name="credentials_title">Credential storage</string> <string name="credentials_title">Credential storage</string>
@@ -6751,10 +6704,6 @@
<!-- Backup and reset Settings screen --><skip /> <!-- Backup and reset Settings screen --><skip />
<!-- Backup and reset settings menu and activity title --> <!-- Backup and reset settings menu and activity title -->
<string name="privacy_settings_title">Backup</string> <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 --> <!-- Backup section title -->
<string name="backup_section_title">Backup &amp; restore</string> <string name="backup_section_title">Backup &amp; restore</string>
<!-- Personal data section title --> <!-- Personal data section title -->
@@ -8344,9 +8293,6 @@
<!-- Sound: Summary for the spatializer effect. [CHAR LIMIT=NONE]--> <!-- Sound: Summary for the spatializer effect. [CHAR LIMIT=NONE]-->
<string name="spatial_audio_text">Audio from compatible media becomes more immersive</string> <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]--> <!-- 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> <string name="spatial_summary_on_one">On / <xliff:g id="output device" example="Phone speaker">%1$s</xliff:g></string>
@@ -8539,9 +8485,6 @@
<!-- Sound settings screen, summary format of do not disturb when on with extra info. [CHAR LIMIT=NONE] --> <!-- 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> <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]--> <!-- 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> <string name="zen_mode_duration_summary_always_prompt">Ask every time</string>
@@ -9444,12 +9387,6 @@
<item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> categories deleted</item> <item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> categories deleted</item>
</plurals> </plurals>
<!-- [CHAR LIMIT=NONE] App notification settings: notifications enabled-->
<string name="notification_toggle_on">On</string>
<!-- [CHAR LIMIT=NONE] App notification settings: notifications disabled-->
<string name="notification_toggle_off">Off</string>
<!-- [CHAR LIMIT=NONE] App notification settings: Block option title --> <!-- [CHAR LIMIT=NONE] App notification settings: Block option title -->
<string name="app_notification_block_title">Block all</string> <string name="app_notification_block_title">Block all</string>
@@ -9931,19 +9868,6 @@
<!-- PIN entry dialog title for entering the administrator PIN [CHAR LIMIT=none] --> <!-- PIN entry dialog title for entering the administrator PIN [CHAR LIMIT=none] -->
<string name="restr_pin_enter_admin_pin">Enter admin PIN</string> <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 --> <!-- [CHAR LIMIT=28] Screen pinning title -->
<string name="screen_pinning_title">App pinning</string> <string name="screen_pinning_title">App pinning</string>
<!-- [CHAR LIMIT=none] Screen pinning introduction --> <!-- [CHAR LIMIT=none] Screen pinning introduction -->
@@ -10142,11 +10066,7 @@
<!-- Label for notification settings for an specific app [CHAR LIMIT=40] --> <!-- Label for notification settings for an specific app [CHAR LIMIT=40] -->
<string name="notifications_label">Notifications</string> <string name="notifications_label">Notifications</string>
<!-- App notification summary with notifications enabled [CHAR LIMIT=40] --> <!-- 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> <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>
<!-- Label for showing apps with some blocked notifications in list [CHAR LIMIT=30] --> <!-- Label for showing apps with some blocked notifications in list [CHAR LIMIT=30] -->
<string name="notifications_partly_blocked"><xliff:g id="count" example="1">%1$d</xliff:g> of <xliff:g id="count" example="10">%2$d</xliff:g> categories turned off</string> <string name="notifications_partly_blocked"><xliff:g id="count" example="1">%1$d</xliff:g> of <xliff:g id="count" example="10">%2$d</xliff:g> categories turned off</string>
<!-- App notification summary with notifications silenced [CHAR LIMIT=40] --> <!-- App notification summary with notifications silenced [CHAR LIMIT=40] -->
@@ -11240,12 +11160,6 @@
<!-- Description of message shown when app is blocklisted for background data access [CHAR LIMIT=NONE] --> <!-- 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> <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] --> <!-- Switch label to enable the Data Saver feature [CHAR LIMIT=NONE] -->
<string name="data_saver_switch_title">Use Data Saver</string> <string name="data_saver_switch_title">Use Data Saver</string>
@@ -11279,15 +11193,9 @@
<!-- Summary for suggestion adding more fingerprints [CHAR LIMIT=55] --> <!-- Summary for suggestion adding more fingerprints [CHAR LIMIT=55] -->
<string name="suggestion_additional_fingerprints_summary">Unlock with a different finger</string> <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] --> <!-- 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> <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>
<!-- Battery saver: Label for button that will turn on battery saver. [CHAR LIMIT=30] --> <!-- Battery saver: Label for button that will turn on battery saver. [CHAR LIMIT=30] -->
<string name="battery_saver_button_turn_on">Turn on now</string> <string name="battery_saver_button_turn_on">Turn on now</string>
@@ -11442,9 +11350,6 @@
<!-- Title of screen controlling which apps have access to send premium SMS messages [CHAR LIMIT=60] --> <!-- 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> <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] --> <!-- 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> <string name="bluetooth_connected_summary">Connected to <xliff:g name="device">%1$s</xliff:g></string>
@@ -11769,10 +11674,6 @@
<!-- Title text for the assist gesture [CHAR LIMIT=60] DO NOT TRANSLATE --> <!-- Title text for the assist gesture [CHAR LIMIT=60] DO NOT TRANSLATE -->
<string name="assist_gesture_title" translatable="false">Assist gesture</string> <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] --> <!-- 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> <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. [CHAR_LIMIT=60] --> <!-- setting enable OEM unlock Checkbox's summary to explain this Checkbox is disabled because there is no connectivity. [CHAR_LIMIT=60] -->
@@ -12612,9 +12513,6 @@
<!-- Label for the on position of a switch on the mobile network details page which allows <!-- 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] --> disabling/enabling a SIM. The SIM is enabled in this state. [CHAR LIMIT=40] -->
<string name="mobile_network_use_sim_on">Use SIM</string> <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 <!-- 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 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] --> to eSIM's, which can disabled using an on/off toggle switch. [CHAR LIMIT=NONE] -->
@@ -13214,11 +13112,6 @@
<!-- Summary for see all preference when bluetooth is disable [CHAR LIMIT=none]--> <!-- Summary for see all preference when bluetooth is disable [CHAR LIMIT=none]-->
<string name="connected_device_see_all_summary">Bluetooth will turn on</string> <string name="connected_device_see_all_summary">Bluetooth will turn on</string>
<!-- Switch text for bluetooth feature being on [CHAR LIMIT=NONE] -->
<string name="bluetooth_setting_on">On</string>
<!-- Switch text for bluetooth feature being off [CHAR LIMIT=NONE] -->
<string name="bluetooth_setting_off">Off</string>
<!-- Provider Model: Internet controls settings screen, item title to go into the networks settings --> <!-- Provider Model: Internet controls settings screen, item title to go into the networks settings -->
<string name="provider_internet_settings">Internet</string> <string name="provider_internet_settings">Internet</string>
<!-- Provider Model: SIMs controls settings screen, item title to go into the SIMs settings --> <!-- Provider Model: SIMs controls settings screen, item title to go into the SIMs settings -->
@@ -13510,10 +13403,6 @@
<!-- TARE settings title in developer options; "TARE" is the name of the feature and cannot be <!-- TARE settings title in developer options; "TARE" is the name of the feature and cannot be
translated. [CHAR LIMIT=40] --> translated. [CHAR LIMIT=40] -->
<string name="tare_settings">TARE Settings</string> <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] --> <!-- Allows user to revert the TARE settings to their default values [CHAR LIMIT=40] -->
<string name="tare_revert">Revert to Default Settings</string> <string name="tare_revert">Revert to Default Settings</string>
<!-- Allows user to view AlarmManager policy factors. Alarm in this context is referring to the <!-- Allows user to view AlarmManager policy factors. Alarm in this context is referring to the

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -137,7 +137,7 @@ public class DreamSettings extends DashboardFragment implements OnMainSwitchChan
@VisibleForTesting @VisibleForTesting
static CharSequence getSummaryTextFromBackend(DreamBackend backend, Context context) { static CharSequence getSummaryTextFromBackend(DreamBackend backend, Context context) {
if (!backend.isEnabled()) { if (!backend.isEnabled()) {
return context.getString(R.string.screensaver_settings_summary_off); return context.getString(R.string.off);
} else { } else {
return backend.getActiveDreamName(); return backend.getActiveDreamName();
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -216,7 +216,7 @@ public class TetherPreferenceController extends AbstractPreferenceController imp
} }
if (!hotSpotOn && !tetherOn) { if (!hotSpotOn && !tetherOn) {
// Both off // Both off
mPreference.setSummary(R.string.switch_off_text); mPreference.setSummary(R.string.off);
} else if (hotSpotOn && tetherOn) { } else if (hotSpotOn && tetherOn) {
// Both on // Both on
mPreference.setSummary(R.string.tether_settings_summary_hotspot_on_tether_on); mPreference.setSummary(R.string.tether_settings_summary_hotspot_on_tether_on);
@@ -232,7 +232,7 @@ public class TetherPreferenceController extends AbstractPreferenceController imp
// Preference is not ready yet. // Preference is not ready yet.
return; return;
} }
mPreference.setSummary(R.string.switch_off_text); mPreference.setSummary(R.string.off);
} }
class SettingObserver extends ContentObserver { class SettingObserver extends ContentObserver {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -38,7 +38,6 @@ import android.widget.Switch;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.ColorInt; import androidx.annotation.ColorInt;
import androidx.annotation.StringRes;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import com.android.settings.R; import com.android.settings.R;
@@ -135,7 +134,7 @@ public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedC
lp.setMarginEnd(switchBarMarginEnd); lp.setMarginEnd(switchBarMarginEnd);
setBackgroundColor(mBackgroundColor); setBackgroundColor(mBackgroundColor);
setSwitchBarText(R.string.switch_on_text, R.string.switch_off_text); setSwitchBarText(R.string.on, R.string.off);
addOnSwitchChangeListener( addOnSwitchChangeListener(
(switchView, isChecked) -> setTextViewLabelAndBackground(isChecked)); (switchView, isChecked) -> setTextViewLabelAndBackground(isChecked));

View File

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

View File

@@ -187,7 +187,7 @@ public class AccessibilitySettingsTest {
mServiceInfo, SERVICE_ENABLED); mServiceInfo, SERVICE_ENABLED);
assertThat(summary).isEqualTo( assertThat(summary).isEqualTo(
mContext.getString(R.string.accessibility_summary_state_enabled)); mContext.getString(R.string.on));
} }
@Test @Test
@@ -198,13 +198,13 @@ public class AccessibilitySettingsTest {
mServiceInfo, SERVICE_DISABLED); mServiceInfo, SERVICE_DISABLED);
assertThat(summary).isEqualTo( assertThat(summary).isEqualTo(
mContext.getString(R.string.accessibility_summary_state_disabled)); mContext.getString(R.string.off));
} }
@Test @Test
public void getServiceSummary_enableServiceAndHasSummary_showsEnabledSummary() { public void getServiceSummary_enableServiceAndHasSummary_showsEnabledSummary() {
final String service_enabled = mContext.getString( final String service_enabled = mContext.getString(
R.string.accessibility_summary_state_enabled); R.string.on);
doReturn(DEFAULT_SUMMARY).when(mServiceInfo).loadSummary(any()); doReturn(DEFAULT_SUMMARY).when(mServiceInfo).loadSummary(any());
final CharSequence summary = AccessibilitySettings.getServiceSummary(mContext, final CharSequence summary = AccessibilitySettings.getServiceSummary(mContext,
@@ -218,7 +218,7 @@ public class AccessibilitySettingsTest {
@Test @Test
public void getServiceSummary_disableServiceAndHasSummary_showsCombineDisabledSummary() { public void getServiceSummary_disableServiceAndHasSummary_showsCombineDisabledSummary() {
final String service_disabled = mContext.getString( final String service_disabled = mContext.getString(
R.string.accessibility_summary_state_disabled); R.string.off);
doReturn(DEFAULT_SUMMARY).when(mServiceInfo).loadSummary(any()); doReturn(DEFAULT_SUMMARY).when(mServiceInfo).loadSummary(any());
final CharSequence summary = AccessibilitySettings.getServiceSummary(mContext, 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); final CharSequence result = AccessibilityUtil.getSummary(mContext, SECURE_TEST_KEY);
assertThat(result) assertThat(result)
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_on)); .isEqualTo(mContext.getText(R.string.on));
} }
@Test @Test
@@ -90,7 +90,7 @@ public final class AccessibilityUtilTest {
final CharSequence result = AccessibilityUtil.getSummary(mContext, SECURE_TEST_KEY); final CharSequence result = AccessibilityUtil.getSummary(mContext, SECURE_TEST_KEY);
assertThat(result) assertThat(result)
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_off)); .isEqualTo(mContext.getText(R.string.off));
} }
@Test @Test
@@ -98,7 +98,7 @@ public final class AccessibilityUtilTest {
final CharSequence result = AccessibilityUtil.getSummary(mContext, SECURE_TEST_KEY); final CharSequence result = AccessibilityUtil.getSummary(mContext, SECURE_TEST_KEY);
assertThat(result) assertThat(result)
.isEqualTo(mContext.getText(R.string.accessibility_feature_state_off)); .isEqualTo(mContext.getText(R.string.off));
} }
@Test @Test

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -29,10 +29,10 @@ import com.android.settingslib.dream.DreamBackend.WhenToDream;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import org.robolectric.RobolectricTestRunner;
@RunWith(RobolectricTestRunner.class) @RunWith(RobolectricTestRunner.class)
public class DreamSettingsTest { public class DreamSettingsTest {
@@ -96,7 +96,7 @@ public class DreamSettingsTest {
when(mockBackend.isEnabled()).thenReturn(false); when(mockBackend.isEnabled()).thenReturn(false);
assertThat(DreamSettings.getSummaryTextFromBackend(mockBackend, mockContext)) assertThat(DreamSettings.getSummaryTextFromBackend(mockBackend, mockContext))
.isEqualTo(mockContext.getString(R.string.screensaver_settings_summary_off)); .isEqualTo(mockContext.getString(R.string.off));
} }
@Test @Test

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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