Cleanup some plurals in Settings
Change <one> to <1> in string res file, and update related java files. Test: Update, existing test still pass. bug: 199230342 Change-Id: Idd0ba3c6adc060da21574d98f8ed765fae00cef8
This commit is contained in:
@@ -36,10 +36,10 @@
|
||||
<!-- String for removal of sensitive info on about, depending on tap -->
|
||||
<string name="device_info_protected_single_press">Tap to show info</string>
|
||||
<!-- [CHAR LIMIT=NONE] Device Info screen. Countdown for user taps to enable development settings -->
|
||||
<plurals name="show_dev_countdown">
|
||||
<item quantity="one">You are now <xliff:g id="step_count">%1$d</xliff:g> step away from being a developer.</item>
|
||||
<item quantity="other">You are now <xliff:g id="step_count">%1$d</xliff:g> steps away from being a developer.</item>
|
||||
</plurals>
|
||||
<string name="show_dev_countdown">{count, plural,
|
||||
=1 {You are now # step away from being a developer.}
|
||||
other {You are now # steps away from being a developer.}
|
||||
}</string>
|
||||
<!-- [CHAR LIMIT=NONE] Device Info screen. Confirmation that developer settings are enabled -->
|
||||
<string name="show_dev_on">You are now a developer!</string>
|
||||
<!-- [CHAR LIMIT=NONE] Device Info screen. Okay we get it, stop pressing, you already have it on -->
|
||||
@@ -355,10 +355,10 @@
|
||||
<string name="desc_app_locale_selection_supported">Only apps that support language selection are shown here.</string>
|
||||
|
||||
<!-- The title of the confirmation dialog shown when the user selects one / several languages and tries to remove them [CHAR LIMIT=60] -->
|
||||
<plurals name="dlg_remove_locales_title">
|
||||
<item quantity="one">Remove selected language?</item>
|
||||
<item quantity="other">Remove selected languages?</item>
|
||||
</plurals>
|
||||
<string name="dlg_remove_locales_title">{count, plural,
|
||||
=1 {Remove selected language?}
|
||||
other {Remove selected languages?}
|
||||
}</string>
|
||||
|
||||
<!-- The text of the confirmation dialog shown when the user selects several languages and tries to remove them [CHAR LIMIT=NONE] -->
|
||||
<string name="dlg_remove_locales_message">Text will be displayed in another language.</string>
|
||||
@@ -1128,10 +1128,10 @@
|
||||
<string name="lock_last_password_attempt_before_wipe_profile">If you enter an incorrect password on the next attempt, your work profile and its data will be deleted</string>
|
||||
|
||||
<!-- Hint shown in dialog screen when password is too short -->
|
||||
<plurals name="lockpassword_password_too_short">
|
||||
<item quantity="one">Must contain at least <xliff:g id="count" example="1">%d</xliff:g> character</item>
|
||||
<item quantity="other">Must be at least <xliff:g id="count" example="3">%d</xliff:g> characters</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_too_short">{count, plural,
|
||||
=1 {Must contain at least # character}
|
||||
other {Must be at least # characters}
|
||||
}</string>
|
||||
<!-- Hint shown in dialog screen when password is too short and only using numbers. [CHAR LIMIT=NONE] -->
|
||||
<string name="lockpassword_password_too_short_all_numeric">
|
||||
{count, plural,
|
||||
@@ -1140,21 +1140,21 @@
|
||||
}
|
||||
</string>
|
||||
<!-- Hint shown in dialog screen when PIN is too short -->
|
||||
<plurals name="lockpassword_pin_too_short">
|
||||
<item quantity="one">PIN must contain at least <xliff:g id="count" example="1">%d</xliff:g> digit</item>
|
||||
<item quantity="other">PIN must be at least <xliff:g id="count" example="3">%d</xliff:g> digits</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_pin_too_short">{count, plural,
|
||||
=1 {PIN must contain at least # digit}
|
||||
other {PIN must be at least # digits}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown in popup when password is too long -->
|
||||
<plurals name="lockpassword_password_too_long">
|
||||
<item quantity="one">Must be fewer than <xliff:g id="number" example="1">%d</xliff:g> character</item>
|
||||
<item quantity="other">Must be fewer than <xliff:g id="number" example="17">%d</xliff:g> characters</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_too_long">{count, plural,
|
||||
=1 {Must be fewer than # character}
|
||||
other {Must be fewer than # characters}
|
||||
}</string>
|
||||
<!-- Error shown in popup when PIN is too long -->
|
||||
<plurals name="lockpassword_pin_too_long">
|
||||
<item quantity="one">Must be fewer than <xliff:g id="number" example="1">%d</xliff:g> digit</item>
|
||||
<item quantity="other">Must be fewer than <xliff:g id="number" example="17">%d</xliff:g> digits</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_pin_too_long">{count, plural,
|
||||
=1 {Must be fewer than # digit}
|
||||
other {Must be fewer than # digits}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown when in PIN mode and PIN has been used recently. Please keep this string short! -->
|
||||
<string name="lockpassword_pin_recently_used">Device admin doesn\'t allow using a recent PIN</string>
|
||||
@@ -1163,46 +1163,46 @@
|
||||
<string name="lockpassword_illegal_character">This can\'t include an invalid character</string>
|
||||
|
||||
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of letters -->
|
||||
<plurals name="lockpassword_password_requires_letters">
|
||||
<item quantity="one">Must contain at least 1 letter</item>
|
||||
<item quantity="other">Must contain at least <xliff:g id="count" example="3">%d</xliff:g> letters</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_requires_letters">{count, plural,
|
||||
=1 {Must contain at least 1 letter}
|
||||
other {Must contain at least # letters}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of lowercase letters -->
|
||||
<plurals name="lockpassword_password_requires_lowercase">
|
||||
<item quantity="one">Must contain at least 1 lowercase letter</item>
|
||||
<item quantity="other">Must contain at least <xliff:g id="count" example="3">%d</xliff:g> lowercase letters</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_requires_lowercase">{count, plural,
|
||||
=1 {Must contain at least 1 lowercase letter}
|
||||
other {Must contain at least # lowercase letters}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of uppercase letters -->
|
||||
<plurals name="lockpassword_password_requires_uppercase">
|
||||
<item quantity="one">Must contain at least 1 uppercase letter</item>
|
||||
<item quantity="other">Must contain at least <xliff:g id="count" example="3">%d</xliff:g> uppercase letters</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_requires_uppercase">{count, plural,
|
||||
=1 {Must contain at least 1 uppercase letter}
|
||||
other {Must contain at least # uppercase letters}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of numerical digits -->
|
||||
<plurals name="lockpassword_password_requires_numeric">
|
||||
<item quantity="one">Must contain at least 1 numerical digit</item>
|
||||
<item quantity="other">Must contain at least <xliff:g id="count" example="3">%d</xliff:g> numerical digits</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_requires_numeric">{count, plural,
|
||||
=1 {Must contain at least 1 numerical digit}
|
||||
other {Must contain at least # numerical digits}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of special symbols -->
|
||||
<plurals name="lockpassword_password_requires_symbols">
|
||||
<item quantity="one">Must contain at least 1 special symbol</item>
|
||||
<item quantity="other">Must contain at least <xliff:g id="count" example="3">%d</xliff:g> special symbols</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_requires_symbols">{count, plural,
|
||||
=1 {Must contain at least 1 special symbol}
|
||||
other {Must contain at least # special symbols}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of non-letter characters -->
|
||||
<plurals name="lockpassword_password_requires_nonletter">
|
||||
<item quantity="one">Must contain at least 1 non-letter character</item>
|
||||
<item quantity="other">Must contain at least <xliff:g id="count" example="3">%d</xliff:g> non-letter characters</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_requires_nonletter">{count, plural,
|
||||
=1 {Must contain at least 1 non-letter character}
|
||||
other {Must contain at least # non-letter characters}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of non-numerical characters -->
|
||||
<plurals name="lockpassword_password_requires_nonnumerical">
|
||||
<item quantity="one">Must contain at least 1 non-numerical character</item>
|
||||
<item quantity="other">Must contain at least <xliff:g id="count" example="3">%d</xliff:g> non-numerical characters</item>
|
||||
</plurals>
|
||||
<string name="lockpassword_password_requires_nonnumerical">{count, plural,
|
||||
=1 {Must contain at least 1 non-numerical character}
|
||||
other {Must contain at least # non-numerical characters}
|
||||
}</string>
|
||||
|
||||
<!-- Error shown when in PASSWORD mode and password has been used recently. Please keep this string short! -->
|
||||
<string name="lockpassword_password_recently_used">Device admin doesn\'t allow using a recent
|
||||
@@ -1234,10 +1234,10 @@
|
||||
<string name="number_of_device_admins_none">No active apps</string>
|
||||
|
||||
<!-- Summary of preference to manage device admin apps, informing the user how many device admin apps are installed and active -->
|
||||
<plurals name="number_of_device_admins">
|
||||
<item quantity="one"><xliff:g id="count">%d</xliff:g> active app</item>
|
||||
<item quantity="other"><xliff:g id="count">%d</xliff:g> active apps</item>
|
||||
</plurals>
|
||||
<string name="number_of_device_admins">{count, plural,
|
||||
=1 {# active app}
|
||||
other {# active apps}
|
||||
}</string>
|
||||
|
||||
<!-- Title of preference to manage trust agents -->
|
||||
<string name="manage_trust_agents">Trust agents</string>
|
||||
@@ -1249,10 +1249,10 @@
|
||||
<string name="manage_trust_agents_summary">None</string>
|
||||
|
||||
<!-- Summary of preference to manage device policies when there is trust agent-->
|
||||
<plurals name="manage_trust_agents_summary_on">
|
||||
<item quantity="one">1 active trust agent</item>
|
||||
<item quantity="other"><xliff:g id="count" example="3">%d</xliff:g> active trust agents</item>
|
||||
</plurals>
|
||||
<string name="manage_trust_agents_summary_on">{count, plural,
|
||||
=1 {1 active trust agent}
|
||||
other {# active trust agents}
|
||||
}</string>
|
||||
|
||||
<!-- Bluetooth settings -->
|
||||
<!--Used as title on second screen after selecting Bluetooth settings -->
|
||||
@@ -1751,20 +1751,20 @@
|
||||
|
||||
<!-- Wi-Fi Advanced Settings --> <skip />
|
||||
<!-- Wi-Fi settings screen, Saved networks summary. This shows below the "Saved networks" item and indicates the number of networks, not including passpoint network, a user has saved. [CHAR LIMIT=30] -->
|
||||
<plurals name="wifi_saved_access_points_summary">
|
||||
<item quantity="one">1 network</item>
|
||||
<item quantity="other">%d networks</item>
|
||||
</plurals>
|
||||
<string name="wifi_saved_access_points_summary">{count, plural,
|
||||
=1 {1 network}
|
||||
other {# networks}
|
||||
}</string>
|
||||
<!-- Wi-Fi settings screen, Saved networks summary. This shows below the "Saved networks" item and indicates the number of passpoint networks a user has saved. [CHAR LIMIT=30] -->
|
||||
<plurals name="wifi_saved_passpoint_access_points_summary">
|
||||
<item quantity="one">1 subscription</item>
|
||||
<item quantity="other">%d subscriptions</item>
|
||||
</plurals>
|
||||
<string name="wifi_saved_passpoint_access_points_summary">{count, plural,
|
||||
=1 {1 subscription}
|
||||
other {# subscriptions}
|
||||
}</string>
|
||||
<!-- Wi-Fi settings screen, Saved networks summary. This shows below the "Saved networks" item and indicates number of whole kinds networks, if there are both normal saved networks and saved passpoint networks. The number will be at least 2, so the one case is only to prevent lint error. [CHAR LIMIT=60] -->
|
||||
<plurals name="wifi_saved_all_access_points_summary">
|
||||
<item quantity="one">1 network & subscription</item>
|
||||
<item quantity="other">%d networks & subscriptions</item>
|
||||
</plurals>
|
||||
<string name="wifi_saved_all_access_points_summary">{count, plural,
|
||||
=1 {1 network & subscription}
|
||||
other {# networks & subscriptions}
|
||||
}</string>
|
||||
<!-- Wi-Fi settings screen, advanced, title of the item to show the Wi-Fi device's SSID. [CHAR LIMIT=20] -->
|
||||
<string name="wifi_advanced_ssid_title">SSID</string>
|
||||
<!-- Wi-Fi settings screen, advanced, title of the item to show the device's Wi-Fi MAC address. [CHAR LIMIT=50] -->
|
||||
@@ -2372,10 +2372,10 @@
|
||||
Displayed in a dialog box. [CHAR LIMIT=100] -->
|
||||
<string name="wrong_pin_code_pukked">Incorrect SIM PIN code you must now contact your carrier to unlock your device.</string>
|
||||
<!-- Instructions telling the user that they entered the wrong SIM PIN while trying to unlock the keyguard. Displayed in a dialog box. [CHAR LIMIT=100] -->
|
||||
<plurals name="wrong_pin_code">
|
||||
<item quantity="one">Incorrect SIM PIN code, you have <xliff:g id="number">%d</xliff:g> remaining attempt before you must contact your carrier to unlock your device.</item>
|
||||
<item quantity="other">Incorrect SIM PIN code, you have <xliff:g id="number">%d</xliff:g> remaining attempts.</item>
|
||||
</plurals>
|
||||
<string name="wrong_pin_code">{count, plural,
|
||||
=1 {Incorrect SIM PIN code, you have # remaining attempt before you must contact your carrier to unlock your device.}
|
||||
other {Incorrect SIM PIN code, you have # remaining attempts.}
|
||||
}</string>
|
||||
|
||||
<!-- This is instruction text to inform the user that they have entered the wrong SIM PIN while trying to unlock the keyguard.
|
||||
The variable will be replaced with a number. [CHAR LIMIT=NONE] -->
|
||||
@@ -2951,18 +2951,10 @@
|
||||
"total_location_app_count" is almost always greater than 1, so "apps" is always in plural form.
|
||||
|
||||
[CHAR LIMIT=NONE]-->
|
||||
<plurals name="location_app_permission_summary_location_on">
|
||||
<item quantity="one">
|
||||
<xliff:g id="permitted_location_app_count">%1$d</xliff:g>
|
||||
of
|
||||
<xliff:g id="total_location_app_count">%2$d</xliff:g>
|
||||
apps has access to location</item>
|
||||
<item quantity="other">
|
||||
<xliff:g id="permitted_location_app_count">%1$d</xliff:g>
|
||||
of
|
||||
<xliff:g id="total_location_app_count">%2$d</xliff:g>
|
||||
apps have access to location</item>
|
||||
</plurals>
|
||||
<string name="location_app_permission_summary_location_on">{count, plural,
|
||||
=1 {# of {total} apps has access to location}
|
||||
other {# of {total} apps have access to location}
|
||||
}</string>
|
||||
<!-- [CHAR LIMIT=50] Location settings screen, sub category for recent location access -->
|
||||
<string name="location_category_recent_location_access">Recent access</string>
|
||||
<!-- Location settings screen, displayed when there're more than three recent location access apps [CHAR LIMIT=30] -->
|
||||
@@ -3319,10 +3311,10 @@
|
||||
<!-- Category title listing recently used apps [CHAR_LIMIT=50]-->
|
||||
<string name="recent_app_category_title">Recently opened apps</string>
|
||||
<!-- Preference title for showing all apps on device [CHAR_LIMIT=50]-->
|
||||
<plurals name="see_all_apps_title">
|
||||
<item quantity="one">See all apps</item>
|
||||
<item quantity="other">See all %1$d apps</item>
|
||||
</plurals>
|
||||
<string name="see_all_apps_title">{count, plural,
|
||||
=1 {See all apps}
|
||||
other {See all # apps}
|
||||
}</string>
|
||||
|
||||
<!-- Title of the dialog that asks the user to contact the IT admin to reset password [CHAR LIMIT=40] -->
|
||||
<string name="forgot_password_title">Contact your IT admin</string>
|
||||
@@ -3352,10 +3344,10 @@
|
||||
<!-- Manage applications, label that appears next to the cache size -->
|
||||
<string name="cache_size_label">Cache</string>
|
||||
<!-- Manage applications, individual application info storage screen. Describes the number of URIs (directories or files) an app has been granted access (by another apps)-->
|
||||
<plurals name="uri_permissions_text">
|
||||
<item quantity="one">1 item</item>
|
||||
<item quantity="other">%d items</item>
|
||||
</plurals>
|
||||
<string name="uri_permissions_text">{count, plural,
|
||||
=1 {1 item}
|
||||
other {# items}
|
||||
}</string>
|
||||
<!-- Manage applications, individual application info storage screen. Button below list of URIs. -->
|
||||
<string name="clear_uri_btn_text">Clear access</string>
|
||||
<!-- Manage applications, Header name used for other controls -->
|
||||
@@ -9629,10 +9621,10 @@
|
||||
<!-- Label explaining that the the number of apps is an estimation. [CHAR LIMIT=NONE] -->
|
||||
<string name="enterprise_privacy_apps_count_estimation_info">Number of apps is estimated. It may not include apps installed outside of the Play Store.</string>
|
||||
<!-- Summary indicating the number of apps that a label (e.g. installed apps or apps granted a particular permission) refers to. The number shown is a minimum as there may be additional apps we do not know about. [CHAR LIMIT=NONE] -->
|
||||
<plurals name="enterprise_privacy_number_packages_lower_bound">
|
||||
<item quantity="one">Minimum <xliff:g id="count">%d</xliff:g> app</item>
|
||||
<item quantity="other">Minimum <xliff:g id="count">%d</xliff:g> apps</item>
|
||||
</plurals>
|
||||
<string name="enterprise_privacy_number_packages_lower_bound">{count, plural,
|
||||
=1 {Minimum # app}
|
||||
other {Minimum # apps}
|
||||
}</string>
|
||||
<!-- Label indicating that the admin granted one or more apps access to the device's location. [CHAR LIMIT=NONE] -->
|
||||
<string name="enterprise_privacy_location_access">Location permissions</string>
|
||||
<!-- Label indicating that the admin granted one or more apps access to the microphone. [CHAR LIMIT=NONE] -->
|
||||
@@ -9642,10 +9634,10 @@
|
||||
<!-- Label indicating that the admin set one or more apps as defaults for common actions (e.g. open browser, send e-mail). [CHAR LIMIT=NONE] -->
|
||||
<string name="enterprise_privacy_enterprise_set_default_apps">Default apps</string>
|
||||
<!-- Summary indicating the number of apps that a label (e.g. installed apps or apps granted a particular permission) refers to. [CHAR LIMIT=NONE] -->
|
||||
<plurals name="enterprise_privacy_number_packages">
|
||||
<item quantity="one"><xliff:g id="count">%d</xliff:g> app</item>
|
||||
<item quantity="other"><xliff:g id="count">%d</xliff:g> apps</item>
|
||||
</plurals>
|
||||
<string name="enterprise_privacy_number_packages">{count, plural,
|
||||
=1 {# app}
|
||||
other {# apps}
|
||||
}</string>
|
||||
<!-- Label explaining that the current input method was set by the admin. [CHAR LIMIT=NONE] -->
|
||||
<string name="enterprise_privacy_input_method">Default keyboard</string>
|
||||
<!-- Summary indicating the input method set by the admin. [CHAR LIMIT=NONE] -->
|
||||
@@ -9665,10 +9657,10 @@
|
||||
<!-- Label explaining that the admin installed trusted CA certificates in work profile. [CHAR LIMIT=NONE] -->
|
||||
<string name="enterprise_privacy_ca_certs_work">Trusted credentials in your work profile</string>
|
||||
<!-- Summary indicating the number of trusted CA certificates installed by the admin. The number shown is a minimum as there may be additional CA certificates we do not know about. [CHAR LIMIT=NONE] -->
|
||||
<plurals name="enterprise_privacy_number_ca_certs">
|
||||
<item quantity="one">Minimum <xliff:g id="count">%d</xliff:g> CA certificate</item>
|
||||
<item quantity="other">Minimum <xliff:g id="count">%d</xliff:g> CA certificates</item>
|
||||
</plurals>
|
||||
<string name="enterprise_privacy_number_ca_certs">{count, plural,
|
||||
=1 {Minimum # CA certificate}
|
||||
other {Minimum # CA certificates}
|
||||
}</string>
|
||||
<!-- Label explaining that the admin can lock the device and change the user's password. [CHAR LIMIT=NONE] -->
|
||||
<string name="enterprise_privacy_lock_device">Admin can lock the device and reset password</string>
|
||||
<!-- Label explaining that the admin can wipe the device remotely. [CHAR LIMIT=NONE] -->
|
||||
@@ -9678,10 +9670,10 @@
|
||||
<!-- Label explaining that the admin configured the work profile to wipe itself when the password is mistyped too many times. [CHAR LIMIT=NONE] -->
|
||||
<string name="enterprise_privacy_failed_password_wipe_work">Failed password attempts before deleting work profile data</string>
|
||||
<!-- Summary indicating the number of mistyped passwords after which the device or work profile wipes itself. [CHAR LIMIT=NONE] -->
|
||||
<plurals name="enterprise_privacy_number_failed_password_wipe">
|
||||
<item quantity="one"><xliff:g id="count">%d</xliff:g> attempt</item>
|
||||
<item quantity="other"><xliff:g id="count">%d</xliff:g> attempts</item>
|
||||
</plurals>
|
||||
<string name="enterprise_privacy_number_failed_password_wipe">{count, plural,
|
||||
=1 {# attempt}
|
||||
other {# attempts}
|
||||
}</string>
|
||||
<!-- Message indicating that the device is enterprise-managed by a Device Owner [CHAR LIMIT=NONE] -->
|
||||
<string name="do_disclosure_generic">This device is managed by your organization.</string>
|
||||
<!-- Message indicating that the device is enterprise-managed by a Device Owner [CHAR LIMIT=NONE] -->
|
||||
@@ -9742,26 +9734,26 @@
|
||||
|
||||
<!-- Strings for displaying which applications were set as default for specific actions. -->
|
||||
<!-- Title for the apps that have been set as default handlers of camera-related intents. [CHAR LIMIT=30] -->
|
||||
<plurals name="default_camera_app_title">
|
||||
<item quantity="one">Camera app</item>
|
||||
<item quantity="other">Camera apps</item>
|
||||
</plurals>
|
||||
<string name="default_camera_app_title">{count, plural,
|
||||
=1 {Camera app}
|
||||
other {Camera apps}
|
||||
}</string>
|
||||
<!-- Title for the app that has been set as default handler of calendar-related intents. [CHAR LIMIT=30] -->
|
||||
<string name="default_calendar_app_title">Calendar app</string>
|
||||
<!-- Title for the app that has been set as default handler of contacts-related intents. [CHAR LIMIT=30] -->
|
||||
<string name="default_contacts_app_title">Contacts app</string>
|
||||
<!-- Title for the apps that have been set as default handlers of new email intents. [CHAR LIMIT=30] -->
|
||||
<plurals name="default_email_app_title">
|
||||
<item quantity="one">Email client app</item>
|
||||
<item quantity="other">Email client apps</item>
|
||||
</plurals>
|
||||
<string name="default_email_app_title">{count, plural,
|
||||
=1 {Email client app}
|
||||
other {Email client apps}
|
||||
}</string>
|
||||
<!-- Title for the app that has been set as default handler of geo-related intents. [CHAR LIMIT=30] -->
|
||||
<string name="default_map_app_title">Map app</string>
|
||||
<!-- Title for the apps that have been set as default handlers of call-related intents. [CHAR LIMIT=30] -->
|
||||
<plurals name="default_phone_app_title">
|
||||
<item quantity="one">Phone app</item>
|
||||
<item quantity="other">Phone apps</item>
|
||||
</plurals>
|
||||
<string name="default_phone_app_title">{count, plural,
|
||||
=1 {Phone app}
|
||||
other {Phone apps}
|
||||
}</string>
|
||||
<!-- Template for concatenating two app names -->
|
||||
<string name="app_names_concatenation_template_2"><xliff:g id="first_app_name">%1$s</xliff:g>, <xliff:g id="second_app_name">%2$s</xliff:g></string>
|
||||
<!-- Template for concatenating three app names -->
|
||||
@@ -9844,10 +9836,10 @@
|
||||
<string name="credman_credentials">Password and identity services</string>
|
||||
<!-- Summary for passwords settings that shows how many passwords are saved for each autofill
|
||||
service. [CHAR LIMIT=NONE] -->
|
||||
<plurals name="autofill_passwords_count">
|
||||
<item quantity="one"><xliff:g id="count">%1$d</xliff:g> password</item>
|
||||
<item quantity="other"><xliff:g id="count">%1$d</xliff:g> passwords</item>
|
||||
</plurals>
|
||||
<string name="autofill_passwords_count">{count, plural,
|
||||
=1 {# password}
|
||||
other {# passwords}
|
||||
}</string>
|
||||
<!-- DO NOT TRANSLATE Summary placeholder for when the passwords count is still loading or is
|
||||
unavailable. -->
|
||||
<string name="autofill_passwords_count_placeholder" translatable="false">\u2014</string>
|
||||
@@ -10625,10 +10617,10 @@
|
||||
<string name="accessibility_usage_title">Accessibility usage</string>
|
||||
|
||||
<!-- Summary for the accessibility usage preference in the Privacy page. [CHAR LIMIT=NONE] -->
|
||||
<plurals name="accessibility_usage_summary">
|
||||
<item quantity="one">1 app has full access to your device</item>
|
||||
<item quantity="other"><xliff:g id="service_count">%1$d</xliff:g> apps have full access to your device</item>
|
||||
</plurals>
|
||||
<string name="accessibility_usage_summary">{count, plural,
|
||||
=1 {1 app has full access to your device}
|
||||
other {# apps have full access to your device}
|
||||
}</string>
|
||||
|
||||
<!-- Label for the title on wfc disclaimer fragment. [CHAR LIMIT=40] -->
|
||||
<string name="wfc_disclaimer_title_text">Important information</string>
|
||||
|
@@ -57,6 +57,7 @@ import androidx.preference.SwitchPreference;
|
||||
|
||||
import com.android.settings.network.ProxySubscriptionManager;
|
||||
import com.android.settings.network.SubscriptionUtil;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -674,9 +675,8 @@ public class IccLockSettings extends SettingsPreferenceFragment
|
||||
} else if (attemptsRemaining == 1) {
|
||||
displayMessage = mRes.getString(R.string.wrong_pin_code_one, attemptsRemaining);
|
||||
} else if (attemptsRemaining > 1) {
|
||||
displayMessage = mRes
|
||||
.getQuantityString(R.plurals.wrong_pin_code, attemptsRemaining,
|
||||
attemptsRemaining);
|
||||
displayMessage = StringUtil.getIcuPluralsString(getPrefContext(), attemptsRemaining,
|
||||
R.string.wrong_pin_code);
|
||||
} else {
|
||||
displayMessage = mRes.getString(R.string.pin_failed);
|
||||
}
|
||||
|
@@ -58,6 +58,7 @@ import com.android.settingslib.applications.AppUtils;
|
||||
import com.android.settingslib.applications.ApplicationsState.Callbacks;
|
||||
import com.android.settingslib.applications.StorageStatsSource;
|
||||
import com.android.settingslib.applications.StorageStatsSource.AppStorageStats;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
import com.android.settingslib.widget.ActionButtonsPreference;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
|
||||
@@ -438,9 +439,8 @@ public class AppStorageSettings extends AppInfoWithHeader
|
||||
int numberResources = entry.getValue().value;
|
||||
Preference pref = new Preference(getPrefContext());
|
||||
pref.setTitle(entry.getKey());
|
||||
pref.setSummary(getPrefContext().getResources()
|
||||
.getQuantityString(R.plurals.uri_permissions_text, numberResources,
|
||||
numberResources));
|
||||
pref.setSummary(StringUtil.getIcuPluralsString(mUri.getContext(), numberResources,
|
||||
R.string.uri_permissions_text));
|
||||
pref.setSelectable(false);
|
||||
pref.setLayoutResource(R.layout.horizontal_preference);
|
||||
pref.setOrder(order);
|
||||
|
@@ -142,9 +142,8 @@ public class AppsPreferenceController extends BasePreferenceController implement
|
||||
@Override
|
||||
protected void onCountComplete(int num) {
|
||||
if (!mRecentApps.isEmpty()) {
|
||||
mSeeAllPref.setTitle(
|
||||
mContext.getResources().getQuantityString(R.plurals.see_all_apps_title,
|
||||
num, num));
|
||||
mSeeAllPref.setTitle(StringUtil.getIcuPluralsString(mContext, num,
|
||||
R.string.see_all_apps_title));
|
||||
} else {
|
||||
mAllAppsInfoPref.setSummary(mContext.getString(R.string.apps_summary, num));
|
||||
}
|
||||
|
@@ -55,6 +55,7 @@ import com.android.internal.os.IResultReceiver;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
import com.android.settingslib.widget.AppPreference;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
@@ -153,9 +154,8 @@ public class PasswordsPreferenceController extends BasePreferenceController
|
||||
passwordCount.observe(
|
||||
mLifecycleOwner, count -> {
|
||||
// TODO(b/169455298): Validate the result.
|
||||
final CharSequence summary =
|
||||
mContext.getResources().getQuantityString(
|
||||
R.plurals.autofill_passwords_count, count, count);
|
||||
final CharSequence summary = StringUtil.getIcuPluralsString(mContext, count,
|
||||
R.string.autofill_passwords_count);
|
||||
pref.setSummary(summary);
|
||||
});
|
||||
// TODO(b/169455298): Limit the number of concurrent queries.
|
||||
|
@@ -47,6 +47,7 @@ import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStart;
|
||||
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
||||
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||
|
||||
public class BuildNumberPreferenceController extends BasePreferenceController implements
|
||||
@@ -181,9 +182,8 @@ public class BuildNumberPreferenceController extends BasePreferenceController im
|
||||
mDevHitToast.cancel();
|
||||
}
|
||||
mDevHitToast = Toast.makeText(mContext,
|
||||
mContext.getResources().getQuantityString(
|
||||
R.plurals.show_dev_countdown, mDevHitCountdown,
|
||||
mDevHitCountdown),
|
||||
StringUtil.getIcuPluralsString(mContext, mDevHitCountdown,
|
||||
R.string.show_dev_countdown),
|
||||
Toast.LENGTH_SHORT);
|
||||
mDevHitToast.show();
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ import com.android.settings.applications.ApplicationFeatureProvider;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
public abstract class AdminGrantedPermissionsPreferenceControllerBase
|
||||
extends AbstractPreferenceController implements PreferenceControllerMixin {
|
||||
@@ -51,9 +52,8 @@ public abstract class AdminGrantedPermissionsPreferenceControllerBase
|
||||
if (num == 0) {
|
||||
mHasApps = false;
|
||||
} else {
|
||||
preference.setSummary(mContext.getResources().getQuantityString(
|
||||
R.plurals.enterprise_privacy_number_packages_lower_bound,
|
||||
num, num));
|
||||
preference.setSummary(StringUtil.getIcuPluralsString(mContext, num,
|
||||
R.string.enterprise_privacy_number_packages_lower_bound));
|
||||
mHasApps = true;
|
||||
}
|
||||
preference.setVisible(mHasApps);
|
||||
|
@@ -22,6 +22,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
public abstract class CaCertsPreferenceControllerBase
|
||||
extends AbstractPreferenceController implements PreferenceControllerMixin {
|
||||
@@ -36,9 +37,8 @@ public abstract class CaCertsPreferenceControllerBase
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
final int certs = getNumberOfCaCerts();
|
||||
preference.setSummary(mContext.getResources().getQuantityString(
|
||||
R.plurals.enterprise_privacy_number_ca_certs, certs, certs));
|
||||
preference.setSummary(StringUtil.getIcuPluralsString(mContext, getNumberOfCaCerts(),
|
||||
R.string.enterprise_privacy_number_ca_certs));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -22,6 +22,7 @@ import com.android.settings.applications.ApplicationFeatureProvider;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
public class EnterpriseInstalledPackagesPreferenceController
|
||||
extends AbstractPreferenceController implements PreferenceControllerMixin {
|
||||
@@ -47,9 +48,8 @@ public class EnterpriseInstalledPackagesPreferenceController
|
||||
available = false;
|
||||
} else {
|
||||
available = true;
|
||||
preference.setSummary(mContext.getResources().getQuantityString(
|
||||
R.plurals.enterprise_privacy_number_packages_lower_bound, num,
|
||||
num));
|
||||
preference.setSummary(StringUtil.getIcuPluralsString(mContext, num,
|
||||
R.string.enterprise_privacy_number_packages_lower_bound));
|
||||
|
||||
}
|
||||
preference.setVisible(available);
|
||||
|
@@ -40,6 +40,7 @@ import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.users.UserFeatureProvider;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -192,16 +193,16 @@ public class EnterpriseSetDefaultAppsListPreferenceController extends
|
||||
case CONTACTS:
|
||||
return context.getString(R.string.default_contacts_app_title);
|
||||
case PHONE:
|
||||
return context.getResources()
|
||||
.getQuantityString(R.plurals.default_phone_app_title, appCount);
|
||||
return StringUtil.getIcuPluralsString(context, appCount,
|
||||
R.string.default_phone_app_title);
|
||||
case MAP:
|
||||
return context.getString(R.string.default_map_app_title);
|
||||
case EMAIL:
|
||||
return context.getResources()
|
||||
.getQuantityString(R.plurals.default_email_app_title, appCount);
|
||||
return StringUtil.getIcuPluralsString(context, appCount,
|
||||
R.string.default_email_app_title);
|
||||
case CAMERA:
|
||||
return context.getResources()
|
||||
.getQuantityString(R.plurals.default_camera_app_title, appCount);
|
||||
return StringUtil.getIcuPluralsString(context, appCount,
|
||||
R.string.default_camera_app_title);
|
||||
default:
|
||||
throw new IllegalStateException("Unknown type of default " + typeOfDefault);
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.users.UserFeatureProvider;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
public class EnterpriseSetDefaultAppsPreferenceController
|
||||
extends AbstractPreferenceController implements PreferenceControllerMixin {
|
||||
@@ -44,8 +45,8 @@ public class EnterpriseSetDefaultAppsPreferenceController
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
final int num = getNumberOfEnterpriseSetDefaultApps();
|
||||
preference.setSummary(mContext.getResources().getQuantityString(
|
||||
R.plurals.enterprise_privacy_number_packages, num, num));
|
||||
preference.setSummary(StringUtil.getIcuPluralsString(mContext, num,
|
||||
R.string.enterprise_privacy_number_packages));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -22,6 +22,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
public abstract class FailedPasswordWipePreferenceControllerBase
|
||||
extends AbstractPreferenceController implements PreferenceControllerMixin {
|
||||
@@ -39,9 +40,8 @@ public abstract class FailedPasswordWipePreferenceControllerBase
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
final int failedPasswordsBeforeWipe = getMaximumFailedPasswordsBeforeWipe();
|
||||
preference.setSummary(mContext.getResources().getQuantityString(
|
||||
R.plurals.enterprise_privacy_number_failed_password_wipe,
|
||||
failedPasswordsBeforeWipe, failedPasswordsBeforeWipe));
|
||||
preference.setSummary(StringUtil.getIcuPluralsString(mContext, failedPasswordsBeforeWipe,
|
||||
R.string.enterprise_privacy_number_failed_password_wipe));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -21,6 +21,7 @@ import android.content.Context;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
|
||||
public class ManageDeviceAdminPreferenceController extends BasePreferenceController {
|
||||
@@ -47,8 +48,8 @@ public class ManageDeviceAdminPreferenceController extends BasePreferenceControl
|
||||
}
|
||||
|
||||
// TODO: override
|
||||
return mContext.getResources().getQuantityString(R.plurals.number_of_device_admins,
|
||||
activeAdmins, activeAdmins);
|
||||
return StringUtil.getIcuPluralsString(mContext, activeAdmins,
|
||||
R.string.number_of_device_admins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -46,6 +46,7 @@ import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -218,8 +219,8 @@ public class LocaleListEditor extends RestrictedSettingsFragment {
|
||||
return;
|
||||
}
|
||||
|
||||
final String title = getResources().getQuantityString(R.plurals.dlg_remove_locales_title,
|
||||
checkedCount);
|
||||
final String title = StringUtil.getIcuPluralsString(getContext(), checkedCount,
|
||||
R.string.dlg_remove_locales_title);
|
||||
mShowingRemoveDialog = true;
|
||||
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
|
@@ -16,9 +16,12 @@ import androidx.preference.Preference;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class AppLocationPermissionPreferenceController extends
|
||||
@@ -56,9 +59,11 @@ public class AppLocationPermissionPreferenceController extends
|
||||
if (mNumTotal == -1 || mNumHasLocation == -1) {
|
||||
return mContext.getString(R.string.location_settings_loading_app_permission_stats);
|
||||
}
|
||||
return mContext.getResources().getQuantityString(
|
||||
R.plurals.location_app_permission_summary_location_on, mNumHasLocation,
|
||||
mNumHasLocation, mNumTotal);
|
||||
Map<String, Object> arguments = new HashMap<>();
|
||||
arguments.put("count", mNumHasLocation);
|
||||
arguments.put("total", mNumTotal);
|
||||
return StringUtil.getIcuPluralsString(mContext, arguments,
|
||||
R.string.location_app_permission_summary_location_on);
|
||||
} else {
|
||||
return mContext.getString(R.string.location_app_permission_summary_location_off);
|
||||
}
|
||||
|
@@ -85,6 +85,7 @@ import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
import com.android.settingslib.widget.FooterPreference;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
@@ -1130,22 +1131,21 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
|
||||
|
||||
private String getSavedNetworkSettingsSummaryText(
|
||||
int numSavedNetworks, int numSavedSubscriptions) {
|
||||
if (getResources() == null) {
|
||||
if (getContext() == null) {
|
||||
Log.w(TAG, "getSavedNetworkSettingsSummaryText shouldn't run if resource is not ready");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (numSavedSubscriptions == 0) {
|
||||
return getResources().getQuantityString(R.plurals.wifi_saved_access_points_summary,
|
||||
numSavedNetworks, numSavedNetworks);
|
||||
return StringUtil.getIcuPluralsString(getContext(), numSavedNetworks,
|
||||
R.string.wifi_saved_access_points_summary);
|
||||
} else if (numSavedNetworks == 0) {
|
||||
return getResources().getQuantityString(
|
||||
R.plurals.wifi_saved_passpoint_access_points_summary,
|
||||
numSavedSubscriptions, numSavedSubscriptions);
|
||||
return StringUtil.getIcuPluralsString(getContext(), numSavedSubscriptions,
|
||||
R.string.wifi_saved_passpoint_access_points_summary);
|
||||
} else {
|
||||
final int numTotalEntries = numSavedNetworks + numSavedSubscriptions;
|
||||
return getResources().getQuantityString(R.plurals.wifi_saved_all_access_points_summary,
|
||||
numTotalEntries, numTotalEntries);
|
||||
return StringUtil.getIcuPluralsString(getContext(), numTotalEntries,
|
||||
R.string.wifi_saved_all_access_points_summary);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -780,46 +780,38 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
messages.add(getString(R.string.lockpassword_illegal_character));
|
||||
break;
|
||||
case NOT_ENOUGH_UPPER_CASE:
|
||||
messages.add(getResources().getQuantityString(
|
||||
R.plurals.lockpassword_password_requires_uppercase,
|
||||
error.requirement, error.requirement));
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(), error.requirement,
|
||||
R.string.lockpassword_password_requires_uppercase));
|
||||
break;
|
||||
case NOT_ENOUGH_LOWER_CASE:
|
||||
messages.add(getResources().getQuantityString(
|
||||
R.plurals.lockpassword_password_requires_lowercase,
|
||||
error.requirement, error.requirement));
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(), error.requirement,
|
||||
R.string.lockpassword_password_requires_lowercase));
|
||||
break;
|
||||
case NOT_ENOUGH_LETTERS:
|
||||
messages.add(getResources().getQuantityString(
|
||||
R.plurals.lockpassword_password_requires_letters,
|
||||
error.requirement, error.requirement));
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(), error.requirement,
|
||||
R.string.lockpassword_password_requires_letters));
|
||||
break;
|
||||
case NOT_ENOUGH_DIGITS:
|
||||
messages.add(getResources().getQuantityString(
|
||||
R.plurals.lockpassword_password_requires_numeric,
|
||||
error.requirement, error.requirement));
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(), error.requirement,
|
||||
R.string.lockpassword_password_requires_numeric));
|
||||
break;
|
||||
case NOT_ENOUGH_SYMBOLS:
|
||||
messages.add(getResources().getQuantityString(
|
||||
R.plurals.lockpassword_password_requires_symbols,
|
||||
error.requirement, error.requirement));
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(), error.requirement,
|
||||
R.string.lockpassword_password_requires_symbols));
|
||||
break;
|
||||
case NOT_ENOUGH_NON_LETTER:
|
||||
messages.add(getResources().getQuantityString(
|
||||
R.plurals.lockpassword_password_requires_nonletter,
|
||||
error.requirement, error.requirement));
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(), error.requirement,
|
||||
R.string.lockpassword_password_requires_nonletter));
|
||||
break;
|
||||
case NOT_ENOUGH_NON_DIGITS:
|
||||
messages.add(getResources().getQuantityString(
|
||||
R.plurals.lockpassword_password_requires_nonnumerical,
|
||||
error.requirement, error.requirement));
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(), error.requirement,
|
||||
R.string.lockpassword_password_requires_nonnumerical));
|
||||
break;
|
||||
case TOO_SHORT:
|
||||
messages.add(getResources().getQuantityString(
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(), error.requirement,
|
||||
mIsAlphaMode
|
||||
? R.plurals.lockpassword_password_too_short
|
||||
: R.plurals.lockpassword_pin_too_short,
|
||||
error.requirement, error.requirement));
|
||||
? R.string.lockpassword_password_too_short
|
||||
: R.string.lockpassword_pin_too_short));
|
||||
break;
|
||||
case TOO_SHORT_WHEN_ALL_NUMERIC:
|
||||
messages.add(
|
||||
@@ -827,11 +819,10 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
R.string.lockpassword_password_too_short_all_numeric));
|
||||
break;
|
||||
case TOO_LONG:
|
||||
messages.add(getResources().getQuantityString(
|
||||
mIsAlphaMode
|
||||
? R.plurals.lockpassword_password_too_long
|
||||
: R.plurals.lockpassword_pin_too_long,
|
||||
error.requirement + 1, error.requirement + 1));
|
||||
messages.add(StringUtil.getIcuPluralsString(getContext(),
|
||||
error.requirement + 1, mIsAlphaMode
|
||||
? R.string.lockpassword_password_too_long
|
||||
: R.string.lockpassword_pin_too_long));
|
||||
break;
|
||||
case CONTAINS_SEQUENCE:
|
||||
messages.add(getString(R.string.lockpassword_pin_no_sequential_digits));
|
||||
|
@@ -25,6 +25,7 @@ import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -60,7 +61,7 @@ public class AccessibilityUsagePreferenceController extends BasePreferenceContro
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
return mContext.getResources().getQuantityString(R.plurals.accessibility_usage_summary,
|
||||
mEnabledServiceInfos.size(), mEnabledServiceInfos.size());
|
||||
return StringUtil.getIcuPluralsString(mContext, mEnabledServiceInfos.size(),
|
||||
R.string.accessibility_usage_summary);
|
||||
}
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.security.SecurityFeatureProvider;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
public class ManageTrustAgentsPreferenceController extends BasePreferenceController {
|
||||
|
||||
@@ -56,9 +57,8 @@ public class ManageTrustAgentsPreferenceController extends BasePreferenceControl
|
||||
preference.setSummary(R.string.disabled_because_no_backup_security);
|
||||
} else if (numberOfTrustAgent > 0) {
|
||||
preference.setEnabled(true);
|
||||
preference.setSummary(mContext.getResources().getQuantityString(
|
||||
R.plurals.manage_trust_agents_summary_on,
|
||||
numberOfTrustAgent, numberOfTrustAgent));
|
||||
preference.setSummary(StringUtil.getIcuPluralsString(mContext, numberOfTrustAgent,
|
||||
R.string.manage_trust_agents_summary_on));
|
||||
} else {
|
||||
preference.setEnabled(true);
|
||||
preference.setSummary(R.string.manage_trust_agents_summary);
|
||||
|
@@ -75,6 +75,7 @@ import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
import com.android.settingslib.wifi.WifiSavedConfigUtils;
|
||||
import com.android.wifitrackerlib.WifiEntry;
|
||||
import com.android.wifitrackerlib.WifiEntry.ConnectCallback;
|
||||
@@ -915,17 +916,19 @@ public class WifiSettings extends RestrictedSettingsFragment
|
||||
|
||||
private String getSavedNetworkSettingsSummaryText(
|
||||
int numSavedNetworks, int numSavedSubscriptions) {
|
||||
if (getContext() == null) {
|
||||
return "";
|
||||
}
|
||||
if (numSavedSubscriptions == 0) {
|
||||
return getResources().getQuantityString(R.plurals.wifi_saved_access_points_summary,
|
||||
numSavedNetworks, numSavedNetworks);
|
||||
return StringUtil.getIcuPluralsString(getContext(), numSavedNetworks,
|
||||
R.string.wifi_saved_access_points_summary);
|
||||
} else if (numSavedNetworks == 0) {
|
||||
return getResources().getQuantityString(
|
||||
R.plurals.wifi_saved_passpoint_access_points_summary,
|
||||
numSavedSubscriptions, numSavedSubscriptions);
|
||||
return StringUtil.getIcuPluralsString(getContext(), numSavedSubscriptions,
|
||||
R.string.wifi_saved_passpoint_access_points_summary);
|
||||
} else {
|
||||
final int numTotalEntries = numSavedNetworks + numSavedSubscriptions;
|
||||
return getResources().getQuantityString(R.plurals.wifi_saved_all_access_points_summary,
|
||||
numTotalEntries, numTotalEntries);
|
||||
return StringUtil.getIcuPluralsString(getContext(), numTotalEntries,
|
||||
R.string.wifi_saved_all_access_points_summary);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -33,6 +33,7 @@ import androidx.preference.Preference;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.applications.ApplicationFeatureProvider;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -80,6 +81,8 @@ public abstract class AdminGrantedPermissionsPreferenceControllerTestBase {
|
||||
}).when(mFeatureFactory.applicationFeatureProvider)
|
||||
.calculateNumberOfAppsWithAdminGrantedPermissions(eq(mPermissions),
|
||||
eq(async), any());
|
||||
when(mContext.getResources().getString(R.string.enterprise_privacy_number_packages_lower_bound))
|
||||
.thenReturn("Minimum # apps");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -92,8 +95,8 @@ public abstract class AdminGrantedPermissionsPreferenceControllerTestBase {
|
||||
assertThat(preference.isVisible()).isFalse();
|
||||
|
||||
setNumberOfPackagesWithAdminGrantedPermissions(20, true /* async */);
|
||||
when(mContext.getResources().getQuantityString(
|
||||
R.plurals.enterprise_privacy_number_packages_lower_bound, 20, 20))
|
||||
when(StringUtil.getIcuPluralsString(mContext, 20,
|
||||
R.string.enterprise_privacy_number_packages_lower_bound))
|
||||
.thenReturn("minimum 20 apps");
|
||||
mController.updateState(preference);
|
||||
assertThat(preference.getSummary()).isEqualTo("minimum 20 apps");
|
||||
|
@@ -18,6 +18,8 @@ package com.android.settings.enterprise;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -29,6 +31,7 @@ import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -59,8 +62,10 @@ public abstract class CaCertsPreferenceControllerTestBase {
|
||||
public void testUpdateState() {
|
||||
final Preference preference = new Preference(mContext, null, 0, 0);
|
||||
|
||||
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
|
||||
10, 10)).thenReturn("10 certs");
|
||||
when(mContext.getResources().getString(R.string.enterprise_privacy_number_ca_certs))
|
||||
.thenReturn("# certs");
|
||||
when(StringUtil.getIcuPluralsString(mContext, 10,
|
||||
R.string.enterprise_privacy_number_ca_certs)).thenReturn("10 certs");
|
||||
mockGetNumberOfCaCerts(10);
|
||||
mController.updateState(preference);
|
||||
assertThat(preference.getSummary()).isEqualTo("10 certs");
|
||||
|
@@ -33,6 +33,7 @@ import androidx.preference.Preference;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.applications.ApplicationFeatureProvider;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -75,6 +76,8 @@ public class EnterpriseInstalledPackagesPreferenceControllerTest {
|
||||
}
|
||||
}).when(mFeatureFactory.applicationFeatureProvider)
|
||||
.calculateNumberOfPolicyInstalledApps(eq(async), any());
|
||||
when(mContext.getResources().getString(R.string.enterprise_privacy_number_packages_lower_bound))
|
||||
.thenReturn("Minimum # apps");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -87,8 +90,8 @@ public class EnterpriseInstalledPackagesPreferenceControllerTest {
|
||||
assertThat(preference.isVisible()).isFalse();
|
||||
|
||||
setNumberOfEnterpriseInstalledPackages(20, true /* async */);
|
||||
when(mContext.getResources().getQuantityString(
|
||||
R.plurals.enterprise_privacy_number_packages_lower_bound, 20, 20))
|
||||
when(StringUtil.getIcuPluralsString(mContext, 20,
|
||||
R.string.enterprise_privacy_number_packages_lower_bound))
|
||||
.thenReturn("minimum 20 apps");
|
||||
mController.updateState(preference);
|
||||
assertThat(preference.getSummary()).isEqualTo("minimum 20 apps");
|
||||
|
@@ -93,7 +93,7 @@ public class EnterpriseSetDefaultAppsListPreferenceControllerTest {
|
||||
when(mContext.getString(R.string.default_browser_title)).thenReturn(BROWSER_TITLE);
|
||||
Resources resources = spy(mContext.getResources());
|
||||
when(mContext.getResources()).thenReturn(resources);
|
||||
when(resources.getQuantityString(R.plurals.default_phone_app_title, 2))
|
||||
when(resources.getString(R.string.default_phone_app_title))
|
||||
.thenReturn(PHONE_TITLE);
|
||||
when(mContext.getString(R.string.app_names_concatenation_template_2))
|
||||
.thenReturn("%1$s, %2$s");
|
||||
|
@@ -39,6 +39,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.applications.EnterpriseDefaultApps;
|
||||
import com.android.settings.applications.UserAppInfo;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -101,8 +102,10 @@ public final class EnterpriseSetDefaultAppsPreferenceControllerTest {
|
||||
setEnterpriseSetDefaultApps(EnterpriseDefaultApps.CALENDAR.getIntents(), 16);
|
||||
setEnterpriseSetDefaultApps(EnterpriseDefaultApps.CONTACTS.getIntents(), 32);
|
||||
setEnterpriseSetDefaultApps(EnterpriseDefaultApps.PHONE.getIntents(), 64);
|
||||
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_packages,
|
||||
127, 127)).thenReturn("127 apps");
|
||||
when(mContext.getResources().getString(R.string.enterprise_privacy_number_packages))
|
||||
.thenReturn("# apps");
|
||||
when(StringUtil.getIcuPluralsString(mContext, 127,
|
||||
R.string.enterprise_privacy_number_packages)).thenReturn("127 apps");
|
||||
|
||||
// As setEnterpriseSetDefaultApps uses fake Users, we need to list them via UserManager.
|
||||
configureUsers(64);
|
||||
|
@@ -29,6 +29,7 @@ import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -68,8 +69,10 @@ public abstract class FailedPasswordWipePreferenceControllerTestBase {
|
||||
final Preference preference = new Preference(mContext, null, 0, 0);
|
||||
|
||||
setMaximumFailedPasswordsBeforeWipe(10);
|
||||
when(mContext.getResources().getQuantityString(
|
||||
R.plurals.enterprise_privacy_number_failed_password_wipe, 10, 10))
|
||||
when(mContext.getResources().getString(
|
||||
R.string.enterprise_privacy_number_failed_password_wipe)).thenReturn("# attempts");
|
||||
when(StringUtil.getIcuPluralsString(mContext, 10,
|
||||
R.string.enterprise_privacy_number_failed_password_wipe))
|
||||
.thenReturn("10 attempts");
|
||||
mController.updateState(preference);
|
||||
assertThat(preference.getSummary()).isEqualTo("10 attempts");
|
||||
|
@@ -28,6 +28,7 @@ import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -70,7 +71,8 @@ public class ManageDeviceAdminPreferenceControllerTest {
|
||||
|
||||
when(mFeatureFactory.enterprisePrivacyFeatureProvider
|
||||
.getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile()).thenReturn(5);
|
||||
when(mResources.getQuantityString(R.plurals.number_of_device_admins, 5, 5))
|
||||
when(mResources.getString(R.string.number_of_device_admins)).thenReturn("# active apps");
|
||||
when(StringUtil.getIcuPluralsString(mContext, 5, R.string.number_of_device_admins))
|
||||
.thenReturn("5 active apps");
|
||||
mController.updateState(preference);
|
||||
assertThat(preference.getSummary()).isEqualTo("5 active apps");
|
||||
|
@@ -13,6 +13,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -22,6 +23,9 @@ import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class AppLocationPermissionPreferenceControllerTest {
|
||||
|
||||
@@ -86,8 +90,11 @@ public class AppLocationPermissionPreferenceControllerTest {
|
||||
mController.mNumHasLocation = 1;
|
||||
mController.mNumTotal = 1;
|
||||
|
||||
assertThat(mController.getSummary()).isEqualTo(mContext.getResources().getQuantityString(
|
||||
R.plurals.location_app_permission_summary_location_on, 1, 1, 1));
|
||||
Map<String, Object> arguments = new HashMap<>();
|
||||
arguments.put("count", 1);
|
||||
arguments.put("total", 1);
|
||||
assertThat(mController.getSummary()).isEqualTo(StringUtil.getIcuPluralsString(mContext,
|
||||
arguments, R.string.location_app_permission_summary_location_on));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -96,7 +103,10 @@ public class AppLocationPermissionPreferenceControllerTest {
|
||||
mController.mNumHasLocation = 5;
|
||||
mController.mNumTotal = 10;
|
||||
|
||||
assertThat(mController.getSummary()).isEqualTo(mContext.getResources().getQuantityString(
|
||||
R.plurals.location_app_permission_summary_location_on, 5, 5, 10));
|
||||
Map<String, Object> arguments = new HashMap<>();
|
||||
arguments.put("count", 5);
|
||||
arguments.put("total", 10);
|
||||
assertThat(mController.getSummary()).isEqualTo(StringUtil.getIcuPluralsString(mContext,
|
||||
arguments, R.string.location_app_permission_summary_location_on));
|
||||
}
|
||||
}
|
||||
|
@@ -75,6 +75,7 @@ import com.android.settings.wifi.ConnectedWifiEntryPreference;
|
||||
import com.android.settings.wifi.LongPressWifiEntryPreference;
|
||||
import com.android.settings.wifi.WifiConfigController2;
|
||||
import com.android.settings.wifi.WifiDialog2;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
import com.android.settingslib.widget.FooterPreference;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
import com.android.wifitrackerlib.WifiEntry;
|
||||
@@ -206,9 +207,8 @@ public class NetworkProviderSettingsTest {
|
||||
|
||||
assertThat(mNetworkProviderSettings.mSavedNetworksPreference.isVisible()).isTrue();
|
||||
assertThat(mNetworkProviderSettings.mSavedNetworksPreference.getSummary()).isEqualTo(
|
||||
mContext.getResources().getQuantityString(
|
||||
R.plurals.wifi_saved_access_points_summary,
|
||||
NUM_NETWORKS, NUM_NETWORKS));
|
||||
StringUtil.getIcuPluralsString(mContext, NUM_NETWORKS,
|
||||
R.string.wifi_saved_access_points_summary));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -220,9 +220,8 @@ public class NetworkProviderSettingsTest {
|
||||
|
||||
assertThat(mNetworkProviderSettings.mSavedNetworksPreference.isVisible()).isTrue();
|
||||
assertThat(mNetworkProviderSettings.mSavedNetworksPreference.getSummary()).isEqualTo(
|
||||
mContext.getResources().getQuantityString(
|
||||
R.plurals.wifi_saved_passpoint_access_points_summary,
|
||||
NUM_NETWORKS, NUM_NETWORKS));
|
||||
StringUtil.getIcuPluralsString(mContext, NUM_NETWORKS,
|
||||
R.string.wifi_saved_passpoint_access_points_summary));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -234,9 +233,8 @@ public class NetworkProviderSettingsTest {
|
||||
|
||||
assertThat(mNetworkProviderSettings.mSavedNetworksPreference.isVisible()).isTrue();
|
||||
assertThat(mNetworkProviderSettings.mSavedNetworksPreference.getSummary()).isEqualTo(
|
||||
mContext.getResources().getQuantityString(
|
||||
R.plurals.wifi_saved_all_access_points_summary,
|
||||
NUM_NETWORKS * 2, NUM_NETWORKS * 2));
|
||||
StringUtil.getIcuPluralsString(mContext, NUM_NETWORKS * 2,
|
||||
R.string.wifi_saved_all_access_points_summary));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -29,6 +29,7 @@ import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.security.trustagent.TrustAgentManager.TrustAgentComponentInfo;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -114,8 +115,8 @@ public class ManageTrustAgentsPreferenceControllerTest {
|
||||
|
||||
assertThat(mPreference.isEnabled()).isTrue();
|
||||
assertThat(mPreference.getSummary())
|
||||
.isEqualTo(mContext.getResources().getQuantityString(
|
||||
R.plurals.manage_trust_agents_summary_on, 1, 1));
|
||||
.isEqualTo(StringUtil.getIcuPluralsString(mContext, 1,
|
||||
R.string.manage_trust_agents_summary_on));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -56,6 +56,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.datausage.DataUsagePreference;
|
||||
import com.android.settings.testutils.shadow.ShadowDataUsageUtils;
|
||||
import com.android.settings.testutils.shadow.ShadowFragment;
|
||||
import com.android.settingslib.utils.StringUtil;
|
||||
import com.android.wifitrackerlib.WifiEntry;
|
||||
import com.android.wifitrackerlib.WifiPickerTracker;
|
||||
|
||||
@@ -130,9 +131,8 @@ public class WifiSettingsTest {
|
||||
|
||||
assertThat(mWifiSettings.mSavedNetworksPreference.isVisible()).isTrue();
|
||||
assertThat(mWifiSettings.mSavedNetworksPreference.getSummary()).isEqualTo(
|
||||
mContext.getResources().getQuantityString(
|
||||
R.plurals.wifi_saved_access_points_summary,
|
||||
NUM_NETWORKS, NUM_NETWORKS));
|
||||
StringUtil.getIcuPluralsString(mContext, NUM_NETWORKS,
|
||||
R.string.wifi_saved_access_points_summary));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -144,9 +144,8 @@ public class WifiSettingsTest {
|
||||
|
||||
assertThat(mWifiSettings.mSavedNetworksPreference.isVisible()).isTrue();
|
||||
assertThat(mWifiSettings.mSavedNetworksPreference.getSummary()).isEqualTo(
|
||||
mContext.getResources().getQuantityString(
|
||||
R.plurals.wifi_saved_passpoint_access_points_summary,
|
||||
NUM_NETWORKS, NUM_NETWORKS));
|
||||
StringUtil.getIcuPluralsString(mContext, NUM_NETWORKS,
|
||||
R.string.wifi_saved_passpoint_access_points_summary));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -158,9 +157,8 @@ public class WifiSettingsTest {
|
||||
|
||||
assertThat(mWifiSettings.mSavedNetworksPreference.isVisible()).isTrue();
|
||||
assertThat(mWifiSettings.mSavedNetworksPreference.getSummary()).isEqualTo(
|
||||
mContext.getResources().getQuantityString(
|
||||
R.plurals.wifi_saved_all_access_points_summary,
|
||||
NUM_NETWORKS*2, NUM_NETWORKS*2));
|
||||
StringUtil.getIcuPluralsString(mContext, NUM_NETWORKS * 2,
|
||||
R.string.wifi_saved_all_access_points_summary));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user