Move Telephony internal resource
Move Telephony internal resources to apk
Bug: 143289541
Test: verified using boot up that resource value is read
Change-Id: I0f8a550128c2938d1ae6fbe022d1b82432c45beb
diff --git a/Android.bp b/Android.bp
index 1e3bc6d..7267595 100644
--- a/Android.bp
+++ b/Android.bp
@@ -41,6 +41,26 @@
srcs: ["jarjar-rules-shared.txt"],
}
+android_app {
+ name: "telephony-resources",
+ installable: true,
+
+ resource_dirs: [
+ "res",
+ ],
+
+ platform_apis: true,
+ manifest: "AndroidManifest_Resources.xml",
+ export_package_resources: true,
+
+ product_variables: {
+ pdk: {
+ // enable this build only when platform library is available
+ enabled: false,
+ },
+ },
+}
+
java_library {
name: "telephony-common",
installable: true,
@@ -68,7 +88,9 @@
"ims-common",
"services",
"unsupportedappusage",
+ "telephony-resources",
],
+ required: ["telephony-resources"],
static_libs: [
"android.hardware.radio.config-V1.0-java-shallow",
"android.hardware.radio.config-V1.1-java-shallow",
diff --git a/AndroidManifest_Resources.xml b/AndroidManifest_Resources.xml
new file mode 100644
index 0000000..7afba27
--- /dev/null
+++ b/AndroidManifest_Resources.xml
@@ -0,0 +1,8 @@
+<!-- Manifest for telephony resources APK -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.telephony.resources">
+ <application
+ android:directBootAware="true"
+ android:hasCode="false">
+ </application>
+</manifest>
\ No newline at end of file
diff --git a/res/values/config.xml b/res/values/config.xml
new file mode 100644
index 0000000..5ea773e
--- /dev/null
+++ b/res/values/config.xml
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2020, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds. Do not translate.
+
+ NOTE: The naming convention is "config_camelCaseValue". Some legacy
+ entries do not follow the convention, but all new entries should. -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- The RadioAccessFamilies supported by the device.
+ Empty is viewed as "all". Only used on devices which
+ don't support RIL_REQUEST_GET_RADIO_CAPABILITY
+ format is UMTS|LTE|... -->
+ <string translatable="false" name="config_radio_access_family"></string>
+
+ <!-- MMS user agent string -->
+ <string name="config_mms_user_agent" translatable="false"></string>
+
+ <!-- MMS user agent prolfile url -->
+ <string name="config_mms_user_agent_profile_url" translatable="false"></string>
+
+ <!-- Config determines whether to update phone object when voice registration
+ state changes. Voice radio tech change will always trigger an update of
+ phone object irrespective of this config -->
+ <bool name="config_switch_phone_on_voice_reg_state_change">true</bool>
+
+ <!-- Boolean indicating if restoring network selection should be skipped -->
+ <!-- The restoring is handled by modem if it is true-->
+ <bool translatable="false" name="skip_restoring_network_selection">false</bool>
+
+ <!-- An array of CDMA roaming indicators which means international roaming -->
+ <integer-array translatable="false" name="config_cdma_international_roaming_indicators" />
+
+ <!-- Configure mobile network MTU. The standard default is set here but each carrier
+ may have a specific value set in an overlay config.xml file. -->
+ <integer name="config_mobile_mtu">1500</integer>
+
+ <!-- Configure mobile tcp buffer sizes in the form:
+ rat-name:rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max
+ If no value is found for the rat-name in use, the system default will be applied.
+ -->
+ <string-array name="config_mobile_tcp_buffers">
+ </string-array>
+
+ <!-- flag to indicate if EF LI/EF PL should be used for system language -->
+ <bool name="config_use_sim_language_file">false</bool>
+
+ <!-- List of countries in which we display 'No service' on status bar
+ instead of 'Emergency calls only' when SIM is unready. -->
+ <string-array translatable="false" name="config_display_no_service_when_sim_unready">
+ <item>"DE"</item>
+ <item>"GB"</item>
+ <item>"JP"</item>
+ </string-array>
+
+ <!-- Flag indicating whether the surface flinger is inefficient
+ at performing a blur. Used by parts of the UI to turn off
+ the blur effect where it isn't worth the performance hit.
+ As of Honeycomb, blurring is not supported anymore. -->
+ <bool name="config_sf_slowBlur">true</bool>
+
+ <!-- set to false if we need to show user confirmation
+ when alpha identifier is not provided by the UICC -->
+ <bool name="config_stkNoAlphaUsrCnf">true</bool>
+
+ <!-- Number of physical SIM slots on the device. This includes both eSIM and pSIM slots, and
+ is not necessarily the same as the number of phones/logical modems supported by the device.
+ For example, a multi-sim device can have 2 phones/logical modems, but 3 physical slots,
+ or a single SIM device can have 1 phones/logical modems, but 2 physical slots (one eSIM
+ and one pSIM) -->
+ <integer name="config_num_physical_slots">1</integer>
+
+ <!-- Is the device capable of hot swapping an UICC Card -->
+ <bool name="config_hotswapCapable">false</bool>
+
+ <!-- An array of device capabilities defined by GSMA SGP.22 v2.0.
+ The first item is the capability name that the device supports. The second item is the
+ major version. The minor and revision versions are default to 0s.
+ The device capabilities and their definition in the spec are:
+ gsm : gsmSupportedRelease
+ utran : utranSupportedRelease
+ cdma1x : cdma2000onexSupportedRelease
+ hrpd : cdma2000hrpdSupportedRelease
+ ehrpd : cdma2000ehrpdSupportedRelease
+ eutran : eutranSupportedRelease
+ nfc : contactlessSupportedRelease
+ crl : rspCrlSupportedVersion
+ -->
+ <string-array translatable="false" name="config_telephonyEuiccDeviceCapabilities">
+ <!-- Example:
+ <item>"gsm,11"</item>
+ <item>"utran,11"</item>
+ <item>"cdma1x,1"</item>
+ <item>"hrpd,3"</item>
+ <item>"ehrpd,12"</item>
+ <item>"eutran,11"</item>
+ <item>"nfc,1"</item>
+ <item>"crl,1"</item>
+ -->
+ </string-array>
+
+ <!-- If this value is true, duplicate Source/Destination port fields
+ in WDP header of some carriers OMADM wap push are supported.
+ ex: MSGTYPE-TotalSegments-CurrentSegment
+ -SourcePortDestPort-SourcePortDestPort-OMADM PDU
+ If false, not supported. -->
+ <bool name="config_duplicate_port_omadm_wappush">false</bool>
+
+ <!-- Cellular network service package name to bind to by default. -->
+ <string name="config_wwan_network_service_package" translatable="false">com.android.phone</string>
+
+ <!-- Cellular network service class name to bind to by default.-->
+ <string name="config_wwan_network_service_class" translatable="false"></string>
+
+ <!-- IWLAN network service package name to bind to by default. If none is specified in an overlay, an
+ empty string is passed in -->
+ <string name="config_wlan_network_service_package" translatable="false"></string>
+
+ <!-- IWLAN network service class name to bind to by default. If none is specified in an overlay, an
+ empty string is passed in -->
+ <string name="config_wlan_network_service_class" translatable="false"></string>
+
+ <!-- Telephony qualified networks service package name to bind to by default. -->
+ <string name="config_qualified_networks_service_package" translatable="false"></string>
+
+ <!-- Telephony qualified networks service class name to bind to by default. -->
+ <string name="config_qualified_networks_service_class" translatable="false"></string>
+
+ <!-- Cellular data service package name to bind to by default. If none is specified in an overlay, an
+ empty string is passed in -->
+ <string name="config_wwan_data_service_package" translatable="false">com.android.phone</string>
+
+ <!-- IWLAN data service package name to bind to by default. If none is specified in an overlay, an
+ empty string is passed in -->
+ <string name="config_wlan_data_service_package" translatable="false"></string>
+
+ <!-- Cellular data service class name to bind to by default. If none is specified in an overlay, an
+ empty string is passed in -->
+ <string name="config_wwan_data_service_class" translatable="false"></string>
+
+ <!-- IWLAN data service class name to bind to by default. If none is specified in an overlay, an
+ empty string is passed in -->
+ <string name="config_wlan_data_service_class" translatable="false"></string>
+
+ <!-- Boolean indicating if RADIO POWER OFF is required on receiving SIM REFRESH with RESET.
+ This will be handled by modem if it is false. -->
+ <bool name="config_requireRadioPowerOffOnSimRefreshReset">false</bool>
+
+ <!-- Flag specifying whether the device will use the "allow_hold_in_ims_call" carrier config
+ option. When false, the device will support holding of IMS calls, regardless of the
+ carrier config setting. -->
+ <bool name="config_device_respects_hold_carrier_config">true</bool>
+
+ <!-- Whether to use voip audio mode for ims call -->
+ <bool name="config_use_voip_mode_for_ims">false</bool>
+
+ <!-- Enables built-in SIP phone capability -->
+ <bool name="config_built_in_sip_phone">true</bool>
+
+ <!-- Flag indicating apps will skip sending hold request before merge. In this case
+ IMS service implementation will do both.i.e.hold followed by merge. -->
+ <bool name="skipHoldBeforeMerge">true</bool>
+
+ <!-- Flag specifying whether VoLTE is available on device -->
+ <bool name="config_device_volte_available">false</bool>
+
+ <!-- Flag specifying whether VT is available on device -->
+ <bool name="config_device_vt_available">false</bool>
+
+ <!-- Flag specifying whether WFC over IMS is available on device -->
+ <bool name="config_device_wfc_ims_available">false</bool>
+
+ <!-- Flag specifying whether or not IMS will use the dynamic ImsResolver -->
+ <bool name="config_dynamic_bind_ims">false</bool>
+
+ <!-- ImsService package name to bind to by default. If none is specified in an overlay, an
+ empty string is passed in -->
+ <string name="config_ims_package"/>
+
+ <!-- Whether cbrs is supported on the device or not -->
+ <bool name="config_cbrs_supported" translatable="false">false</bool>
+
+ <!-- Enables SIP on WIFI only -->
+ <bool name="config_sip_wifi_only">false</bool>
+
+ <!-- Name of the dialog that is used to install the carrier app when the SIM is inserted -->
+ <string name="config_carrierAppInstallDialogComponent" translatable="false"
+ >com.android.simappdialog/com.android.simappdialog.InstallCarrierAppActivity</string>
+
+ <!-- The default mobile provisioning apn. Empty by default, maybe overridden by
+ an mcc/mnc specific config.xml -->
+ <string name="mobile_provisioning_apn" translatable="false"></string>
+
+ <!-- Number of retries Cell Data should attempt for a given error code before
+ restarting the modem.
+ Error codes not listed will not lead to modem restarts.
+ Array of "code#,retry#" -->
+ <string-array name="config_cell_retries_per_error_code">
+ </string-array>
+
+ <bool name="config_auto_attach_data_on_creation">true</bool>
+
+ <!-- Set to true if after a provisioning apn the radio should be restarted -->
+ <bool name="config_restartRadioAfterProvisioning">false</bool>
+
+ <!-- When true, indicates that the vendor's IMS implementation requires a workaround when
+ sending a request to enable or disable the camera while the video session is also
+ paused. -->
+ <bool name="config_useVideoPauseWorkaround">false</bool>
+
+ <!-- Use ERI text for network name on CDMA LTE -->
+ <bool name="config_LTE_eri_for_network_name">true</bool>
+
+ <!-- Flag indicating if the user is notified when the mobile network access is restricted -->
+ <bool name="config_user_notification_of_restrictied_mobile_access">true</bool>
+
+ <!-- Component name of the ICC hotswap prompt for restart dialog -->
+ <string name="config_iccHotswapPromptForRestartDialogComponent" translatable="false">@null</string>
+
+ <!-- call barring MMI code from TS 22.030 Annex B -->
+ <string-array translatable="false" name="config_callBarringMMI">
+ <item>33</item>
+ <item>331</item>
+ <item>332</item>
+ <item>35</item>
+ <item>351</item>
+ <item>330</item>
+ <item>333</item>
+ <item>353</item>
+ </string-array>
+
+ <!-- Do not translate. Defines the slots is Two Digit Number for dialing normally not USSD -->
+ <string-array name="config_twoDigitNumberPattern" translatable="false">
+ </string-array>
+
+ <!-- A array of regex to treat a SMS as VVM SMS if the message body matches.
+ Each item represents an entry, which consists of two parts:
+ a comma (,) separated list of MCCMNC the regex applies to, followed by a semicolon (;), and
+ then the regex itself. -->
+ <string-array name="config_vvmSmsFilterRegexes" translatable="false">
+ <!-- Verizon requires any SMS that starts with //VZWVVM to be treated as a VVM SMS-->
+ <item>310004,310010,310012,310013,310590,310890,310910,311110,311270,311271,311272,311273,311274,311275,311276,311277,311278,311279,311280,311281,311282,311283,311284,311285,311286,311287,311288,311289,311390,311480,311481,311482,311483,311484,311485,311486,311487,311488,311489;^//VZWVVM.*</item>
+ </string-array>
+
+ <!-- default telephony hardware configuration for this platform.
+ -->
+ <!-- this string array should be overridden by the device to present a list
+ telephony hardware resource. this is used by the telephony device controller
+ (TDC) to offer the basic capabilities of the hardware to the telephony
+ framework
+ -->
+ <!-- an array of "[hardware type],[hardware-uuid],[state],[[hardware-type specific]]"
+ with, [[hardware-type specific]] in:
+ - "[[ril-model],[rat],[max-active-voice],[max-active-data],[max-active-standby]]"
+ for 'modem' hardware
+ - "[[associated-modem-uuid]]"
+ for 'sim' hardware.
+ refer to HardwareConfig in com.android.internal.telephony for specific details/values
+ those elements can carry.
+ -->
+ <string-array translatable="false" name="config_telephonyHardware">
+ <!-- modem -->
+ <item>0,modem,0,0,0,1,1,1</item>
+ <!-- sim -->
+ <item>1,sim,0,modem</item>
+ </string-array>
+
+ <!-- Package name for the default CellBroadcastService module [DO NOT TRANSLATE] -->
+ <string name="cellbroadcast_default_package" translatable="false">com.android.cellbroadcastservice
+ </string>
+
+ <!-- For some operators, PDU has garbages. To fix it, need to use valid index -->
+ <integer name="config_valid_wappush_index">-1</integer>
+
+ <!-- Set to true if we need to not prefer an APN.
+ This is being added to enable a simple scenario of pre-paid
+ provisioning on some carriers, working around a bug (7305641)
+ where if the preferred is used we don't try the others. -->
+ <bool name="config_dontPreferApn">false</bool>
+
+</resources>
diff --git a/res/values/overlayable.xml b/res/values/overlayable.xml
new file mode 100644
index 0000000..1bbad36
--- /dev/null
+++ b/res/values/overlayable.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- The collection of resources for theming the appearance of a device -->
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <overlayable name="TelephonyCustomization">
+
+ <!-- START VENDOR CUSTOMIZATION -->
+ <policy type="product|system|vendor">
+ <item type="string" name="config_mms_user_agent"/>
+ <item type="string" name="config_mms_user_agent_profile_url"/>
+ <item type="bool" name="config_switch_phone_on_voice_reg_state_change"/>
+ <item type="bool" name="skip_restoring_network_selection"/>
+ <item type="bool" name="config_hotswapCapable"/>
+ <item type="array" name="config_cdma_international_roaming_indicators"/>
+ <item type="integer" name="config_mobile_mtu"/>
+ <item type="array" name="config_mobile_tcp_buffers"/>
+ <item type="bool" name="config_use_sim_language_file"/>
+ <item type="bool" name="config_requireRadioPowerOffOnSimRefreshReset"/>
+ <item type="bool" name="config_device_respects_hold_carrier_config"/>
+ <item type="array" name="config_display_no_service_when_sim_unready"/>
+ <item type="array" name="config_telephonyEuiccDeviceCapabilities"/>
+ <item type="integer" name="config_num_physical_slots"/>
+ <item type="bool" name="config_duplicate_port_omadm_wappush"/>
+ <item type="string" name="config_wwan_network_service_package"/>
+ <item type="string" name="config_wwan_network_service_class"/>
+ <item type="string" name="config_wlan_network_service_package"/>
+ <item type="string" name="config_wlan_network_service_class"/>
+ <item type="string" name="config_qualified_networks_service_package"/>
+ <item type="string" name="config_qualified_networks_service_class"/>
+ <item type="string" name="config_wwan_data_service_package"/>
+ <item type="string" name="config_wwan_data_service_class"/>
+ <item type="string" name="config_wlan_data_service_package"/>
+ <item type="string" name="config_wlan_data_service_class"/>
+ <item type="bool" name="config_use_voip_mode_for_ims"/>
+ <item type="bool" name="config_built_in_sip_phone"/>
+ <item type="bool" name="skipHoldBeforeMerge"/>
+ <item type="bool" name="config_device_volte_available"/>
+ <item type="bool" name="config_device_vt_available"/>
+ <item type="bool" name="config_device_wfc_ims_available"/>
+ <item type="bool" name="config_dynamic_bind_ims"/>
+ <item type="string" name="config_ims_package"/>
+ <item type="string" name="config_carrierAppInstallDialogComponent"/>
+ <item type="bool" name="config_cbrs_supported"/>
+ <item type="bool" name="config_sip_wifi_only"/>
+ <item type="string" name="mobile_provisioning_apn"/>
+ <item type="array" name="config_cell_retries_per_error_code"/>
+ <item type="bool" name="config_auto_attach_data_on_creation"/>
+ <item type="bool" name="config_restartRadioAfterProvisioning"/>
+ <item type="bool" name="config_useVideoPauseWorkaround"/>
+ <item type="bool" name="config_LTE_eri_for_network_name"/>
+ <item type="bool" name="config_user_notification_of_restrictied_mobile_access"/>
+ <item type="string" name="config_iccHotswapPromptForRestartDialogComponent"/>
+ <item type="array" name="config_callBarringMMI"/>
+ <item type="array" name="config_twoDigitNumberPattern"/>
+ <item type="array" name="config_vvmSmsFilterRegexes"/>
+ <item type="array" name="config_telephonyHardware"/>
+ <item type="string" name="cellbroadcast_default_package"/>
+ <item type="integer" name="config_valid_wappush_index"/>
+ <item type="bool" name="config_dontPreferApn"/>
+ </policy>
+ <!-- END VENDOR CUSTOMIZATION -->
+
+ </overlayable>
+</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
new file mode 100644
index 0000000..5cf34ec
--- /dev/null
+++ b/res/values/strings.xml
@@ -0,0 +1,412 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2020, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Do Not Translate: Alternate eri.xml -->
+ <string name="alternate_eri_file">/data/eri.xml</string>
+
+ <!-- This string array should be overridden by the manufacture to present a list of carrier-id,locale. The wifi regulatory domain is extracted from the locale information. This is used at startup to set system defaults by checking the system property ro.carrier for the carrier-id and searching through this array -->
+ <!-- An Array of [[Carrier-ID] -->
+ <!-- [default-locale]] -->
+ <string-array name="carrier_properties" translatable="false">
+ </string-array>
+
+ <!-- For GsmMmiCode.java --> <skip />
+ <!-- Displayed when the user dialed an MMI code whose function
+ could not be performed. This will be displayed in a toast. -->
+ <string name="mmiError">Connection problem or invalid MMI code.</string>
+ <!-- Displayed when the user dialed an MMI code whose function
+ could not be performed because FDN is enabled. This will be displayed in a toast. -->
+ <string name="mmiFdnError">Operation is restricted to fixed dialing numbers only.</string>
+ <!-- Displayed when a carrier does not support call forwarding queries when roaming. -->
+ <string name="mmiErrorWhileRoaming">Can not change call forwarding settings from your phone while you are roaming.</string>
+
+ <!-- What the UI should display for "voice mail" unless overridden by the SIM-->
+ <string name="defaultVoiceMailAlphaTag">Voicemail</string>
+
+ <!-- Displayed when a phone feature such as call barring was activated. -->
+ <string name="serviceEnabled">Service was enabled.</string>
+ <!-- Displayed in front of the list of a set of service classes
+ (voice, data, fax, etc.) that were enabled. -->
+ <string name="serviceEnabledFor">Service was enabled for:</string>
+ <!-- Displayed when a phone feature such as call forwarding was deactivated. -->
+ <string name="serviceDisabled">Service has been disabled.</string>
+ <!-- Displayed when a phone property such as a SIM password was registered. -->
+ <string name="serviceRegistered">Registration was successful.</string>
+ <!-- Displayed when a phone property such as a SIM password was erased. -->
+ <string name="serviceErased">Erasure was successful.</string>
+ <!-- Displayed when a SIM password was entered incorrectly. -->
+ <string name="passwordIncorrect">Incorrect password.</string>
+ <!-- Displayed when a phone feature triggered by an MMI code is complete. -->
+ <string name="mmiComplete">MMI complete.</string>
+ <!-- Displayed when a SIM PIN password is entered incorrectly. -->
+ <string name="badPin">The old PIN you typed isn\'t correct.</string>
+ <!-- Displayed when a SIM PUK password is entered incorrectly. -->
+ <string name="badPuk">The PUK you typed isn\'t correct.</string>
+ <!-- Displayed when SIM PIN passwords are entered inconsistently. -->
+ <string name="mismatchPin">The PINs you typed don\'t match.</string>
+ <!-- Displayed when a SIM PIN password is too long or too short. -->
+ <string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
+ <!-- Displayed when a SIM PUK password is too short. -->
+ <string name="invalidPuk">Type a PUK that is 8 numbers or longer.</string>
+ <!-- Displayed to prompt the user to type the PUK password to unlock
+ the SIM card. -->
+ <string name="needPuk">Your SIM card is PUK-locked. Type the PUK code to unlock it.</string>
+ <string name="needPuk2">Type PUK2 to unblock SIM card.</string>
+ <!-- Displayed when user attempts to change SIM PIN1 without enabling PIN1. -->
+ <string name="enablePin">Unsuccessful, enable SIM/RUIM Lock.</string>
+ <!-- Displayed when a SIM PIN/PUK is entered incorrectly. -->
+ <plurals name="pinpuk_attempts">
+ <item quantity="one">You have <xliff:g id="number">%d</xliff:g> remaining attempt before SIM is locked.</item>
+ <item quantity="other">You have <xliff:g id="number">%d</xliff:g> remaining attempts before SIM is locked.</item>
+ </plurals>
+ <!-- Title for the dialog used to display the user's IMEI number [CHAR LIMIT=10] -->
+ <string name="imei">IMEI</string>
+
+ <!-- Title for the dialog used to display the user's MEID number on CDMA network
+ [CHAR LIMIT=10] -->
+ <string name="meid">MEID</string>
+
+ <!-- Displayed as the title for a success/failure report enabling/disabling caller ID. -->
+ <string name="ClipMmi">Incoming Caller ID</string>
+ <!-- Displayed as the title for a success/failure report enabling/disabling caller ID. -->
+ <string name="ClirMmi">Outgoing Caller ID</string>
+ <!-- Displayed as the title for a success/failure report enabling/disabling connected line ID. -->
+ <string name="ColpMmi">Connected Line ID</string>
+ <!-- Displayed as the title for a success/failure report enabling/disabling connected line ID restriction. -->
+ <string name="ColrMmi">Connected Line ID Restriction</string>
+ <!-- Displayed as the title for a success/failure report enabling/disabling call forwarding. -->
+ <string name="CfMmi">Call forwarding</string>
+ <!-- Displayed as the title for a success/failure report enabling/disabling call waiting. -->
+ <string name="CwMmi">Call waiting</string>
+ <!-- Displayed as the title for a success/failure report enabling/disabling call barring. -->
+ <string name="BaMmi">Call barring</string>
+ <!-- Displayed as the title for a success/failure report changing the SIM password. -->
+ <string name="PwdMmi">Password change</string>
+ <!-- Displayed as the title for a success/failure report changing the SIM PIN. -->
+ <string name="PinMmi">PIN change</string>
+ <string name="CnipMmi">Calling number present</string>
+ <string name="CnirMmi">Calling number restricted</string>
+ <string name="ThreeWCMmi">Three way calling</string>
+ <string name="RuacMmi">Rejection of undesired annoying calls</string>
+ <string name="CndMmi">Calling number delivery</string>
+ <string name="DndMmi">Do not disturb</string>
+
+ <!-- Displayed to confirm to the user that caller ID will be restricted on the next call as usual. -->
+ <string name="CLIRDefaultOnNextCallOn">Caller ID defaults to restricted. Next call: Restricted</string>
+ <!-- Displayed to confirm to the user that caller ID will be not restricted on the next call even though it usually is. -->
+ <string name="CLIRDefaultOnNextCallOff">Caller ID defaults to restricted. Next call: Not restricted</string>
+ <!-- Displayed to confirm to the user that caller ID will not be restricted on the next call but usually is. -->
+ <string name="CLIRDefaultOffNextCallOn">Caller ID defaults to not restricted. Next call: Restricted</string>
+ <!-- Displayed to confirm to the user that caller ID will not be restricted on the next call or in general. -->
+ <string name="CLIRDefaultOffNextCallOff">Caller ID defaults to not restricted. Next call: Not restricted</string>
+
+
+ <!-- Displayed to tell the user that caller ID is not provisioned for their SIM. -->
+ <string name="serviceNotProvisioned">Service not provisioned.</string>
+ <!-- Displayed to tell the user that they cannot change the caller ID setting. -->
+ <string name="CLIRPermanent">You can\'t change the caller ID setting.</string>
+
+ <!-- Notification title to tell the user that data service is blocked by access control. [CHAR LIMIT=NOTIF_TITLE] -->
+ <string name="RestrictedOnDataTitle">No mobile data service</string>
+ <!-- Notification title to tell the user that emergency calling is blocked by access control. [CHAR LIMIT=NOTIF_TITLE] -->
+ <string name="RestrictedOnEmergencyTitle">Emergency calling unavailable</string>
+ <!-- Notification title to tell the user that normal service is blocked by access control. [CHAR LIMIT=NOTIF_TITLE] -->
+ <string name="RestrictedOnNormalTitle">No voice service</string>
+ <!-- Notification title to tell the user that all emergency and normal voice services are blocked by access control. [CHAR LIMIT=NOTIF_TITLE] -->
+ <string name="RestrictedOnAllVoiceTitle">No voice service or emergency calling</string>
+
+ <!-- Notification content to tell the user that voice/data/emergency service is blocked by access control. [CHAR LIMIT=NOTIF_BODY] -->
+ <string name="RestrictedStateContent">Temporarily turned off by your carrier</string>
+
+ <!-- Notification content to tell the user that voice/data/emergency service is blocked by access control when multiple SIMs are active. [CHAR LIMIT=NOTIF_BODY] -->
+ <string name="RestrictedStateContentMsimTemplate">Temporarily turned off by your carrier for SIM <xliff:g id="simNumber" example="1">%d</xliff:g></string>
+
+ <!-- Displayed to tell the user that they should switch their network preference. -->
+ <string name="NetworkPreferenceSwitchTitle">Can\u2019t reach mobile network</string>
+ <!-- Displayed to tell the user that they should switch their network preference. -->
+ <string name="NetworkPreferenceSwitchSummary">Try changing preferred network. Tap to change.</string>
+ <!-- Displayed to tell the user that emergency calls might not be available. -->
+ <string name="EmergencyCallWarningTitle">Emergency calling unavailable</string>
+ <!-- Displayed to tell the user that emergency calls might not be available. -->
+ <string name="EmergencyCallWarningSummary">Can\u2019t make emergency calls over Wi\u2011Fi</string>
+
+ <!-- Telephony notification channel name for a channel containing network alert notifications. -->
+ <string name="notification_channel_network_alert">Alerts</string>
+ <!-- Telephony notification channel name for a channel containing call forwarding notifications. -->
+ <string name="notification_channel_call_forward">Call forwarding</string>
+ <!-- Telephony notification channel name for a channel containing emergency callback mode notifications. -->
+ <string name="notification_channel_emergency_callback">Emergency callback mode</string>
+ <!-- Telephony notification channel name for a channel containing mobile data status notifications. -->
+ <string name="notification_channel_mobile_data_status">Mobile data status</string>
+ <!-- Telephony notification channel name for a channel containing sms notifications. -->
+ <string name="notification_channel_sms">SMS messages</string>
+ <!-- Telephony notification channel name for a channel containing voice mail notifications. -->
+ <string name="notification_channel_voice_mail">Voicemail messages</string>
+ <!-- Telephony notification channel name for a channel containing wifi calling status notifications. -->
+ <string name="notification_channel_wfc">Wi-Fi calling</string>
+ <!-- Telephony notification channel name for a channel containing SIM notifications -->
+ <string name="notification_channel_sim">SIM status</string>
+ <!-- Telephony notification channel name for a channel containing high priority SIM notifications -->
+ <string name="notification_channel_sim_high_prio">High priority SIM status</string>
+
+ <!-- Displayed to tell the user that peer changed TTY mode -->
+ <string name="peerTtyModeFull">Peer requested TTY Mode FULL</string>
+ <string name="peerTtyModeHco">Peer requested TTY Mode HCO</string>
+ <string name="peerTtyModeVco">Peer requested TTY Mode VCO</string>
+ <string name="peerTtyModeOff">Peer requested TTY Mode OFF</string>
+
+ <!-- Mappings between TS 27.007 +CFCC/+CLCK "service classes" and human-readable strings--> <skip />
+ <!-- Example: Service was enabled for: Voice, Data -->
+ <string name="serviceClassVoice">Voice</string>
+ <!-- Example: Service was enabled for: Voice, Data -->
+ <string name="serviceClassData">Data</string>
+ <!-- Example: Service was enabled for: Voice, FAX -->
+ <string name="serviceClassFAX">FAX</string>
+ <!-- Example: Service was enabled for: Voice, SMS -->
+ <string name="serviceClassSMS">SMS</string>
+ <!-- Meaning: asynchronous data. Example: Service was enabled for: Voice, Async -->
+ <string name="serviceClassDataAsync">Async</string>
+ <!-- Meaning: synchronous data. Example: Service was enabled for: Voice, Async -->
+ <string name="serviceClassDataSync">Sync</string>
+ <!-- Meaning: packet data. Example: Service was enabled for: Voice, Packet -->
+ <string name="serviceClassPacket">Packet</string>
+ <!-- Meaning: unknown. Example: Service was enabled for: Voice, PAD -->
+ <string name="serviceClassPAD">PAD</string>
+
+ <!-- CDMA Roaming Indicator Strings (non ERI)--> <skip />
+ <!-- Default roaming indicator text -->
+ <string name="roamingText0">Roaming Indicator On</string>
+ <string name="roamingText1">Roaming Indicator Off</string>
+ <string name="roamingText2">Roaming Indicator Flashing</string>
+ <string name="roamingText3">Out of Neighborhood</string>
+ <string name="roamingText4">Out of Building</string>
+ <string name="roamingText5">Roaming - Preferred System</string>
+ <string name="roamingText6">Roaming - Available System</string>
+ <string name="roamingText7">Roaming - Alliance Partner</string>
+ <string name="roamingText8">Roaming - Premium Partner</string>
+ <string name="roamingText9">Roaming - Full Service Functionality</string>
+ <string name="roamingText10">Roaming - Partial Service Functionality</string>
+ <string name="roamingText11">Roaming Banner On</string>
+ <string name="roamingText12">Roaming Banner Off</string>
+ <string name="roamingTextSearching">Searching for Service</string>
+
+ <!-- Displayed when WFC registration fails -->
+ <string name="wfcRegErrorTitle">Couldn\u2019t set up Wi\u2011Fi calling</string>
+ <!-- WFC Operator Error Messages showed as alerts -->
+ <string-array name="wfcOperatorErrorAlertMessages">
+ <item>To make calls and send messages over Wi-Fi, first ask your carrier to set up this service. Then turn on Wi-Fi calling again from Settings. (Error code: <xliff:g id="code" example="REG09 - No 911 Address">%1$s</xliff:g>)</item>
+ </string-array>
+ <!-- WFC Operator Error Messages showed as notifications -->
+ <string-array name="wfcOperatorErrorNotificationMessages">
+ <item>Issue registering Wi\u2011Fi calling with your carrier: <xliff:g id="code" example="REG09 - No 911 Address">%1$s</xliff:g></item>
+ </string-array>
+ <!-- Template for showing mobile network operator name while WFC is active -->
+ <string-array name="wfcSpnFormats" translatable="false">
+ <item>@string/wfcSpnFormat_spn</item>
+ <item>@string/wfcSpnFormat_spn_wifi_calling</item>
+ <item>@string/wfcSpnFormat_wlan_call</item>
+ <item>@string/wfcSpnFormat_spn_wlan_call</item>
+ <item>@string/wfcSpnFormat_spn_wifi</item>
+ <item>@string/wfcSpnFormat_wifi_calling_bar_spn</item>
+ <item>@string/wfcSpnFormat_spn_vowifi</item>
+ <item>@string/wfcSpnFormat_wifi_calling</item>
+ <item>@string/wfcSpnFormat_wifi</item>
+ <item>@string/wfcSpnFormat_wifi_calling_wo_hyphen</item>
+ <item>@string/wfcSpnFormat_vowifi</item>
+ <item>@string/wfcSpnFormat_spn_wifi_calling_vo_hyphen</item>
+ </string-array>
+
+ <!-- Ims supported call barring MMI code -->
+ <string-array translatable="false" name="config_callBarringMMI_for_ims">
+ <item>33</item>
+ <item>331</item>
+ <item>332</item>
+ <item>35</item>
+ <item>351</item>
+ <item>330</item>
+ <item>333</item>
+ <item>353</item>
+ </string-array>
+
+ <!-- Spn during Wi-Fi Calling: "<operator>" -->
+ <string name="wfcSpnFormat_spn"><xliff:g id="spn" example="Operator">%s</xliff:g></string>
+ <!-- Spn during Wi-Fi Calling: "<operator> Wi-Fi Calling" -->
+ <string name="wfcSpnFormat_spn_wifi_calling"><xliff:g id="spn" example="Operator">%s</xliff:g> Wi-Fi Calling</string>
+ <!-- Spn during Wi-Fi Calling: "<operator> WiFi Calling" -->
+ <string name="wfcSpnFormat_spn_wifi_calling_vo_hyphen"><xliff:g id="spn" example="Operator">%s</xliff:g> WiFi Calling</string>
+ <!-- Spn during Wi-Fi Calling: "WLAN Call" -->
+ <string name="wfcSpnFormat_wlan_call">WLAN Call</string>
+ <!-- Spn during Wi-Fi Calling: "<operator> WLAN Call" -->
+ <string name="wfcSpnFormat_spn_wlan_call"><xliff:g id="spn" example="Operator">%s</xliff:g> WLAN Call</string>
+ <!-- Spn during Wi-Fi Calling: "<operator> Wi-Fi" -->
+ <string name="wfcSpnFormat_spn_wifi"><xliff:g id="spn" example="Operator">%s</xliff:g> Wi-Fi</string>
+ <!-- Spn during Wi-Fi Calling: "WiFi Calling | <operator>" -->
+ <string name="wfcSpnFormat_wifi_calling_bar_spn">WiFi Calling | <xliff:g id="spn" example="Operator">%s</xliff:g></string>
+ <!-- Spn during Wi-Fi Calling: "<operator> VoWifi" -->
+ <string name="wfcSpnFormat_spn_vowifi"><xliff:g id="spn" example="Operator">%s</xliff:g> VoWifi</string>
+ <!-- Spn during Wi-Fi Calling: "Wi-Fi Calling" -->
+ <string name="wfcSpnFormat_wifi_calling">Wi-Fi Calling</string>
+ <!-- Spn during Wi-Fi Calling: "Wi-Fi" -->
+ <string name="wfcSpnFormat_wifi">Wi-Fi</string>
+ <!-- Spn during Wi-Fi Calling: "WiFi Calling" (without hyphen) -->
+ <string name="wfcSpnFormat_wifi_calling_wo_hyphen">WiFi Calling</string>
+ <!-- Spn during Wi-Fi Calling: "VoWifi" -->
+ <string name="wfcSpnFormat_vowifi">VoWifi</string>
+
+ <!--
+ {0} is one of "bearerServiceCode*"
+ {1} is dialing number
+ {2} is time in seconds
+
+ cfTemplateRegistered and cfTemplateRegisteredTime mean that a phone number
+ has been set but forwarding is not on.
+ --> <skip />
+ <!-- Displayed when the call forwarding query was not able to be forwarded. -->
+ <string name="cfTemplateNotForwarded"><xliff:g id="bearer_service_code">{0}</xliff:g>: Not forwarded</string>
+ <!-- Displayed when the call forwarding query was forwarded. -->
+ <string name="cfTemplateForwarded"><xliff:g id="bearer_service_code">{0}</xliff:g>: <xliff:g id="dialing_number">{1}</xliff:g></string>
+ <!-- Displayed when the call forwarding query will be forwarded after some time. -->
+ <string name="cfTemplateForwardedTime"><xliff:g id="bearer_service_code">{0}</xliff:g>: <xliff:g id="dialing_number">{1}</xliff:g> after <xliff:g id="time_delay">{2}</xliff:g> seconds</string>
+ <!-- Displayed when the call forwarding query was set but forwarding is not enabled. -->
+ <string name="cfTemplateRegistered"><xliff:g id="bearer_service_code">{0}</xliff:g>: Not forwarded</string>
+ <!-- Displayed when the call forwarding query was set but forwarding is not enabled. -->
+ <string name="cfTemplateRegisteredTime"><xliff:g id="bearer_service_code">{0}</xliff:g>: Not forwarded</string>
+
+ <!-- SMS per-application rate control Dialog --> <skip />
+ <!-- SMS_DIALOG: An SMS dialog is shown if an application tries to send too many SMSes. This is the title of that dialog. -->
+ <string name="sms_control_title">Sending SMS messages</string>
+ <!-- See SMS_DIALOG. This is the message shown in that dialog. [CHAR LIMIT=NONE] -->
+ <string name="sms_control_message"><b><xliff:g id="app_name">%1$s</xliff:g></b> is sending a large number of SMS messages. Do you want to allow this app to continue sending messages?</string>
+ <!-- See SMS_DIALOG. This is a button choice to allow sending the SMSes. [CHAR LIMIT=30] -->
+ <string name="sms_control_yes">Allow</string>
+ <!-- See SMS_DIALOG. This is a button choice to disallow sending the SMSes. [CHAR LIMIT=30] -->
+ <string name="sms_control_no">Deny</string>
+
+ <!-- SMS short code verification dialog. --> <skip />
+ <!-- The message text for the SMS short code confirmation dialog. [CHAR LIMIT=NONE] -->
+ <string name="sms_short_code_confirm_message"><b><xliff:g id="app_name">%1$s</xliff:g></b> would like to send a message to <b><xliff:g id="dest_address">%2$s</xliff:g></b>.</string>
+ <!-- Message details for the SMS short code confirmation dialog (possible premium short code). [CHAR LIMIT=NONE] -->
+ <string name="sms_short_code_details">This <b>may cause charges</b> on your mobile account.</string>
+ <!-- Message details for the SMS short code confirmation dialog (premium short code). [CHAR LIMIT=NONE] -->
+ <string name="sms_premium_short_code_details"><b>This will cause charges on your mobile account.</b></string>
+ <!-- Text of the approval button for the SMS short code confirmation dialog. [CHAR LIMIT=30] -->
+ <string name="sms_short_code_confirm_allow">Send</string>
+ <!-- Text of the cancel button for the SMS short code confirmation dialog. [CHAR LIMIT=30] -->
+ <string name="sms_short_code_confirm_deny">Cancel</string>
+ <!-- Text of the checkbox for the SMS short code confirmation dialog to remember the user's choice. [CHAR LIMIT=40] -->
+ <string name="sms_short_code_remember_choice">Remember my choice</string>
+ <!-- Text shown when remember checkbox is checked to inform the user how they may undo the setting. [CHAR LIMIT=40] -->
+ <string name="sms_short_code_remember_undo_instruction">You can change this later in Settings\u00A0>\u00A0Apps"</string>
+
+ <!-- Text of the approval button for the SMS short code confirmation dialog when checkbox is checked. [CHAR LIMIT=30] -->
+ <string name="sms_short_code_confirm_always_allow">Always Allow</string>
+ <!-- Text of the cancel button for the SMS short code confirmation dialog when checkbox is checked. [CHAR LIMIT=30] -->
+ <string name="sms_short_code_confirm_never_allow">Never Allow</string>
+
+ <!-- SIM swap and device reboot Dialog --> <skip />
+ <!-- See SIM_REMOVED_DIALOG. This is the title of that dialog. -->
+ <string name="sim_removed_title">SIM card removed</string>
+ <!-- See SIM_REMOVED_DIALOG. This is the message of that dialog. -->
+ <string name="sim_removed_message">The mobile network will be unavailable until you restart with a valid SIM card inserted.</string>
+ <!-- See SIM_REMOVED_DIALOG. This is the button of that dialog. -->
+ <string name="sim_done_button">Done</string>
+ <!-- See SIM_ADDED_DIALOG. This is the title of that dialog. -->
+ <string name="sim_added_title">SIM card added</string>
+ <!-- See SIM_ADDED_DIALOG. This is the message of that dialog. -->
+ <string name="sim_added_message">Restart your device to access the mobile network.</string>
+ <!-- See SIM_ADDED_DIALOG. This is the button of that dialog. -->
+ <string name="sim_restart_button">Restart</string>
+ <!-- See Carrier_App_Dialog. This is the message of that dialog. -->
+ <string name="install_carrier_app_notification_title">Activate mobile service</string>
+ <!-- Notification message that shows when the user inserts a SIM card that requires a carrier app download, but the app name is unknown -->
+ <string name="install_carrier_app_notification_text">Download the carrier app to activate your new SIM</string>
+ <!-- Notification message that shows when the user inserts a SIM card that requires a carrier app download. App name is known -->
+ <string name="install_carrier_app_notification_text_app_name">Download the <xliff:g id="app_name">%1$s</xliff:g> app to activate your new SIM</string>
+
+ <!-- See Carrier_App_Notification. This is the button of that dialog. -->
+ <string name="install_carrier_app_notification_button">Download app</string>
+ <!-- See carrier_app_notification. This is the headline. -->
+ <string name="carrier_app_notification_title">New SIM inserted</string>
+ <string name="carrier_app_notification_text">Tap to set it up</string>
+
+ <!-- STK sending DTMF, SMS, USSD, SS -->
+ <string name="sending">Sending\u2026</string>
+
+ <!-- STK launch Browser -->
+ <string name="launchBrowserDefault">Launch Browser?</string>
+
+ <!-- STK setup Call -->
+ <string name="SetupCallDefault">Accept call?</string>
+
+ <!-- Displayed when the USSD/SS request is modified by STK CC to a
+ different request. This will be displayed in a toast. -->
+ <string name="stk_cc_ussd_to_dial">USSD request changed to regular call</string>
+ <string name="stk_cc_ussd_to_ss">USSD request changed to SS request</string>
+ <string name="stk_cc_ussd_to_ussd">Changed to new USSD request</string>
+ <string name="stk_cc_ussd_to_dial_video">USSD request changed to video call</string>
+ <string name="stk_cc_ss_to_dial">SS request changed to regular call</string>
+ <string name="stk_cc_ss_to_dial_video">SS request changed to video call</string>
+ <string name="stk_cc_ss_to_ussd">SS request changed to USSD request</string>
+ <string name="stk_cc_ss_to_ss">Changed to new SS request</string>
+
+ <!-- Notification title shown when new SMS/MMS is received while the device is locked [CHAR LIMIT=NONE] -->
+ <string name="new_sms_notification_title">You have new messages</string>
+ <!-- Notification content shown when new SMS/MMS is received while the device is locked [CHAR LIMIT=NONE] -->
+ <string name="new_sms_notification_content">Open SMS app to view</string>
+
+ <!-- Label used by Telephony code, assigned as the display name for conference calls [CHAR LIMIT=60] -->
+ <string name="conference_call">Conference Call</string>
+
+ <!-- Title of notification when UE fails CS registration with MM reject cause code from network. -->
+ <string name="mmcc_authentication_reject">SIM not allowed for voice</string>
+ <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned for voice</string>
+ <string name="mmcc_illegal_ms">SIM not allowed for voice</string>
+ <string name="mmcc_illegal_me">Phone not allowed for voice</string>
+
+ <!-- Title of notification when UE fails to register network with MM reject cause code when multiple SIMs are active. -->
+ <string name="mmcc_authentication_reject_msim_template">SIM <xliff:g id="simNumber" example="1">%d</xliff:g> not allowed</string>
+ <string name="mmcc_imsi_unknown_in_hlr_msim_template">SIM <xliff:g id="simNumber" example="1">%d</xliff:g> not provisioned</string>
+ <string name="mmcc_illegal_ms_msim_template">SIM <xliff:g id="simNumber" example="1">%d</xliff:g> not allowed</string>
+ <string name="mmcc_illegal_me_msim_template">SIM <xliff:g id="simNumber" example="1">%d</xliff:g> not allowed</string>
+
+ <!-- Shown in the lock screen when there is emergency calls only mode. -->
+ <string name="emergency_calls_only" msgid="2485604591272668370">Emergency calls only</string>
+
+ <!-- On the keyguard screen, it shows the carrier the phone is connected to. This is displayed if the phone is not connected to a carrier.-->
+ <string name="lockscreen_carrier_default">No service</string>
+
+ <!-- Status message for a remote route attempting to connect -->
+ <string name="media_route_status_connecting">Connecting...</string>
+
+ <!-- WFC, summary for Disabled -->
+ <string name="wifi_calling_off_summary">Off</string>
+ <!-- WFC, summary for Wi-Fi Preferred -->
+ <string name="wfc_mode_wifi_preferred_summary">Call over Wi-Fi</string>
+ <!-- WFC, summary for Mobile data Preferred -->
+ <string name="wfc_mode_cellular_preferred_summary">Call over mobile network</string>
+ <!-- WFC, summary for Wi-Fi Only -->
+ <string name="wfc_mode_wifi_only_summary">Wi-Fi only</string>
+
+ <!-- Sequence of characters used to separate message strings in keyguard. Typically just em-dash
+ with spaces on either side. [CHAR LIMIT=3] -->
+ <string name="kg_text_message_separator" product="default">" \u2014 "</string>
+
+</resources>
diff --git a/src/java/com/android/internal/telephony/TelephonyResourceUtils.java b/src/java/com/android/internal/telephony/TelephonyResourceUtils.java
new file mode 100644
index 0000000..2253103
--- /dev/null
+++ b/src/java/com/android/internal/telephony/TelephonyResourceUtils.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.internal.telephony.util;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.res.Resources;
+
+import com.android.telephony.Rlog;
+
+/**
+ * This class provides utility functions for Telephony Resources
+ */
+public final class TelephonyResourceUtils {
+ public static String TELEPHONY_RESOURCE_PACKAGE = "com.android.telephony.resources";
+ private static final String TAG = "TelephonyResourceUtils";
+
+ /**
+ * Retrieve resource for the telephony resource package.
+ */
+ public static Resources getTelephonyResources(Context context) {
+ try {
+ return context.getPackageManager()
+ .getResourcesForApplication(TELEPHONY_RESOURCE_PACKAGE);
+ } catch (PackageManager.NameNotFoundException ex) {
+ Rlog.e(TAG, "No resource package found");
+ }
+ return null;
+ }
+}
diff --git a/src/java/com/android/internal/telephony/cdma/CdmaInboundSmsHandler.java b/src/java/com/android/internal/telephony/cdma/CdmaInboundSmsHandler.java
index 6925a5d..7a6d6f9 100644
--- a/src/java/com/android/internal/telephony/cdma/CdmaInboundSmsHandler.java
+++ b/src/java/com/android/internal/telephony/cdma/CdmaInboundSmsHandler.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.res.Resources;
import android.os.Message;
import android.os.RemoteCallback;
import android.os.SystemProperties;
@@ -40,6 +39,7 @@
import com.android.internal.telephony.cdma.sms.BearerData;
import com.android.internal.telephony.cdma.sms.CdmaSmsAddress;
import com.android.internal.telephony.cdma.sms.SmsEnvelope;
+import com.android.internal.telephony.util.TelephonyResourceUtils;
import com.android.internal.util.HexDump;
import java.io.ByteArrayOutputStream;
@@ -63,8 +63,7 @@
// Callback used to process the result of an SCP message
private RemoteCallback mScpCallback;
- private final boolean mCheckForDuplicatePortsInOmadmWapPush = Resources.getSystem().getBoolean(
- com.android.internal.R.bool.config_duplicate_port_omadm_wappush);
+ private boolean mCheckForDuplicatePortsInOmadmWapPush = false;
// When TEST_MODE is on we allow the test intent to trigger an SMS CB alert
private static final boolean TEST_MODE = SystemProperties.getInt("ro.debuggable", 0) == 1;
@@ -80,8 +79,11 @@
Phone phone, CdmaSMSDispatcher smsDispatcher) {
super("CdmaInboundSmsHandler", context, storageMonitor, phone);
mSmsDispatcher = smsDispatcher;
- phone.mCi.setOnNewCdmaSms(getHandler(), EVENT_NEW_SMS, null);
+ mCheckForDuplicatePortsInOmadmWapPush = TelephonyResourceUtils
+ .getTelephonyResources(context).getBoolean(
+ com.android.telephony.resources.R.bool.config_duplicate_port_omadm_wappush);
+ phone.mCi.setOnNewCdmaSms(getHandler(), EVENT_NEW_SMS, null);
mCellBroadcastServiceManager.enable();
mScpCallback = new RemoteCallback(result -> {
if (result == null) {
diff --git a/telephony-resources/TelephonyResource.java b/telephony-resources/TelephonyResource.java
new file mode 100644
index 0000000..d048bb0
--- /dev/null
+++ b/telephony-resources/TelephonyResource.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.telephony.resources;
+
+/**
+ * A dummy class to force pick the R.class to apk
+ */
+final class TelephonyResource {
+ TelephonyResource() {
+ }
+}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java b/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java
index 7aa2851..4b19c72 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java
@@ -16,6 +16,7 @@
package com.android.internal.telephony;
+import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
@@ -652,6 +653,12 @@
invocation -> mSystemFeatures.contains((String) invocation.getArgument(0)))
.when(mPackageManager).hasSystemFeature(any());
+ try {
+ doReturn(mResources).when(mPackageManager).getResourcesForApplication(anyString());
+ } catch (NameNotFoundException ex) {
+ Log.d(TAG, "NameNotFoundException: " + ex);
+ }
+
doReturn(mBundle).when(mCarrierConfigManager).getConfigForSubId(anyInt());
//doReturn(mBundle).when(mCarrierConfigManager).getConfig(anyInt());
doReturn(mBundle).when(mCarrierConfigManager).getConfig();