Merge "Don't allow channel 0 for transmit apdu channel" into qt-dev
diff --git a/Android.mk b/Android.mk
index 775d795..8aff191 100644
--- a/Android.mk
+++ b/Android.mk
@@ -25,7 +25,8 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
         guava \
-        volley
+        volley \
+        android-support-annotations
 
 LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs))
 LOCAL_SRC_FILES += $(call all-proto-files-under, ecc/proto)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b4b4053..938d714 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -83,6 +83,7 @@
     <protected-broadcast android:name= "com.android.internal.telephony.CARRIER_VVM_PACKAGE_INSTALLED" />
     <protected-broadcast android:name= "com.android.cellbroadcastreceiver.GET_LATEST_CB_AREA_INFO" />
     <protected-broadcast android:name= "com.android.internal.telephony.ACTION_CARRIER_CERTIFICATE_DOWNLOAD" />
+    <protected-broadcast android:name= "com.android.internal.telephony.OPEN_DEFAULT_SMS_APP" />
     <protected-broadcast android:name= "android.telephony.action.SIM_CARD_STATE_CHANGED" />
     <protected-broadcast android:name= "android.telephony.action.SIM_APPLICATION_STATE_CHANGED" />
     <protected-broadcast android:name= "android.telephony.action.SIM_SLOT_STATUS_CHANGED" />
@@ -314,7 +315,7 @@
         <activity android:name="GsmUmtsCallForwardOptions"
                 android:label="@string/labelCF"
                 android:configChanges="orientation|screenSize|keyboardHidden"
-                android:theme="@style/SettingsLight">
+                android:theme="@style/DialerSettingsLight">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
             </intent-filter>
@@ -332,7 +333,7 @@
         <activity android:name="GsmUmtsAdditionalCallOptions"
                 android:label="@string/labelGSMMore"
                 android:configChanges="orientation|screenSize|keyboardHidden"
-                android:theme="@style/SettingsLight">
+                android:theme="@style/DialerSettingsLight">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
             </intent-filter>
@@ -350,7 +351,7 @@
         <!-- SIM PIN setting -->
         <activity android:name="EnableIccPinScreen"
                 android:label="@string/enable_pin"
-                android:theme="@style/SettingsLight">
+                android:theme="@style/DialerSettingsLight">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
@@ -359,7 +360,7 @@
 
         <activity android:name="ChangeIccPinScreen"
                 android:label="@string/change_pin"
-                android:theme="@style/SettingsLight">
+                android:theme="@style/DialerSettingsLight">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
@@ -468,6 +469,7 @@
             privileged processes can start them.
         -->
         <activity android:name=".euicc.EuiccPrivilegedActionUiDispatcherActivity"
+                  android:theme="@android:style/Theme.NoDisplay"
                   android:permission="android.permission.CALL_PRIVILEGED">
             <!-- Max out priority to ensure nobody else will handle these intents. -->
             <intent-filter android:priority="1000">
@@ -605,6 +607,14 @@
             android:name="com.android.internal.telephony.uicc.ShowInstallAppNotificationReceiver"
             android:exported="false"/>
 
+        <activity
+            android:name="com.android.phone.settings.PickSmsSubscriptionActivity"
+            android:exported="false"
+            android:excludeFromRecents="true"
+            android:launchMode="singleTop"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+            android:theme="@style/Theme.Transparent"/>
+
         <service
             android:name="com.android.phone.vvm.RemoteVvmTaskManager"
             android:exported="false"/>
diff --git a/ecc/input/eccdata.txt b/ecc/input/eccdata.txt
index 403cad7..bf5d92c 100644
--- a/ecc/input/eccdata.txt
+++ b/ecc/input/eccdata.txt
@@ -600,8 +600,11 @@
 countries {
   iso_code: "DE"
   eccs {
-    phone_number: "112"
+    phone_number: "110"
     types: POLICE
+  }
+  eccs {
+    phone_number: "112"
     types: AMBULANCE
     types: FIRE
   }
diff --git a/ecc/output/eccdata b/ecc/output/eccdata
index 679bc36..2b9007a 100644
--- a/ecc/output/eccdata
+++ b/ecc/output/eccdata
Binary files differ
diff --git a/res/layout/emergency_information.xml b/res/layout/emergency_information.xml
index e925479..524387f 100644
--- a/res/layout/emergency_information.xml
+++ b/res/layout/emergency_information.xml
@@ -53,7 +53,7 @@
                     android:maxLines="1"
                     android:ellipsize="end"
                     android:lineHeight="@dimen/emergency_info_name_line_height"
-                    android:fontFamily="google-sans"
+                    android:fontFamily="@*android:string/config_headlineFontFamily"
                     android:textAppearance="@style/HeadlineTextAppearance"/>
                 <TextView
                     android:id="@+id/emergency_info_hint"
@@ -99,7 +99,7 @@
                 android:maxLines="2"
                 android:ellipsize="end"
                 android:lineHeight="@dimen/confirmed_emergency_info_line_height"
-                android:fontFamily="google-sans"
+                android:fontFamily="@*android:string/config_headlineFontFamily"
                 android:textAppearance="@style/PhoneCallHintTextAppearance"
                 android:text="@string/emergency_information_confirm_hint"/>
         </LinearLayout>
diff --git a/res/layout/emergency_shortcut_button.xml b/res/layout/emergency_shortcut_button.xml
index 2828926..3c5eaa2 100644
--- a/res/layout/emergency_shortcut_button.xml
+++ b/res/layout/emergency_shortcut_button.xml
@@ -57,7 +57,7 @@
                     android:maxLines="1"
                     android:ellipsize="end"
                     android:lineHeight="@dimen/phone_number_line_height"
-                    android:fontFamily="google-sans"
+                    android:fontFamily="@*android:string/config_headlineFontFamily"
                     android:textAppearance="@style/PhoneNumberTextAppearance"/>
                 <TextView
                     android:id="@+id/phone_number_description"
@@ -124,7 +124,7 @@
                     android:maxLines="2"
                     android:ellipsize="end"
                     android:lineHeight="@dimen/phone_call_hint_line_height"
-                    android:fontFamily="google-sans"
+                    android:fontFamily="@*android:string/config_headlineFontFamily"
                     android:textAppearance="@style/PhoneCallHintTextAppearance"/>
             </FrameLayout>
         </LinearLayout>
diff --git a/res/values-b+sr+Latn/strings.xml b/res/values-b+sr+Latn/strings.xml
index 089a247..7c2e09a 100644
--- a/res/values-b+sr+Latn/strings.xml
+++ b/res/values-b+sr+Latn/strings.xml
@@ -249,7 +249,7 @@
     <string name="data_enable_summary" msgid="2382798156640007971">"Omogućavanje potrošnje podataka"</string>
     <string name="dialog_alert_title" msgid="6751344986194435476">"Pažnja"</string>
     <string name="roaming" msgid="7894878421600247140">"Roming"</string>
-    <string name="roaming_enable" msgid="7331106985174381987">"Povezivanje sa uslugom za podatke tokom rominga"</string>
+    <string name="roaming_enable" msgid="7331106985174381987">"Poveži sa uslugom za podatke tokom rominga"</string>
     <string name="roaming_disable" msgid="1843417228755568110">"Povezivanje sa uslugom za podatke tokom rominga"</string>
     <string name="roaming_reenable_message" msgid="6843814381576397939">"Prenos podataka u romingu je isključen. Dodirnite da biste ga uključili."</string>
     <string name="roaming_notification_title" msgid="4749053220884743110">"Izgubili ste vezu za prenos mobilnih podataka"</string>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index 690956c..8383201 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -180,7 +180,7 @@
     <string name="preferred_network_mode_summary" msgid="1434820673166126609">"Canvia el mode de funcionament de la xarxa"</string>
     <string name="preferred_network_mode_dialogtitle" msgid="4048082093347807230">"Tipus de xarxa preferit"</string>
     <string name="forbidden_network" msgid="4384929668343563440">"(prohibit)"</string>
-    <string name="choose_network_title" msgid="4023911977543009350">"Tria la xarxa"</string>
+    <string name="choose_network_title" msgid="4023911977543009350">"Tria una xarxa"</string>
     <string name="network_disconnected" msgid="2227251609006103194">"Desconnectat"</string>
     <string name="network_connected" msgid="1288589103624338857">"Connectat"</string>
     <string name="network_connecting" msgid="4927203097283533783">"S\'està connectant..."</string>
@@ -210,32 +210,32 @@
     <item msgid="2828588917858484655">"TDSCDMA/CDMA/EVDO/GSM/WCDMA"</item>
     <item msgid="4989979948139945854">"LTE/TDSCDMA/CDMA/EVDO/GSM/WCDMA"</item>
   </string-array>
-    <string name="preferred_network_mode_wcdma_perf_summary" msgid="8521677230113533809">"Mode de xarxa preferit: WCDMA preferit"</string>
-    <string name="preferred_network_mode_gsm_only_summary" msgid="3352445413437453511">"Mode de xarxa preferit: només GSM"</string>
-    <string name="preferred_network_mode_wcdma_only_summary" msgid="2836897236221063413">"Mode de xarxa preferit: només WCDMA"</string>
-    <string name="preferred_network_mode_gsm_wcdma_summary" msgid="3161255745326408587">"Mode de xarxa preferit: GSM/WCDMA"</string>
-    <string name="preferred_network_mode_cdma_summary" msgid="3175690187294334241">"Mode de xarxa preferit: CDMA"</string>
-    <string name="preferred_network_mode_cdma_evdo_summary" msgid="8332063064712726618">"Mode de xarxa preferit: CDMA / EvDo"</string>
-    <string name="preferred_network_mode_cdma_only_summary" msgid="1309770926198634150">"Mode de xarxa preferit: només CDMA"</string>
-    <string name="preferred_network_mode_evdo_only_summary" msgid="8472220691721269155">"Mode de xarxa preferit: només EvDo"</string>
-    <string name="preferred_network_mode_cdma_evdo_gsm_wcdma_summary" msgid="4726682079415227330">"Mode de xarxa preferit: CDMA/EvDo/GSM/WCDMA"</string>
-    <string name="preferred_network_mode_lte_summary" msgid="574752287596469136">"Mode de xarxa preferit: LTE"</string>
-    <string name="preferred_network_mode_lte_gsm_wcdma_summary" msgid="8455358514068283935">"Mode de xarxa preferit: GSM/WCDMA/LTE"</string>
-    <string name="preferred_network_mode_lte_cdma_evdo_summary" msgid="228702246343742853">"Mode de xarxa preferit: CDMA+LTE/EVDO"</string>
-    <string name="preferred_network_mode_global_summary" msgid="1633134285545730364">"Mode de xarxa preferit: Global"</string>
-    <string name="preferred_network_mode_lte_wcdma_summary" msgid="9180775701594742750">"Mode de xarxa preferit: LTE/WCDMA"</string>
-    <string name="preferred_network_mode_lte_gsm_umts_summary" msgid="633315028976225026">"Mode de xarxa preferit: LTE/GSM/UMTS"</string>
-    <string name="preferred_network_mode_lte_cdma_summary" msgid="3722647806454528426">"Mode de xarxa preferit: LTE/CDMA"</string>
-    <string name="preferred_network_mode_tdscdma_summary" msgid="8021016193718678775">"Mode de xarxa preferit: TDSCDMA"</string>
-    <string name="preferred_network_mode_tdscdma_wcdma_summary" msgid="2405154895437348623">"Mode de xarxa preferit: TDSCDMA/WCDMA"</string>
-    <string name="preferred_network_mode_lte_tdscdma_summary" msgid="2104702896644235637">"Mode de xarxa preferit: LTE/TDSCDMA"</string>
-    <string name="preferred_network_mode_tdscdma_gsm_summary" msgid="4893784445338396204">"Mode de xarxa preferit: TDSCDMA/GSM"</string>
-    <string name="preferred_network_mode_lte_tdscdma_gsm_summary" msgid="1815169717046729757">"Mode de xarxa preferit: LTE/GSM/TDSCDMA"</string>
-    <string name="preferred_network_mode_tdscdma_gsm_wcdma_summary" msgid="2195358773359424099">"Mode de xarxa preferit: TDSCDMA/GSM/WCDMA"</string>
-    <string name="preferred_network_mode_lte_tdscdma_wcdma_summary" msgid="1181424059695667803">"Mode de xarxa preferit: LTE/TDSCDMA/WCDMA"</string>
-    <string name="preferred_network_mode_lte_tdscdma_gsm_wcdma_summary" msgid="2526539326505354382">"Mode de xarxa preferit: LTE/TDSCDMA/GSM/WCDMA"</string>
-    <string name="preferred_network_mode_tdscdma_cdma_evdo_gsm_wcdma_summary" msgid="8195248059196614939">"Mode de xarxa preferit: TDSCDMA/CDMA/EvDo/GSM/WCDMA"</string>
-    <string name="preferred_network_mode_lte_tdscdma_cdma_evdo_gsm_wcdma_summary" msgid="5596733053095592791">"Mode de xarxa preferit: LTE/TDSCDMA/CDMA/EvDo/GSM/WCDMA"</string>
+    <string name="preferred_network_mode_wcdma_perf_summary" msgid="8521677230113533809">"Mode de xarxa preferent: WCDMA preferit"</string>
+    <string name="preferred_network_mode_gsm_only_summary" msgid="3352445413437453511">"Mode de xarxa preferent: només GSM"</string>
+    <string name="preferred_network_mode_wcdma_only_summary" msgid="2836897236221063413">"Mode de xarxa preferent: només WCDMA"</string>
+    <string name="preferred_network_mode_gsm_wcdma_summary" msgid="3161255745326408587">"Mode de xarxa preferent: GSM/WCDMA"</string>
+    <string name="preferred_network_mode_cdma_summary" msgid="3175690187294334241">"Mode de xarxa preferent: CDMA"</string>
+    <string name="preferred_network_mode_cdma_evdo_summary" msgid="8332063064712726618">"Mode de xarxa preferent: CDMA / EvDo"</string>
+    <string name="preferred_network_mode_cdma_only_summary" msgid="1309770926198634150">"Mode de xarxa preferent: només CDMA"</string>
+    <string name="preferred_network_mode_evdo_only_summary" msgid="8472220691721269155">"Mode de xarxa preferent: només EvDo"</string>
+    <string name="preferred_network_mode_cdma_evdo_gsm_wcdma_summary" msgid="4726682079415227330">"Mode de xarxa preferent: CDMA/EvDo/GSM/WCDMA"</string>
+    <string name="preferred_network_mode_lte_summary" msgid="574752287596469136">"Mode de xarxa preferent: LTE"</string>
+    <string name="preferred_network_mode_lte_gsm_wcdma_summary" msgid="8455358514068283935">"Mode de xarxa preferent: GSM/WCDMA/LTE"</string>
+    <string name="preferred_network_mode_lte_cdma_evdo_summary" msgid="228702246343742853">"Mode de xarxa preferent: CDMA+LTE/EVDO"</string>
+    <string name="preferred_network_mode_global_summary" msgid="1633134285545730364">"Mode de xarxa preferent: Global"</string>
+    <string name="preferred_network_mode_lte_wcdma_summary" msgid="9180775701594742750">"Mode de xarxa preferent: LTE/WCDMA"</string>
+    <string name="preferred_network_mode_lte_gsm_umts_summary" msgid="633315028976225026">"Mode de xarxa preferent: LTE/GSM/UMTS"</string>
+    <string name="preferred_network_mode_lte_cdma_summary" msgid="3722647806454528426">"Mode de xarxa preferent: LTE/CDMA"</string>
+    <string name="preferred_network_mode_tdscdma_summary" msgid="8021016193718678775">"Mode de xarxa preferent: TDSCDMA"</string>
+    <string name="preferred_network_mode_tdscdma_wcdma_summary" msgid="2405154895437348623">"Mode de xarxa preferent: TDSCDMA/WCDMA"</string>
+    <string name="preferred_network_mode_lte_tdscdma_summary" msgid="2104702896644235637">"Mode de xarxa preferent: LTE/TDSCDMA"</string>
+    <string name="preferred_network_mode_tdscdma_gsm_summary" msgid="4893784445338396204">"Mode de xarxa preferent: TDSCDMA/GSM"</string>
+    <string name="preferred_network_mode_lte_tdscdma_gsm_summary" msgid="1815169717046729757">"Mode de xarxa preferent: LTE/GSM/TDSCDMA"</string>
+    <string name="preferred_network_mode_tdscdma_gsm_wcdma_summary" msgid="2195358773359424099">"Mode de xarxa preferent: TDSCDMA/GSM/WCDMA"</string>
+    <string name="preferred_network_mode_lte_tdscdma_wcdma_summary" msgid="1181424059695667803">"Mode de xarxa preferent: LTE/TDSCDMA/WCDMA"</string>
+    <string name="preferred_network_mode_lte_tdscdma_gsm_wcdma_summary" msgid="2526539326505354382">"Mode de xarxa preferent: LTE/TDSCDMA/GSM/WCDMA"</string>
+    <string name="preferred_network_mode_tdscdma_cdma_evdo_gsm_wcdma_summary" msgid="8195248059196614939">"Mode de xarxa preferent: TDSCDMA/CDMA/EvDo/GSM/WCDMA"</string>
+    <string name="preferred_network_mode_lte_tdscdma_cdma_evdo_gsm_wcdma_summary" msgid="5596733053095592791">"Mode de xarxa preferent: LTE/TDSCDMA/CDMA/EvDo/GSM/WCDMA"</string>
     <string name="call_category" msgid="5863978196309462052">"Trucades"</string>
     <string name="network_operator_category" msgid="4830701959205735636">"Xarxa"</string>
     <string name="enhanced_4g_lte_mode_title" msgid="522191650223239171">"Mode 4G LTE millorat"</string>
@@ -253,7 +253,7 @@
     <string name="roaming_disable" msgid="1843417228755568110">"Estableix connexió amb serveis de dades en itinerància"</string>
     <string name="roaming_reenable_message" msgid="6843814381576397939">"La itinerància de dades està desactivada. Toca per activar-la."</string>
     <string name="roaming_notification_title" msgid="4749053220884743110">"S\'ha perdut la connexió de dades mòbils"</string>
-    <string name="roaming_warning" msgid="1603164667540144353">"És possible que se\'t facturin càrrecs elevats."</string>
+    <string name="roaming_warning" msgid="1603164667540144353">"És possible que s\'apliquin càrrecs elevats."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"Contacta amb el proveïdor de xarxa per saber els preus."</string>
     <string name="roaming_alert_title" msgid="3654815360303826008">"Permetre la itinerància de dades?"</string>
     <string name="data_usage_title" msgid="4042209259808900283">"Ús de dades de l\'aplicació"</string>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index 1aef1e4..eb8f873 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -256,7 +256,7 @@
     <string name="roaming_warning" msgid="1603164667540144353">"Du kan risikere at skulle betale høje gebyrer."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"Kontakt din netværksudbyder for at få oplyst priser."</string>
     <string name="roaming_alert_title" msgid="3654815360303826008">"Vil du tillade dataroaming?"</string>
-    <string name="data_usage_title" msgid="4042209259808900283">"Dataforbrug fra apps"</string>
+    <string name="data_usage_title" msgid="4042209259808900283">"Dataforbrug i apps"</string>
     <string name="data_usage_template" msgid="8526428824844656364">"<xliff:g id="ID_1">%1$s</xliff:g> mobildata er brugt i perioden <xliff:g id="ID_2">%2$s</xliff:g>"</string>
     <string name="advanced_options_title" msgid="8074895510265488035">"Avanceret"</string>
     <string name="carrier_settings_euicc" msgid="6714062862127226405">"Mobilselskab"</string>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 7ea960d..0374ff3 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -172,7 +172,7 @@
     <string name="connect_later" msgid="2308119155752343975">"Momentan kann keine Verbindung zu diesem Netzwerk aufgebaut werden. Bitte versuche es später noch einmal."</string>
     <string name="registration_done" msgid="495135664535876612">"In Netzwerk registriert."</string>
     <string name="already_auto" msgid="6067116884321285507">"Bereits automatisch ausgewählt."</string>
-    <string name="select_automatically" msgid="1046727200631770962">"Netzwerk automatisch auswählen"</string>
+    <string name="select_automatically" msgid="1046727200631770962">"Netz automatisch auswählen"</string>
     <string name="manual_mode_disallowed_summary" msgid="70662262085937277">"Nicht verfügbar bei Verbindung mit %1$s"</string>
     <string name="network_select_title" msgid="7733107364757544558">"Netzwerk"</string>
     <string name="register_automatically" msgid="6017849844573519637">"Automatische Registrierung..."</string>
@@ -249,14 +249,14 @@
     <string name="data_enable_summary" msgid="2382798156640007971">"Datennutzung zulassen"</string>
     <string name="dialog_alert_title" msgid="6751344986194435476">"Achtung"</string>
     <string name="roaming" msgid="7894878421600247140">"Roaming"</string>
-    <string name="roaming_enable" msgid="7331106985174381987">"Bei Roaming mit Datendienst verbinden"</string>
-    <string name="roaming_disable" msgid="1843417228755568110">"Bei Roaming mit Datendienst verbinden"</string>
+    <string name="roaming_enable" msgid="7331106985174381987">"Mobile Daten auch bei Roaming nutzen"</string>
+    <string name="roaming_disable" msgid="1843417228755568110">"Mobile Daten auch bei Roaming nutzen"</string>
     <string name="roaming_reenable_message" msgid="6843814381576397939">"Daten-Roaming ist deaktiviert. Zum Aktivieren tippen."</string>
     <string name="roaming_notification_title" msgid="4749053220884743110">"Keine mobile Datenverbindung"</string>
     <string name="roaming_warning" msgid="1603164667540144353">"Es können hohe Gebühren anfallen."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"Wende dich an deinen Netzwerkanbieter, um Preisinformationen zu erhalten."</string>
     <string name="roaming_alert_title" msgid="3654815360303826008">"Daten-Roaming zulassen?"</string>
-    <string name="data_usage_title" msgid="4042209259808900283">"Datennutzung durch Apps"</string>
+    <string name="data_usage_title" msgid="4042209259808900283">"Datenverbrauch durch Apps"</string>
     <string name="data_usage_template" msgid="8526428824844656364">"Im Zeitraum <xliff:g id="ID_2">%2$s</xliff:g> genutzte mobile Daten: <xliff:g id="ID_1">%1$s</xliff:g>"</string>
     <string name="advanced_options_title" msgid="8074895510265488035">"Erweitert"</string>
     <string name="carrier_settings_euicc" msgid="6714062862127226405">"Mobilfunkanbieter"</string>
@@ -444,7 +444,7 @@
     <string name="simContacts_title" msgid="1861472842524839921">"Kontakte für Import auswählen"</string>
     <string name="simContacts_airplaneMode" msgid="5254946758982621072">"Deaktiviere den Flugmodus, um Kontakte von der SIM-Karte zu importieren."</string>
     <string name="enable_pin" msgid="5422767284133234860">"PIN-Abfrage für SIM-Karte aktivieren/deaktivieren"</string>
-    <string name="change_pin" msgid="9174186126330785343">"PIN ändern"</string>
+    <string name="change_pin" msgid="9174186126330785343">"SIM-PIN ändern"</string>
     <string name="enter_pin_text" msgid="8532615714751931951">"PIN der SIM-Karte:"</string>
     <string name="oldPinLabel" msgid="5287773661246368314">"Alte PIN"</string>
     <string name="newPinLabel" msgid="207488227285336897">"Neue PIN"</string>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index a29daa6..925f55c 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -248,14 +248,14 @@
     <string name="data_enabled" msgid="5972538663568715366">"داده‌ها فعال شدند"</string>
     <string name="data_enable_summary" msgid="2382798156640007971">"استفاده از داده مجاز است"</string>
     <string name="dialog_alert_title" msgid="6751344986194435476">"توجه"</string>
-    <string name="roaming" msgid="7894878421600247140">"رومینگ"</string>
-    <string name="roaming_enable" msgid="7331106985174381987">"اتصال به سرویس‌های داده هنگام رومینگ"</string>
-    <string name="roaming_disable" msgid="1843417228755568110">"اتصال به سرویس‌های داده هنگام رومینگ"</string>
-    <string name="roaming_reenable_message" msgid="6843814381576397939">"رومینگ داده خاموش شده است. برای روشن کردن آن، ضربه بزنید."</string>
+    <string name="roaming" msgid="7894878421600247140">"فراگردی"</string>
+    <string name="roaming_enable" msgid="7331106985174381987">"اتصال به سرویس‌های داده هنگام فراگردی"</string>
+    <string name="roaming_disable" msgid="1843417228755568110">"اتصال به سرویس‌های داده هنگام فراگردی"</string>
+    <string name="roaming_reenable_message" msgid="6843814381576397939">"فراگردی داده خاموش شده است. برای روشن کردن آن، ضربه بزنید."</string>
     <string name="roaming_notification_title" msgid="4749053220884743110">"اتصال داده تلفن همراه قطع شد"</string>
     <string name="roaming_warning" msgid="1603164667540144353">"شاید هزینه زیادی برای شما داشته باشد."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"برای قیمت با ارائه‌دهنده شبکه‌تان بررسی کنید."</string>
-    <string name="roaming_alert_title" msgid="3654815360303826008">"رومینگ داده مجاز است؟"</string>
+    <string name="roaming_alert_title" msgid="3654815360303826008">"فراگردی داده مجاز است؟"</string>
     <string name="data_usage_title" msgid="4042209259808900283">"مصرف داده برنامه"</string>
     <string name="data_usage_template" msgid="8526428824844656364">"<xliff:g id="ID_1">%1$s</xliff:g> داده تلفن همراه مصرف‌شده در <xliff:g id="ID_2">%2$s</xliff:g>"</string>
     <string name="advanced_options_title" msgid="8074895510265488035">"پیشرفته"</string>
@@ -374,7 +374,7 @@
     <string name="network_4G" msgid="2723512640529983138">"‏4G (توصیه شده)"</string>
     <string name="network_global" msgid="1323190488685355309">"سراسری"</string>
     <string name="cdma_system_select_title" msgid="5757657769327732833">"انتخاب سیستم"</string>
-    <string name="cdma_system_select_summary" msgid="60460043745797517">"‏تغییر حالت رومینگ CDMA"</string>
+    <string name="cdma_system_select_summary" msgid="60460043745797517">"‏تغییر حالت فراگردی CDMA"</string>
     <string name="cdma_system_select_dialogtitle" msgid="6083355415165359075">"انتخاب سیستم"</string>
   <string-array name="cdma_system_select_choices">
     <item msgid="176474317493999285">"فقط خانه"</item>
@@ -633,7 +633,7 @@
     <string name="status_hint_label_wifi_call" msgid="8900805254974653903">"‏تماس Wi-Fi"</string>
     <string name="emergency_action_launch_hint" msgid="4906759256275562674">"دوباره ضربه بزنید تا باز شود"</string>
     <string name="message_decode_error" msgid="3456481534066924855">"هنگام رمزگشایی پیام، خطایی روی داد."</string>
-    <string name="callFailed_cdma_activation" msgid="2307989779233262164">"یک سیم‌کارت سرویس شما را فعال کرده است و قابلیت‌های رومینگ تلفنتان را به‌روز کرده است."</string>
+    <string name="callFailed_cdma_activation" msgid="2307989779233262164">"یک سیم‌کارت سرویس شما را فعال کرده است و قابلیت‌های فراگردی تلفنتان را به‌روز کرده است."</string>
     <string name="callFailed_cdma_call_limit" msgid="1556916577171457086">"تعداد زیادی تماس فعال وجود دارد. قبل از برقراری تماس جدید، لطفاً به تماس‌های موجود پایان دهید یا آنها را ادغام کنید."</string>
     <string name="callFailed_imei_not_accepted" msgid="132192626901238542">"مرتبط نشد، لطفاً سیم کارت معتبری را وارد کنید."</string>
     <string name="callFailed_wifi_lost" msgid="5968076625137297184">"اتصال وای‌فای قطع شد. تماس پایان یافت."</string>
@@ -651,16 +651,16 @@
     <string name="change_pin_confirm_pins_dont_match" msgid="4795052654904027909">"پین‌ها با یکدیگر مطابقت ندارند"</string>
     <string name="change_pin_succeeded" msgid="2022852286442211151">"پین پست صوتی به‌روزرسانی شد"</string>
     <string name="change_pin_system_error" msgid="8308462387154257840">"پین تنظیم نشد"</string>
-    <string name="mobile_data_status_roaming_turned_off_subtext" msgid="935636805765823307">"رومینگ داده خاموش است"</string>
-    <string name="mobile_data_status_roaming_turned_on_subtext" msgid="1335176927083781041">"رومینگ داده روشن است"</string>
-    <string name="mobile_data_status_roaming_without_plan_subtext" msgid="3568412513831673037">"درحال رومینگ، به طرح داده نیاز است"</string>
-    <string name="mobile_data_status_roaming_with_plan_subtext" msgid="8721998948811064377">"درحال رومینگ، طرح داده فعال است"</string>
+    <string name="mobile_data_status_roaming_turned_off_subtext" msgid="935636805765823307">"فراگردی داده خاموش است"</string>
+    <string name="mobile_data_status_roaming_turned_on_subtext" msgid="1335176927083781041">"فراگردی داده روشن است"</string>
+    <string name="mobile_data_status_roaming_without_plan_subtext" msgid="3568412513831673037">"درحال فراگردی، به طرح داده نیاز است"</string>
+    <string name="mobile_data_status_roaming_with_plan_subtext" msgid="8721998948811064377">"درحال فراگردی، طرح داده فعال است"</string>
     <string name="mobile_data_status_no_plan_subtext" msgid="4887747337017565725">"داده دستگاه همراهی باقی نمانده است"</string>
     <string name="mobile_data_activate_prepaid" msgid="7447025165850512683">"داده دستگاه همراهی باقی نمانده است"</string>
     <string name="mobile_data_activate_prepaid_summary" msgid="5705389791791637666">"افزودن داده دستگاه همراه ازطریق <xliff:g id="PROVIDER_NAME">%s</xliff:g>"</string>
-    <string name="mobile_data_activate_roaming_plan" msgid="5998161536947086264">"بدون طرح رومینگ"</string>
-    <string name="mobile_data_activate_roaming_plan_summary" msgid="511202908883425459">"افزودن طرح رومینگ ازطریق <xliff:g id="PROVIDER_NAME">%s</xliff:g>"</string>
-    <string name="mobile_data_activate_footer" msgid="5979019929980140594">"می‌توانید ازطریق شرکت مخابراتی‌تان (<xliff:g id="PROVIDER_NAME">%s</xliff:g>)، طرح داده یا رومینگ اضافه کنید."</string>
+    <string name="mobile_data_activate_roaming_plan" msgid="5998161536947086264">"بدون طرح فراگردی"</string>
+    <string name="mobile_data_activate_roaming_plan_summary" msgid="511202908883425459">"افزودن طرح فراگردی ازطریق <xliff:g id="PROVIDER_NAME">%s</xliff:g>"</string>
+    <string name="mobile_data_activate_footer" msgid="5979019929980140594">"می‌توانید ازطریق شرکت مخابراتی‌تان (<xliff:g id="PROVIDER_NAME">%s</xliff:g>)، طرح داده یا فراگردی اضافه کنید."</string>
     <string name="mobile_data_activate_diag_title" msgid="9044252207707864493">"داده اضافه شود؟"</string>
     <string name="mobile_data_activate_diag_message" msgid="8216154678758451453">"ممکن است لازم باشد ازطریق <xliff:g id="PROVIDER_NAME">%s</xliff:g> داده اضافه کنید"</string>
     <string name="mobile_data_activate_button" msgid="3682400969184405446">"افزودن داده"</string>
@@ -727,15 +727,15 @@
     <string name="call_barring_baoic" msgid="3162154267825211826">"خروجی بین‌المللی"</string>
     <string name="call_barring_baoic_enabled" msgid="2634377543147258105">"مسدود کردن تماس‌های بین‌المللی خروجی غیرفعال شود؟"</string>
     <string name="call_barring_baoic_disabled" msgid="5817895648306183464">"تماس‌های بین‌المللی خروجی مسدود شود؟"</string>
-    <string name="call_barring_baoicr" msgid="8951699885885742076">"رومینگ بین‌المللی خروجی"</string>
-    <string name="call_barring_baoicr_enabled" msgid="2519630715322138317">"مسدود کردن رومینگ بین‌المللی خروجی غیرفعال شود؟"</string>
-    <string name="call_barring_baoicr_disabled" msgid="5831267468931377699">"رومینگ بین‌المللی خروجی مسدود شود؟"</string>
+    <string name="call_barring_baoicr" msgid="8951699885885742076">"فراگردی بین‌المللی خروجی"</string>
+    <string name="call_barring_baoicr_enabled" msgid="2519630715322138317">"مسدود کردن فراگردی بین‌المللی خروجی غیرفعال شود؟"</string>
+    <string name="call_barring_baoicr_disabled" msgid="5831267468931377699">"فراگردی بین‌المللی خروجی مسدود شود؟"</string>
     <string name="call_barring_baic" msgid="5272726081458339912">"همه ورودی‌ها"</string>
     <string name="call_barring_baic_enabled" msgid="2457134916223203380">"مسدود کردن همه تماس‌های ورودی غیرفعال شود؟"</string>
     <string name="call_barring_baic_disabled" msgid="6945604947500275636">"همه تماس‌های ورودی مسدود شود؟"</string>
-    <string name="call_barring_baicr" msgid="5728784220691481693">"رومینگ بین‌المللی ورودی"</string>
-    <string name="call_barring_baicr_enabled" msgid="6533336994391716127">"مسدود کردن رومینگ بین‌المللی ورودی غیرفعال شود؟"</string>
-    <string name="call_barring_baicr_disabled" msgid="6746329853943256566">"رومینگ بین‌المللی ورودی مسدود شود؟"</string>
+    <string name="call_barring_baicr" msgid="5728784220691481693">"فراگردی بین‌المللی ورودی"</string>
+    <string name="call_barring_baicr_enabled" msgid="6533336994391716127">"مسدود کردن فراگردی بین‌المللی ورودی غیرفعال شود؟"</string>
+    <string name="call_barring_baicr_disabled" msgid="6746329853943256566">"فراگردی بین‌المللی ورودی مسدود شود؟"</string>
     <string name="call_barring_deactivate_all" msgid="5269788384941003415">"غیرفعال کردن همه"</string>
     <string name="call_barring_deactivate_all_description" msgid="4972365443287257704">"غیرفعال کردن همه تنظیمات محدودیت تماس"</string>
     <string name="call_barring_deactivate_success" msgid="8014685598632000936">"محدودیت تماس غیرفعال شد"</string>
@@ -776,8 +776,8 @@
     <string name="callFailed_calling_disabled" msgid="7257184079619449933">"‏نمی‌توانید تماسی برقرار کنید چون برقراری تماس تلفنی با استفاده از مشخصه سیستم ro.telephony.disable-call غیرفعال شده است."</string>
     <string name="callFailed_too_many_calls" msgid="3023051919216926990">"نمی‌توانید تماسی برقرار کنید، چون هم‌اکنون دو تماس دیگر درحال انجام است. قبل از برقراری تماس جدید، یکی از تماس‌ها را قطع کنید یا آن‌ها را به‌صورت کنفرانسی ادغام کنید."</string>
     <string name="supp_service_over_ut_precautions" msgid="2565837355815074278">"برای استفاده از <xliff:g id="SUPP_SERVICE">%s</xliff:g>، مطمئن شوید داده‌ تلفن همراه روشن شده باشد. می‌توانید در تنظیمات شبکه تلفن همراه این تنظیم را تغییر دهید."</string>
-    <string name="supp_service_over_ut_precautions_roaming" msgid="1597142936802114092">"برای استفاده از <xliff:g id="SUPP_SERVICE">%s</xliff:g>، مطمئن شوید داده‌ تلفن همراه و رومینگ داده روشن شده باشد. می‌توانید در تنظیمات شبکه تلفن همراه، این تنظیمات را تغییر دهید."</string>
+    <string name="supp_service_over_ut_precautions_roaming" msgid="1597142936802114092">"برای استفاده از <xliff:g id="SUPP_SERVICE">%s</xliff:g>، مطمئن شوید داده‌ تلفن همراه و فراگردی داده روشن شده باشد. می‌توانید در تنظیمات شبکه تلفن همراه، این تنظیمات را تغییر دهید."</string>
     <string name="supp_service_over_ut_precautions_dual_sim" msgid="1682814794340311300">"برای استفاده از <xliff:g id="SUPP_SERVICE">%1$s</xliff:g>، مطمئن شوید داده تلفن همراه برای سیم‌کارت <xliff:g id="SIM_NUMBER">%2$d</xliff:g> روشن باشد. می‌توانید در تنظیمات شبکه تلفن همراه این تنظیم را تغییر دهید."</string>
-    <string name="supp_service_over_ut_precautions_roaming_dual_sim" msgid="8062345092837168385">"برای استفاده از <xliff:g id="SUPP_SERVICE">%1$s</xliff:g>، مطمئن شوید داده تلفن همراه و رومینگ داده برای سیم‌کارت <xliff:g id="SIM_NUMBER">%2$d</xliff:g> روشن باشد. می‌توانید در تنظیمات شبکه تلفن همراه این تنظیمات را تغییر دهید."</string>
+    <string name="supp_service_over_ut_precautions_roaming_dual_sim" msgid="8062345092837168385">"برای استفاده از <xliff:g id="SUPP_SERVICE">%1$s</xliff:g>، مطمئن شوید داده تلفن همراه و فراگردی داده برای سیم‌کارت <xliff:g id="SIM_NUMBER">%2$d</xliff:g> روشن باشد. می‌توانید در تنظیمات شبکه تلفن همراه این تنظیمات را تغییر دهید."</string>
     <string name="supp_service_over_ut_precautions_dialog_dismiss" msgid="5061044213859557398">"رد کردن"</string>
 </resources>
diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml
index ddc9009..39c6d75 100644
--- a/res/values-hi/strings.xml
+++ b/res/values-hi/strings.xml
@@ -146,8 +146,8 @@
     <item msgid="1108394741608734023">"नंबर दिखाएं"</item>
   </string-array>
     <string name="vm_changed" msgid="380744030726254139">"वॉयस मेल नंबर बदला गया."</string>
-    <string name="vm_change_failed" msgid="3352934863246208918">"वॉयस मेल नंबर बदला नहीं जा सका.\nयदि यह समस्या बनी रहती है, तो अपने कैरियर से संपर्क करें."</string>
-    <string name="fw_change_failed" msgid="5298103228470214665">"अग्रेषण नंबर बदला नहीं जा सका.\nयदि यह समस्या बनी रहती है, तो अपने कैरियर से संपर्क करें."</string>
+    <string name="vm_change_failed" msgid="3352934863246208918">"वॉयस मेल नंबर बदला नहीं जा सका.\nअगर यह समस्या बनी रहती है, तो अपने कैरियर से संपर्क करें."</string>
+    <string name="fw_change_failed" msgid="5298103228470214665">"अग्रेषण नंबर बदला नहीं जा सका.\nअगर यह समस्या बनी रहती है, तो अपने कैरियर से संपर्क करें."</string>
     <string name="fw_get_in_vm_failed" msgid="8862896836093833973">"वर्तमान अग्रेषण संख्‍या सेटिंग पुनर्प्राप्त नही की जा सकी और सहेजी नहीं जा सकी.\nकिसी भी तरह नए प्रदाता पर स्विच करें?"</string>
     <string name="no_change" msgid="3186040086622435212">"कोई परिवर्तन नहीं किए गए."</string>
     <string name="sum_voicemail_choose_provider" msgid="59911196126278922">"वॉयस मेल सेवा चुनें"</string>
@@ -238,9 +238,9 @@
     <string name="preferred_network_mode_lte_tdscdma_cdma_evdo_gsm_wcdma_summary" msgid="5596733053095592791">"पसंदीदा नेटवर्क मोड: LTE/TDSCDMA/CDMA/EvDo/GSM/WCDMA"</string>
     <string name="call_category" msgid="5863978196309462052">"कॉलिंग"</string>
     <string name="network_operator_category" msgid="4830701959205735636">"नेटवर्क"</string>
-    <string name="enhanced_4g_lte_mode_title" msgid="522191650223239171">"उन्नत 4G LTE मोड"</string>
+    <string name="enhanced_4g_lte_mode_title" msgid="522191650223239171">"बेहतर 4G LTE मोड"</string>
     <!-- no translation found for enhanced_4g_lte_mode_title_variant:0 (4447454259719947406) -->
-    <string name="enhanced_4g_lte_mode_summary" msgid="2332175070522125850">"ध्‍वनि और अन्‍य संचारों को बेहतर बनाने हेतु LTE सेवाओं का उपयोग करें (अनुशंसित)"</string>
+    <string name="enhanced_4g_lte_mode_summary" msgid="2332175070522125850">"ध्‍वनि और अन्‍य संचारों को बेहतर बनाने के लिए LTE सेवाओं का उपयोग करें (अनुशंसित)"</string>
     <string name="enhanced_4g_lte_mode_summary_o2" msgid="2467813449068614988">"ध्वनि और दूसरे संचारों को बेहतर बनाने के लिए 4G सेवाओं का इस्तेमाल करें (सुझाया गया)"</string>
     <!-- no translation found for enhanced_4g_lte_mode_sumary_variant:0 (2602242047481988063) -->
     <!-- no translation found for enhanced_4g_lte_mode_sumary_variant:1 (989876442920201921) -->
@@ -253,7 +253,7 @@
     <string name="roaming_disable" msgid="1843417228755568110">"रोमिंग के समय डेटा सेवाएं कनेक्ट करें"</string>
     <string name="roaming_reenable_message" msgid="6843814381576397939">"डेटा रोमिंग बंद है. चालू करने के लिए टैप करें."</string>
     <string name="roaming_notification_title" msgid="4749053220884743110">"मोबाइल डेटा कनेक्शन उपलब्ध नहीं है"</string>
-    <string name="roaming_warning" msgid="1603164667540144353">"आपको बहुत अधिक शुल्‍क देना पड़ सकता है."</string>
+    <string name="roaming_warning" msgid="1603164667540144353">"आपको बहुत ज़्यादा शुल्‍क देना पड़ सकता है."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"कीमतों की जानकारी के लिए आपको नेटवर्क सेवा देने वाली कंपनी से संपर्क करें."</string>
     <string name="roaming_alert_title" msgid="3654815360303826008">"डेटा रोमिंग की अनुमति दें?"</string>
     <string name="data_usage_title" msgid="4042209259808900283">"ऐप्लिकेशन का डेटा खर्च"</string>
@@ -276,13 +276,13 @@
     <string name="throttle_current_usage" msgid="8762280193043815361">"वर्तमान अवधि में उपयोग किया गया डेटा"</string>
     <string name="throttle_time_frame" msgid="1915198770363734685">"डेटा उपयोग अवधि"</string>
     <string name="throttle_rate" msgid="4710388992676803508">"डेटा दर नीति"</string>
-    <string name="throttle_help" msgid="243651091785169900">"अधिक जानें"</string>
+    <string name="throttle_help" msgid="243651091785169900">"ज़्यादा जानें"</string>
     <string name="throttle_status_subtext" msgid="1657318943142085170">"<xliff:g id="USED_2">%3$s</xliff:g> में से <xliff:g id="USED_0">%1$s</xliff:g> (<xliff:g id="USED_1">%2$d</xliff:g>٪) अवधि अधिकतम\nअगली अवधि <xliff:g id="USED_3">%4$d</xliff:g> दिनों (<xliff:g id="USED_4">%5$s</xliff:g>) में प्रारंभ होगी"</string>
     <string name="throttle_data_usage_subtext" msgid="6029276011123694701">"<xliff:g id="USED_2">%3$s</xliff:g> में से <xliff:g id="USED_0">%1$s</xliff:g> (<xliff:g id="USED_1">%2$d</xliff:g>٪) अवधि अधिकतम"</string>
     <string name="throttle_data_rate_reduced_subtext" msgid="7492763592720107737">"<xliff:g id="USED_0">%1$s</xliff:g> अधिकतम सीमा पार हो गई\nडेटा दर <xliff:g id="USED_1">%2$d</xliff:g> Kb/s तक कम हो गई है"</string>
     <string name="throttle_time_frame_subtext" msgid="7732763021560399960">"चक्र का <xliff:g id="USED_0">%1$d</xliff:g>٪ बीत चुका है\nअगली अवधि <xliff:g id="USED_1">%2$d</xliff:g> दिन में आरंभ होगी (<xliff:g id="USED_2">%3$s</xliff:g>)"</string>
-    <string name="throttle_rate_subtext" msgid="2149102656120726855">"यदि डेटा उपयोग की सीमा पार होती है, तो डेटा दर <xliff:g id="USED">%1$d</xliff:g> Kb/s तक कम हो जाती है."</string>
-    <string name="throttle_help_subtext" msgid="5217706521499010816">"आपके कैरियर की मोबाइल नेटवर्क डेटा उपयोग नीति के बारे में अधिक जानकारी"</string>
+    <string name="throttle_rate_subtext" msgid="2149102656120726855">"अगर डेटा उपयोग की सीमा पार होती है, तो डेटा दर <xliff:g id="USED">%1$d</xliff:g> Kb/s तक कम हो जाती है."</string>
+    <string name="throttle_help_subtext" msgid="5217706521499010816">"आपके कैरियर की मोबाइल नेटवर्क डेटा उपयोग नीति के बारे में ज़्यादा जानकारी"</string>
     <string name="cell_broadcast_sms" msgid="5584192824053625842">"सेल प्रसारण SMS"</string>
     <string name="enable_disable_cell_bc_sms" msgid="4851147873691392255">"सेल प्रसारण SMS"</string>
     <string name="cell_bc_sms_enable" msgid="6441688565738921084">"सेल प्रसारण SMS सक्षम किया गया"</string>
@@ -410,7 +410,7 @@
     <string name="sum_fdn_change_pin" msgid="6666549734792827932">"एफ़डीएन एक्सेस के लिए पिन बदलें"</string>
     <string name="sum_fdn_manage_list" msgid="8431088265332628316">"फ़ोन नंबर सूची प्रबंधित करें"</string>
     <string name="voice_privacy" msgid="3776841382844614716">"ध्वनि निजता"</string>
-    <string name="voice_privacy_summary" msgid="3159383389833516214">"उन्नत निजता मोड सक्षम करें"</string>
+    <string name="voice_privacy_summary" msgid="3159383389833516214">"बेहतर निजता मोड सक्षम करें"</string>
     <string name="tty_mode_option_title" msgid="9033098925144434669">"टेलीटाइपराइटर (TTY) मोड"</string>
     <string name="tty_mode_option_summary" msgid="1073835131534808732">"TTY मोड सेट करें"</string>
     <string name="auto_retry_mode_title" msgid="4073265511427813322">"अपने आप फिर से प्रयास"</string>
@@ -434,8 +434,8 @@
     <string name="deleting_fdn_contact" msgid="5669163206349319969">"फ़िक्स्ड डायलिंग नंबर हटा रहा है..."</string>
     <string name="fdn_contact_deleted" msgid="7154162327112259569">"फ़िक्स्ड डायलिंग नंबर हटाया गया."</string>
     <string name="pin2_invalid" msgid="5470854099230755944">"FDN पे नई जानकारी नहीं है क्योंकि आपने गलत पिन लिखा है."</string>
-    <string name="fdn_invalid_number" msgid="2062898833049589309">"FDN अपडेट नहीं किया जा सका, क्योंकि नंबर में 20 से अधिक अंक हैं."</string>
-    <string name="pin2_or_fdn_invalid" msgid="6025144083384701197">"FDN पे नई जानकारी नहीं है. PIN2 गलत था, या फ़ोन नंबर अस्वीकृत था."</string>
+    <string name="fdn_invalid_number" msgid="2062898833049589309">"FDN अपडेट नहीं किया जा सका, क्योंकि नंबर में 20 से ज़्यादा अंक हैं."</string>
+    <string name="pin2_or_fdn_invalid" msgid="6025144083384701197">"FDN पे नई जानकारी नहीं है. PIN2 गलत था, या फ़ोन नंबर नामंजूर था."</string>
     <string name="fdn_failed" msgid="540018079008319747">"FDN की कार्यवाही विफल रही."</string>
     <string name="simContacts_emptyLoading" msgid="2203331234764498011">"सिम कार्ड से पढ़ रहा है…"</string>
     <string name="simContacts_empty" msgid="5270660846489561932">"आपके सिम कार्ड पर कोई संपर्क नहीं है."</string>
@@ -571,7 +571,7 @@
     <string name="ota_hfa_activation_title" msgid="2234246934160473981">"सक्रिय हो रहा है..."</string>
     <string name="ota_hfa_activation_dialog_message" msgid="8092479227918463415">"फ़ोन आपकी मोबाइल डेटा सेवा सक्रिय कर रहा है.\n\nइसमें 5 मिनट तक लग सकते हैं."</string>
     <string name="ota_skip_activation_dialog_title" msgid="2943366608272261306">"सक्रियण छोड़ें?"</string>
-    <string name="ota_skip_activation_dialog_message" msgid="2440770373498870550">"यदि आप सक्रियण छोड़ देते हैं, तो आप कॉल नहीं कर सकते या मोबाइल डेटा नेटवर्क से कनेक्ट (हालांकि आप वाई-फ़ाई  नेटवर्क से कनेक्ट हो सकते हैं) नहीं हो सकते हैं. जब तक आप अपने फ़ोन को सक्रिय नहीं करते, आपको प्रत्येक बार उसे चालू करने पर उसे सक्रिय करने के लिए कहा जाएगा."</string>
+    <string name="ota_skip_activation_dialog_message" msgid="2440770373498870550">"अगर आप सक्रियण छोड़ देते हैं, तो आप कॉल नहीं कर सकते या मोबाइल डेटा नेटवर्क से कनेक्ट (हालांकि आप वाई-फ़ाई  नेटवर्क से कनेक्ट हो सकते हैं) नहीं हो सकते हैं. जब तक आप अपने फ़ोन को सक्रिय नहीं करते, आपको प्रत्येक बार उसे चालू करने पर उसे सक्रिय करने के लिए कहा जाएगा."</string>
     <string name="ota_skip_activation_dialog_skip_label" msgid="3458532775091563208">"अभी नहीं"</string>
     <string name="ota_activate" msgid="1368528132525626264">"सक्रिय करें"</string>
     <string name="ota_title_activate_success" msgid="6570240212263372046">"फ़ोन सक्रिय हो गया."</string>
@@ -581,7 +581,7 @@
     <string name="ota_progress" msgid="460876637828044519">"आपका फ़ोन प्रोग्राम किया जा रहा है…"</string>
     <string name="ota_failure" msgid="7713756181204620397">"आपके फ़ोन को प्रोग्राम नहीं किया जा सका"</string>
     <string name="ota_successful" msgid="1880780692887077407">"आपका फ़ोन अब सक्रिय कर दिया गया है. सेवा को आरंभ होने में 15 मिनट तक लग सकते हैं."</string>
-    <string name="ota_unsuccessful" msgid="8072141612635635357">"आपका फ़ोन सक्रिय नहीं हुआ. \nआपको बेहतर कवरेज वाले किसी क्षेत्र (खिड़की के पास या बाहर) में जाने की आवश्यकता हो सकती है. \n\nफिर से प्रयास करें या अधिक विकल्पों के लिए ग्राहक सेवा को कॉल करें."</string>
+    <string name="ota_unsuccessful" msgid="8072141612635635357">"आपका फ़ोन सक्रिय नहीं हुआ. \nआपको बेहतर कवरेज वाले किसी क्षेत्र (खिड़की के पास या बाहर) में जाने की आवश्यकता हो सकती है. \n\nफिर से प्रयास करें या ज़्यादा विकल्पों के लिए ग्राहक सेवा को कॉल करें."</string>
     <string name="ota_spc_failure" msgid="3909983542575030796">"अतिरिक्त SPC विफलताएं"</string>
     <string name="ota_call_end" msgid="4537279738134612388">"वापस जाएं"</string>
     <string name="ota_try_again" msgid="7685477206465902290">"फिर से कोशिश करें"</string>
@@ -622,7 +622,7 @@
     <string name="preference_category_ringtone" msgid="5197960752529332721">"रिंगटोन और कंपन"</string>
     <string name="pstn_connection_service_label" msgid="1743245930577325900">"अंतर्निहित सिम कार्ड"</string>
     <string name="enable_video_calling_title" msgid="7237253660669000899">"वीडियो कॉलिंग चालू करें"</string>
-    <string name="enable_video_calling_dialog_msg" msgid="8948186136957417948">"वीडियो कॉलिंग चालू करने के लिए, आपको नेटवर्क सेटिंग में उन्‍नत 4G LTE मोड सक्षम करना होगा."</string>
+    <string name="enable_video_calling_dialog_msg" msgid="8948186136957417948">"वीडियो कॉलिंग चालू करने के लिए, आपको नेटवर्क सेटिंग में बेहतर 4G LTE मोड सक्षम करना होगा."</string>
     <string name="enable_video_calling_dialog_settings" msgid="576528473599603249">"नेटवर्क सेटिंग"</string>
     <string name="enable_video_calling_dialog_close" msgid="7411471282167927991">"बंद करें"</string>
     <string name="sim_label_emergency_calls" msgid="4847699229529306397">"आपातकालीन कॉल"</string>
@@ -634,7 +634,7 @@
     <string name="emergency_action_launch_hint" msgid="4906759256275562674">"खोलने के लिए फिर से टैप करें"</string>
     <string name="message_decode_error" msgid="3456481534066924855">"संदेश डीकोड करते समय कोई गड़बड़ी हुई थी."</string>
     <string name="callFailed_cdma_activation" msgid="2307989779233262164">"सिम कार्ड द्वारा आपकी सेवा को सक्रिय किया गया है और आपके फ़ोन की रोमिंग क्षमताओं को अपडेट किया गया है."</string>
-    <string name="callFailed_cdma_call_limit" msgid="1556916577171457086">"बहुत अधिक कॉल सक्रिय हैं. नया कॉल करने से पहले कृपया मौजूदा कॉल खत्म करें या उन्हें मिला दें."</string>
+    <string name="callFailed_cdma_call_limit" msgid="1556916577171457086">"बहुत ज़्यादा कॉल सक्रिय हैं. नया कॉल करने से पहले कृपया मौजूदा कॉल खत्म करें या उन्हें मिला दें."</string>
     <string name="callFailed_imei_not_accepted" msgid="132192626901238542">"कनेक्ट नहीं हो पा रहा है, कृपया कोई मान्य SIM कार्ड डालें."</string>
     <string name="callFailed_wifi_lost" msgid="5968076625137297184">"वाई-फ़ाई कनेक्शन चला गया. कॉल खत्म हो गया."</string>
     <string name="dialFailed_low_battery" msgid="8760548177088774268">"बैटरी कम होने के कारण आप वीडियो कॉल नहीं कर सकते."</string>
diff --git a/res/values-hy/strings.xml b/res/values-hy/strings.xml
index 9f97102..fe8ca01 100644
--- a/res/values-hy/strings.xml
+++ b/res/values-hy/strings.xml
@@ -264,7 +264,7 @@
     <string name="carrier_settings_euicc_summary" msgid="5115001942761995457">"<xliff:g id="CARRIER_NAME">%1$s</xliff:g> — <xliff:g id="PHONE_NUMBER">%2$s</xliff:g>"</string>
     <string name="mobile_data_settings_title" msgid="4661165467914727157">"Բջջային ինտերնետ"</string>
     <string name="mobile_data_settings_summary" msgid="5087255915840576895">"Օգտվել բջջային ինտերնետից"</string>
-    <string name="data_usage_disable_mobile" msgid="3577275288809667615">"Անջատե՞լ բջջային ինտերնետը։"</string>
+    <string name="data_usage_disable_mobile" msgid="3577275288809667615">"Անջատե՞լ բջջային ինտերնետը"</string>
     <string name="sim_selection_required_pref" msgid="7049424902961844236">"Ընտրեք SIM քարտը"</string>
     <string name="sim_change_data_title" msgid="5332425991853799280">"Փոխե՞լ բջջային ինտերնետի SIM-ը"</string>
     <string name="sim_change_data_message" msgid="2163963581444907496">"Օգտագործե՞լ <xliff:g id="NEW_SIM">%1$s</xliff:g> քարտը <xliff:g id="OLD_SIM">%2$s</xliff:g> քարտի փոխարեն բջջային ինտերնետի համար:"</string>
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index 0ce592c..01004d1 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -256,7 +256,7 @@
     <string name="roaming_warning" msgid="1603164667540144353">"Anda dapat dikenakan biaya yang cukup besar."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"Hubungi penyedia jaringan untuk mengetahui harganya."</string>
     <string name="roaming_alert_title" msgid="3654815360303826008">"Izinkan roaming data?"</string>
-    <string name="data_usage_title" msgid="4042209259808900283">"Penggunaan data aplikasi"</string>
+    <string name="data_usage_title" msgid="4042209259808900283">"Penggunaan kuota aplikasi"</string>
     <string name="data_usage_template" msgid="8526428824844656364">"<xliff:g id="ID_1">%1$s</xliff:g> data seluler digunakan pada <xliff:g id="ID_2">%2$s</xliff:g>"</string>
     <string name="advanced_options_title" msgid="8074895510265488035">"Lanjutan"</string>
     <string name="carrier_settings_euicc" msgid="6714062862127226405">"Operator"</string>
@@ -264,7 +264,7 @@
     <string name="carrier_settings_euicc_summary" msgid="5115001942761995457">"<xliff:g id="CARRIER_NAME">%1$s</xliff:g> — <xliff:g id="PHONE_NUMBER">%2$s</xliff:g>"</string>
     <string name="mobile_data_settings_title" msgid="4661165467914727157">"Data seluler"</string>
     <string name="mobile_data_settings_summary" msgid="5087255915840576895">"Akses data menggunakan jaringan seluler"</string>
-    <string name="data_usage_disable_mobile" msgid="3577275288809667615">"Nonaktifkan data seluler?"</string>
+    <string name="data_usage_disable_mobile" msgid="3577275288809667615">"Nonaktifkan kuota seluler?"</string>
     <string name="sim_selection_required_pref" msgid="7049424902961844236">"Perlu memilih SIM"</string>
     <string name="sim_change_data_title" msgid="5332425991853799280">"Ubah SIM data?"</string>
     <string name="sim_change_data_message" msgid="2163963581444907496">"Gunakan <xliff:g id="NEW_SIM">%1$s</xliff:g> dan bukan <xliff:g id="OLD_SIM">%2$s</xliff:g> untuk data seluler?"</string>
@@ -272,7 +272,7 @@
     <string name="video_calling_settings_title" msgid="539714564273795574">"Video call operator"</string>
     <string name="gsm_umts_options" msgid="6538311689850981686">"Opsi GSM//UMTS"</string>
     <string name="cdma_options" msgid="4016822858172249884">"Opsi CDMA"</string>
-    <string name="throttle_data_usage" msgid="3715677828160555808">"Penggunaan data"</string>
+    <string name="throttle_data_usage" msgid="3715677828160555808">"Penggunaan kuota"</string>
     <string name="throttle_current_usage" msgid="8762280193043815361">"Data yang digunakan dalam periode saat ini"</string>
     <string name="throttle_time_frame" msgid="1915198770363734685">"Periode penggunaan data"</string>
     <string name="throttle_rate" msgid="4710388992676803508">"Kebijakan kecepatan data"</string>
diff --git a/res/values-mr/strings.xml b/res/values-mr/strings.xml
index 020f3da..5400ad4 100644
--- a/res/values-mr/strings.xml
+++ b/res/values-mr/strings.xml
@@ -592,12 +592,12 @@
     <string name="phone_in_ecm_call_notification_text" msgid="4611608947314729773">"डेटा कनेक्शन अक्षम केले"</string>
     <string name="phone_in_ecm_notification_complete_time" msgid="7730376844178948351">"<xliff:g id="COMPLETETIME">%s</xliff:g> पर्यंत कोणतेही डेटा कनेक्‍शन नाही"</string>
     <plurals name="alert_dialog_exit_ecm" formatted="false" msgid="7179911675595441201">
-      <item quantity="one">फोन <xliff:g id="COUNT_1">%s</xliff:g> मिनिटासाठी आणीबाणी कॉलबॅक मोडमध्ये राहील. या मोडमध्ये असताना डेटा कनेक्शन वापरणारे कोणतेही अ‍ॅप्लिकेशन वापरले जाऊ शकत नाहीत. तुम्ही आता बाहेर पडू इच्छिता?</item>
       <item quantity="other">फोन <xliff:g id="COUNT_1">%s</xliff:g> मिनिटांसाठी आणीबाणी कॉलबॅक मोडमध्ये राहील. या मोडमध्ये असताना डेटा कनेक्शन वापरणारे कोणतेही अ‍ॅप्लिकेशन वापरले जाऊ शकत नाहीत. तुम्ही आता बाहेर पडू इच्छिता?</item>
+      <item quantity="one">फोन <xliff:g id="COUNT_0">%s</xliff:g> मिनिटासाठी आणीबाणी कॉलबॅक मोडमध्ये राहील. या मोडमध्ये असताना डेटा कनेक्शन वापरणारे कोणतेही अ‍ॅप वापरले जाऊ शकत नाहीत. तुम्ही आता बाहेर पडू इच्छिता?</item>
     </plurals>
     <plurals name="alert_dialog_not_avaialble_in_ecm" formatted="false" msgid="8042973425225093895">
-      <item quantity="one">आणीबाणी कॉलबॅक मोडमध्ये असताना निवडलेली क्रिया उपलब्ध नसते. फोन <xliff:g id="COUNT_1">%s</xliff:g> मिनिटासाठी या मोडमध्ये राहील. तुम्ही आता बाहेर पडू इच्छिता?</item>
       <item quantity="other">आणीबाणी कॉलबॅक मोडमध्ये असताना निवडलेली क्रिया उपलब्ध नसते. फोन <xliff:g id="COUNT_1">%s</xliff:g> मिनिटांसाठी या मोडमध्ये राहील. तुम्ही आता बाहेर पडू इच्छिता?</item>
+      <item quantity="one">आणीबाणी कॉलबॅक मोडमध्ये असताना निवडलेली क्रिया उपलब्ध नसते. फोन <xliff:g id="COUNT_0">%s</xliff:g> मिनिटासाठी या मोडमध्ये राहील. तुम्ही आता बाहेर पडू इच्छिता?</item>
     </plurals>
     <string name="alert_dialog_in_ecm_call" msgid="1886723687211887104">"आणीबाणीच्‍या कॉलमध्‍ये असताना निवडलेली क्रिया उपलब्‍ध नसते."</string>
     <string name="progress_dialog_exiting_ecm" msgid="4835734101617817074">"आणीबाणी कॉलबॅक मोडमधून बाहेर पडत आहे"</string>
@@ -762,8 +762,8 @@
     <string name="supp_service_outgoing_calls_barred" msgid="1962644621292054081">"जाणारे कॉल अवरोधित केले."</string>
     <string name="supp_service_call_forwarding_active" msgid="1253134771682248735">"कॉल फॉरवर्ड होत आहे."</string>
     <string name="supp_service_additional_call_forwarded" msgid="5228624725214727315">"अतिरिक्‍त कॉल फॉरवर्ड केला."</string>
-    <string name="supp_service_additional_ect_connected" msgid="6396964292513707102">"भडक कॉल ट्रांसफर करणे पूर्ण झाले."</string>
-    <string name="supp_service_additional_ect_connecting" msgid="5443373059716058480">"भडक कॉल ट्रांसफर होत आहे."</string>
+    <string name="supp_service_additional_ect_connected" msgid="6396964292513707102">"भडक कॉल ट्रान्सफर करणे पूर्ण झाले."</string>
+    <string name="supp_service_additional_ect_connecting" msgid="5443373059716058480">"भडक कॉल ट्रान्सफर होत आहे."</string>
     <string name="supp_service_call_on_hold" msgid="1478976782361795422">"कॉल होल्डवर आहे."</string>
     <string name="supp_service_call_resumed" msgid="1656475289958070674">"कॉल पुन्‍‍‍‍हा सुरू झाला."</string>
     <string name="supp_service_deflected_call" msgid="138970419873492166">"कॉल वळवला."</string>
diff --git a/res/values-night/styles.xml b/res/values-night/styles.xml
new file mode 100644
index 0000000..648ceeb
--- /dev/null
+++ b/res/values-night/styles.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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>
+
+    <style name="DialerSettingsLight" parent="SettingsLight">
+        <!-- Action bar.-->
+        <item name="android:windowBackground">@color/dialer_background_color</item>
+        <item name="android:actionModeBackground">@color/dialer_background_color</item>
+        <!-- Navigation bar.-->
+        <item name="android:navigationBarColor">@color/dialer_background_color</item>
+        <item name="android:navigationBarDividerColor">@color/dialer_divider_color</item>
+        <item name="android:colorAccent">@color/dialer_theme_color</item>
+        <item name="android:dialogTheme">@style/DialerAlertDialogTheme</item>
+    </style>
+
+</resources>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
index fc0c4bb..a84232e 100644
--- a/res/values-or/strings.xml
+++ b/res/values-or/strings.xml
@@ -35,7 +35,7 @@
     <string name="audio_mode_speaker" msgid="27649582100085266">"ସ୍ପିକର୍‌"</string>
     <string name="audio_mode_earpiece" msgid="4156527186373869107">"ହ୍ୟାଣ୍ଡସେଟ୍ ଇୟରପିସ୍"</string>
     <string name="audio_mode_wired_headset" msgid="1465350758489175975">"ଖରାପ୍‌ଥିବା ହେଡସେଟ୍"</string>
-    <string name="audio_mode_bluetooth" msgid="3047641300848211128">"ବ୍ଲୁ-ଟୂଥ୍‍‌"</string>
+    <string name="audio_mode_bluetooth" msgid="3047641300848211128">"ବ୍ଲୁଟୂଥ୍‍‌"</string>
     <string name="wait_prompt_str" msgid="7601815427707856238">"ନିମ୍ନଲିଖିତ ଟୋନ୍ ପଠାନ୍ତୁ?\n"</string>
     <string name="pause_prompt_str" msgid="1789964702154314806">"ଟୋନ୍ ପଠାଯାଉଛି \n"</string>
     <string name="send_button" msgid="4106860097497818751">"ପଠାନ୍ତୁ"</string>
@@ -174,7 +174,7 @@
     <string name="already_auto" msgid="6067116884321285507">"ପୂର୍ବରୁ ସ୍ଵାଚାଳିତ ଚୟନରେ ଅଛି।"</string>
     <string name="select_automatically" msgid="1046727200631770962">"ସ୍ଵଚାଳିତ ଭାବେ ନେଟ୍‌ୱର୍କ ଚୟନ କରନ୍ତୁ"</string>
     <string name="manual_mode_disallowed_summary" msgid="70662262085937277">"%1$s ସହ କନେକ୍ଟ ହେଲେ ଉପଲବ୍ଧ ହେବ ନାହିଁ"</string>
-    <string name="network_select_title" msgid="7733107364757544558">"ନେଟ୍‌ୱର୍କ"</string>
+    <string name="network_select_title" msgid="7733107364757544558">"ନେଟ୍‌ୱାର୍କ"</string>
     <string name="register_automatically" msgid="6017849844573519637">"ସ୍ଵଚାଳିତ ପଞ୍ଜୀକରଣ…"</string>
     <string name="preferred_network_mode_title" msgid="2336624679902659306">"ନିଜ ପସନ୍ଦର ନେଟ୍‌ୱର୍କ ପ୍ରକାର"</string>
     <string name="preferred_network_mode_summary" msgid="1434820673166126609">"ନେଟ୍‌ୱର୍କ ଅପରେଟିଙ୍ଗ ମୋଡ୍‌କୁ ବଦଳାନ୍ତୁ"</string>
@@ -512,7 +512,7 @@
     <string name="incall_error_supp_service_hold" msgid="7967020511232222078">"କଲ୍‍କୁ ହୋଲ୍ଡ କରାଯାଇପାରିବ ନାହିଁ।"</string>
     <string name="incall_error_wfc_only_no_wireless_network" msgid="1782466780452640089">"ଗୋଟିଏ କଲ୍ କରିବା ପାଇଁ ଏକ ତାରବିହୀନ ନେଟ୍‌ୱର୍କ ସହ କନେକ୍ଟ କରନ୍ତୁ।"</string>
     <string name="incall_error_promote_wfc" msgid="106510757624022064">"ଗୋଟିଏ କଲ୍ କରିବା ପାଇଁ ୱାଇ-ଫାଇ କଲିଙ୍ଗକୁ ସକ୍ଷମ କରନ୍ତୁ।"</string>
-    <string name="emergency_information_hint" msgid="399011533038204351">"ଆପତ୍ତକାଳୀନ ସୂଚନା"</string>
+    <string name="emergency_information_hint" msgid="399011533038204351">"ଜରୁରୀକାଳୀନ ସୂଚନା"</string>
     <string name="emergency_information_owner_hint" msgid="688331472291637149">"ମାଲିକ"</string>
     <string name="emergency_information_confirm_hint" msgid="4039012670779853030">"ସୂଚନା ଦେଖିବାକୁ ପୁଣିଥରେ ଟାପ୍‍ କରନ୍ତୁ"</string>
     <string name="emergency_enable_radio_dialog_title" msgid="4627849966634578257">"ଜରୁରୀକାଳିନ କଲ୍‌"</string>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index d0e004a..f24a964 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -255,7 +255,7 @@
     <string name="roaming_notification_title" msgid="4749053220884743110">"A ligação de dados móveis foi perdida"</string>
     <string name="roaming_warning" msgid="1603164667540144353">"Podem ser cobrados custos significativos."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"Consulte o seu fornecedor de serviços de rede para obter preços."</string>
-    <string name="roaming_alert_title" msgid="3654815360303826008">"Pretende permitir roaming de dados?"</string>
+    <string name="roaming_alert_title" msgid="3654815360303826008">"Permitir roaming de dados?"</string>
     <string name="data_usage_title" msgid="4042209259808900283">"Utilização de dados da aplicação"</string>
     <string name="data_usage_template" msgid="8526428824844656364">"<xliff:g id="ID_1">%1$s</xliff:g> de dados móveis utilizados entre <xliff:g id="ID_2">%2$s</xliff:g>"</string>
     <string name="advanced_options_title" msgid="8074895510265488035">"Avançadas"</string>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 6eca6ee..2c877f5 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -516,14 +516,14 @@
     <string name="emergency_information_owner_hint" msgid="688331472291637149">"Proprietário"</string>
     <string name="emergency_information_confirm_hint" msgid="4039012670779853030">"Toque novamente para ver as informações"</string>
     <string name="emergency_enable_radio_dialog_title" msgid="4627849966634578257">"Chamada de emergência"</string>
-    <string name="single_emergency_number_title" msgid="4959203129714396515">"Número de emergência"</string>
+    <string name="single_emergency_number_title" msgid="4959203129714396515">"Telefone de emergência"</string>
     <string name="numerous_emergency_numbers_title" msgid="754158099451343898">"Números de emergência"</string>
     <string name="emergency_call_shortcut_hint" msgid="6506167229097004348">"Toque novamente para ligar para <xliff:g id="EMERGENCY_NUMBER">%s</xliff:g>"</string>
     <string name="emergency_enable_radio_dialog_message" msgid="207613549344420291">"Ativando o rádio…"</string>
     <string name="emergency_enable_radio_dialog_retry" msgid="5960061579996526883">"Sem serviço. Tentando novamente..."</string>
     <string name="radio_off_during_emergency_call" msgid="2535800034010306830">"Não é possível usar o modo avião durante uma chamada de emergência."</string>
-    <string name="dial_emergency_error" msgid="1509085166367420355">"Não é possível realizar chamadas. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> não é um número de emergência."</string>
-    <string name="dial_emergency_empty_error" msgid="9130194953830414638">"Não é possível realizar chamadas. Disque um número de emergência."</string>
+    <string name="dial_emergency_error" msgid="1509085166367420355">"Não é possível realizar chamadas. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> não é um telefone de emergência."</string>
+    <string name="dial_emergency_empty_error" msgid="9130194953830414638">"Não é possível realizar chamadas. Disque o número de telefone de emergência."</string>
     <string name="dial_emergency_calling_not_available" msgid="5675557523782491826">"Chamada de emergência indisponível"</string>
     <string name="police_type_description" msgid="5324410799919829693">"Polícia"</string>
     <string name="ambulance_type_description" msgid="4114815025408089866">"Ambulância"</string>
diff --git a/res/values-si/strings.xml b/res/values-si/strings.xml
index ca849e8..719454b 100644
--- a/res/values-si/strings.xml
+++ b/res/values-si/strings.xml
@@ -255,7 +255,7 @@
     <string name="roaming_notification_title" msgid="4749053220884743110">"ජංගම දත්ත සම්බන්ධතාව නැතිවීම"</string>
     <string name="roaming_warning" msgid="1603164667540144353">"ඔබ සැලකිය යුතු ගාස්තු ඇති විය හැකිය."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"මිල ගණන් සඳහා ඔබගේ ජාල සැපයුම්කරු සමඟ පරීක්ෂා කරන්න."</string>
-    <string name="roaming_alert_title" msgid="3654815360303826008">"දත්ත රෝමින් සඳහා අවසර දෙන්න ද?"</string>
+    <string name="roaming_alert_title" msgid="3654815360303826008">"දත්ත රෝමින් සඳහා අවසර දෙන්නද?"</string>
     <string name="data_usage_title" msgid="4042209259808900283">"යෙදුම් දත්ත භාවිතය"</string>
     <string name="data_usage_template" msgid="8526428824844656364">"<xliff:g id="ID_2">%2$s</xliff:g> <xliff:g id="ID_1">%1$s</xliff:g>ක ජංගම දත්ත භාවිත කරන ලදී"</string>
     <string name="advanced_options_title" msgid="8074895510265488035">"උසස්"</string>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index d87f0ce..4ac4e46 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -249,7 +249,7 @@
     <string name="data_enable_summary" msgid="2382798156640007971">"Омогућавање потрошње података"</string>
     <string name="dialog_alert_title" msgid="6751344986194435476">"Пажња"</string>
     <string name="roaming" msgid="7894878421600247140">"Роминг"</string>
-    <string name="roaming_enable" msgid="7331106985174381987">"Повезивање са услугом за податке током роминга"</string>
+    <string name="roaming_enable" msgid="7331106985174381987">"Повежи са услугом за податке током роминга"</string>
     <string name="roaming_disable" msgid="1843417228755568110">"Повезивање са услугом за податке током роминга"</string>
     <string name="roaming_reenable_message" msgid="6843814381576397939">"Пренос података у ромингу је искључен. Додирните да бисте га укључили."</string>
     <string name="roaming_notification_title" msgid="4749053220884743110">"Изгубили сте везу за пренос мобилних података"</string>
diff --git a/res/values-ta/strings.xml b/res/values-ta/strings.xml
index a166abd..e1bfbab 100644
--- a/res/values-ta/strings.xml
+++ b/res/values-ta/strings.xml
@@ -256,7 +256,7 @@
     <string name="roaming_warning" msgid="1603164667540144353">"குறிப்பிடத்தக்க பேமெண்ட்கள் இருக்கலாம்."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"உங்கள் நெட்வொர்க் வழங்குநர் விதிக்கும் கட்டணத்தைப் பார்க்கவும்."</string>
     <string name="roaming_alert_title" msgid="3654815360303826008">"தரவு ரோமிங்கை அனுமதிக்கவா?"</string>
-    <string name="data_usage_title" msgid="4042209259808900283">"பயன்பாட்டின் டேட்டா உபயோகம்"</string>
+    <string name="data_usage_title" msgid="4042209259808900283">"ஆப்ஸ் டேட்டா உபயோகம்"</string>
     <string name="data_usage_template" msgid="8526428824844656364">"<xliff:g id="ID_2">%2$s</xliff:g>: <xliff:g id="ID_1">%1$s</xliff:g> மொபைல் டேட்டா பயன்படுத்தப்பட்டது"</string>
     <string name="advanced_options_title" msgid="8074895510265488035">"மேம்பட்டவை"</string>
     <string name="carrier_settings_euicc" msgid="6714062862127226405">"தொலைத்தொடர்பு நிறுவனம்"</string>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 3e85766..eca96a9 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -628,7 +628,7 @@
     <string name="sim_label_emergency_calls" msgid="4847699229529306397">"అత్యవసర కాల్‌లు"</string>
     <string name="sim_description_emergency_calls" msgid="7535215397212301562">"అత్యవసర కాలింగ్ మాత్రమే"</string>
     <string name="sim_description_default" msgid="4778679519938775515">"SIM కార్డ్, స్లాట్: <xliff:g id="SLOT_ID">%s</xliff:g>"</string>
-    <string name="accessibility_settings_activity_title" msgid="8562004288733103868">"ప్రాప్యత సామర్థ్యం"</string>
+    <string name="accessibility_settings_activity_title" msgid="8562004288733103868">"యాక్సెస్‌ సామర్థ్యం"</string>
     <string name="status_hint_label_incoming_wifi_call" msgid="5932176406432044638">"వీరి నుండి Wi-Fi కాల్"</string>
     <string name="status_hint_label_wifi_call" msgid="8900805254974653903">"Wi-Fi కాల్"</string>
     <string name="emergency_action_launch_hint" msgid="4906759256275562674">"తెరవడానికి మళ్లీ నొక్కండి"</string>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index 312a2df..abb525f 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -276,7 +276,7 @@
     <string name="throttle_current_usage" msgid="8762280193043815361">"Geçerli dönemde kullanılan veri"</string>
     <string name="throttle_time_frame" msgid="1915198770363734685">"Veri kullanım dönemi"</string>
     <string name="throttle_rate" msgid="4710388992676803508">"Veri hızı politikası"</string>
-    <string name="throttle_help" msgid="243651091785169900">"Daha fazla bilgi edinin"</string>
+    <string name="throttle_help" msgid="243651091785169900">"Daha fazla bilgi"</string>
     <string name="throttle_status_subtext" msgid="1657318943142085170">"<xliff:g id="USED_0">%1$s</xliff:g> (٪<xliff:g id="USED_1">%2$d</xliff:g>) / <xliff:g id="USED_2">%3$s</xliff:g> dönem maksimumu\nBir sonraki dönem <xliff:g id="USED_3">%4$d</xliff:g> gün sonra başlıyor (<xliff:g id="USED_4">%5$s</xliff:g>)"</string>
     <string name="throttle_data_usage_subtext" msgid="6029276011123694701">"Maksimum dönem <xliff:g id="USED_0">%1$s</xliff:g> (٪<xliff:g id="USED_1">%2$d</xliff:g>) / <xliff:g id="USED_2">%3$s</xliff:g>"</string>
     <string name="throttle_data_rate_reduced_subtext" msgid="7492763592720107737">"Maksimum değer <xliff:g id="USED_0">%1$s</xliff:g> aşıldı\nVeri hızı <xliff:g id="USED_1">%2$d</xliff:g> Kb/s\'ye düşürüldü"</string>
diff --git a/res/values-uz/strings.xml b/res/values-uz/strings.xml
index 32b7139..16d2ad2 100644
--- a/res/values-uz/strings.xml
+++ b/res/values-uz/strings.xml
@@ -253,7 +253,7 @@
     <string name="roaming_disable" msgid="1843417228755568110">"Rouming vaqtida mobil internetga ulanish"</string>
     <string name="roaming_reenable_message" msgid="6843814381576397939">"Rouming-internet yoqilmagan. Uni yoqish uchun bosing."</string>
     <string name="roaming_notification_title" msgid="4749053220884743110">"Mobil internet uzildi"</string>
-    <string name="roaming_warning" msgid="1603164667540144353">"Xarajati ancha yuqori bo‘lishi mumkin."</string>
+    <string name="roaming_warning" msgid="1603164667540144353">"Roumingda internet narxi ancha yuqori."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"Paketlar narxlari haqidagi ma’lumotni internet provayderingizdan olishingiz mumkin."</string>
     <string name="roaming_alert_title" msgid="3654815360303826008">"Internet-roumingga ruxsat berilsinmi?"</string>
     <string name="data_usage_title" msgid="4042209259808900283">"Ilova sarflagan trafik"</string>
@@ -264,7 +264,7 @@
     <string name="carrier_settings_euicc_summary" msgid="5115001942761995457">"<xliff:g id="CARRIER_NAME">%1$s</xliff:g> – <xliff:g id="PHONE_NUMBER">%2$s</xliff:g>"</string>
     <string name="mobile_data_settings_title" msgid="4661165467914727157">"Mobil internet"</string>
     <string name="mobile_data_settings_summary" msgid="5087255915840576895">"Mobil tarmoq orqali internetdan foydalanish"</string>
-    <string name="data_usage_disable_mobile" msgid="3577275288809667615">"Mobil internet o‘chirib qo‘yilsinmi?"</string>
+    <string name="data_usage_disable_mobile" msgid="3577275288809667615">"Mobil internet uzilsinmi?"</string>
     <string name="sim_selection_required_pref" msgid="7049424902961844236">"SIM kartani tanlang"</string>
     <string name="sim_change_data_title" msgid="5332425991853799280">"SIM karta o‘zgartirilsinmi?"</string>
     <string name="sim_change_data_message" msgid="2163963581444907496">"Mobil internet uchun <xliff:g id="OLD_SIM">%2$s</xliff:g> o‘rniga <xliff:g id="NEW_SIM">%1$s</xliff:g> SIM kartasidan foydalanilsinmi?"</string>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index 0e7bdc4..c97ea8f 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -253,7 +253,7 @@
     <string name="roaming_disable" msgid="1843417228755568110">"Kết nối với dịch vụ dữ liệu khi chuyển vùng"</string>
     <string name="roaming_reenable_message" msgid="6843814381576397939">"Tính năng Chuyển vùng dữ liệu bị tắt. Nhấn để bật."</string>
     <string name="roaming_notification_title" msgid="4749053220884743110">"Đã mất kết nối dữ liệu di động"</string>
-    <string name="roaming_warning" msgid="1603164667540144353">"Bạn có thể phải chịu các khoản phí đáng kể."</string>
+    <string name="roaming_warning" msgid="1603164667540144353">"Bạn có thể phải trả một khoản phí lớn."</string>
     <string name="roaming_check_price_warning" msgid="7497570906830902550">"Hãy liên hệ với nhà cung cấp mạng của bạn để biết giá cước."</string>
     <string name="roaming_alert_title" msgid="3654815360303826008">"Cho phép chuyển vùng dữ liệu?"</string>
     <string name="data_usage_title" msgid="4042209259808900283">"Mức sử dụng dữ liệu của ứng dụng"</string>
@@ -263,7 +263,7 @@
     <string name="keywords_carrier_settings_euicc" msgid="6861505396475991277">"nhà mạng, esim, sim, euicc, chuyển nhà mạng, thêm nhà mạng"</string>
     <string name="carrier_settings_euicc_summary" msgid="5115001942761995457">"<xliff:g id="CARRIER_NAME">%1$s</xliff:g> — <xliff:g id="PHONE_NUMBER">%2$s</xliff:g>"</string>
     <string name="mobile_data_settings_title" msgid="4661165467914727157">"Dữ liệu di động"</string>
-    <string name="mobile_data_settings_summary" msgid="5087255915840576895">"Truy cập dữ liệu bằng mạng di động"</string>
+    <string name="mobile_data_settings_summary" msgid="5087255915840576895">"Sử dụng dữ liệu qua mạng di động"</string>
     <string name="data_usage_disable_mobile" msgid="3577275288809667615">"Tắt dữ liệu di động?"</string>
     <string name="sim_selection_required_pref" msgid="7049424902961844236">"Bắt buộc lựa chọn"</string>
     <string name="sim_change_data_title" msgid="5332425991853799280">"Thay đổi SIM cho dữ liệu di động?"</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 734098f..dec69df 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -154,6 +154,7 @@
     </style>
 
     <style name="SettingsLight" parent="android:Theme.Material.Light">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:windowBackground">@color/phone_settings_background_color</item>
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:actionBarStyle">@style/DialtactsActionBarStyle</item>
@@ -183,11 +184,13 @@
 
     <style name="DialerAlertDialogTheme"
         parent="@android:style/Theme.Material.Light.Dialog">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:colorAccent">@color/dialer_theme_color</item>
         <item name="android:textColor">?android:attr/textColorPrimaryInverseDisableOnly</item>
     </style>
 
     <style name="NetworkOperatorsSettingsTheme" parent="@android:style/Theme.DeviceDefault.Settings">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:switchPreferenceStyle">@style/SettingsSwitchPreference</item>
         <item name="android:preferenceCategoryStyle">@style/SettingsPreferenceCategory</item>
         <item name="android:preferenceStyle">@style/SettingsPreference</item>
@@ -202,6 +205,7 @@
     </style>
 
     <style name="Empty" parent="@android:style/Theme.Material.Light">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:windowIsTranslucent">true</item>
         <item name="android:windowBackground">@android:color/transparent</item>
         <item name="android:windowContentOverlay">@null</item>
@@ -268,6 +272,7 @@
     </style>
 
     <style name="EmergencyDialerTheme" parent="@*android:style/Theme.DeviceDefault.Settings.Dark.NoActionBar">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:colorPrimaryDark">?android:attr/colorPrimary</item>
         <item name="android:colorBackgroundCacheHint">@null</item>
         <item name="android:windowShowWallpaper">true</item>
@@ -279,6 +284,7 @@
     </style>
 
     <style name="EmergencyDialerThemeDark" parent="@style/EmergencyDialerTheme">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
         <item name="emergencyButtonBackgroundColor">#19414549</item>
         <item name="android:colorControlHighlight">#40000000</item>
@@ -287,10 +293,12 @@
 
     <style name="EmergencyDialerAlertDialogTheme"
            parent="@android:style/Theme.Material.Dialog">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:textColor">?android:attr/textColorPrimary</item>
     </style>
 
     <style name="SimImportTheme" parent="@android:style/Theme.Material.Light">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:actionBarStyle">@style/TelephonyActionBarStyle</item>
         <item name="android:colorPrimaryDark">@color/dialer_theme_color_dark</item>
         <item name="android:homeAsUpIndicator">@drawable/ic_back_arrow</item>
@@ -298,6 +306,7 @@
     </style>
 
     <style name="OutgoingCallBroadcasterTheme" parent="@android:style/Theme.Holo.NoActionBar">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:windowBackground">@android:color/black</item>
 
         <item name="*android:windowAnimationStyle">@style/OutgoingAnimationStyle</item>
@@ -322,6 +331,7 @@
     </style>
 
     <style name="CallSettingsWithoutDividerTheme" parent="SettingsLight">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:listDivider">@null</item>
     </style>
 
diff --git a/res/xml/carrier_ss_string.xml b/res/xml/carrier_ss_string.xml
index 96bcfa4..826f0ea 100644
--- a/res/xml/carrier_ss_string.xml
+++ b/res/xml/carrier_ss_string.xml
@@ -74,10 +74,10 @@
 <resources>
     <!-- This is a parser format by Regular Expression.
          "response_format"'s position follow below index.
-         ((\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?)?)?)?#)
-         1 2        3   4       5   6       7   8       9   10      11  12      13  14      15  16
+         ((\d{2,3})(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*))?)?)?)?)?)?)?#)
+         1 2       3  4       5  6       7  8       9  10      11 12     13  14      15 16
     -->
-    <regular_parser>((\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?)?)?)?#)</regular_parser>
+    <regular_parser>((\d{2,3})(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*))?)?)?)?)?)?)?#)</regular_parser>
     <feature name="callforwarding">
         <command name="query"><!--For example: *#120*1#-->
             <service_code>120</service_code>
diff --git a/res/xml/carrier_ss_string_850.xml b/res/xml/carrier_ss_string_850.xml
index 53611d4..86d5743 100644
--- a/res/xml/carrier_ss_string_850.xml
+++ b/res/xml/carrier_ss_string_850.xml
@@ -22,10 +22,10 @@
 <resources>
     <!-- This is a parser format by Regular Expression.
          "response_format"'s position follow below index.
-         ((\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?)?)?)?#)
-         1 2        3   4       5   6       7   8       9   10      11  12      13  14      15  16
+         ((\d{2,3})(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*))?)?)?)?)?)?)?#)
+         1 2       3  4       5  6       7  8       9  10      11 12     13  14      15 16
     -->
-    <regular_parser>((\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?)?)?)?#)</regular_parser>
+    <regular_parser>((\d{2,3})(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*)(\*([^*#]*))?)?)?)?)?)?)?#)</regular_parser>
     <feature name="callforwarding">
         <command name="query"><!--For example: *#120*1#-->
             <service_code>120</service_code>
diff --git a/sip/res/values-de/strings.xml b/sip/res/values-de/strings.xml
index 2e8c8a2..62b91e1 100644
--- a/sip/res/values-de/strings.xml
+++ b/sip/res/values-de/strings.xml
@@ -34,7 +34,7 @@
     <string name="sip_menu_save" msgid="7882219814563869225">"Speichern"</string>
     <string name="sip_menu_discard" msgid="2350421645423888438">"Verwerfen"</string>
     <string name="alert_dialog_close" msgid="1326011828713435134">"Profil schließen"</string>
-    <string name="alert_dialog_ok" msgid="4752048404605388940">"OK"</string>
+    <string name="alert_dialog_ok" msgid="4752048404605388940">"Ok"</string>
     <string name="close_profile" msgid="3122414058856309881">"Schließen"</string>
     <string name="registration_status_checking_status" msgid="6136793741862200337">"Status wird überprüft…"</string>
     <string name="registration_status_registering" msgid="2677183977796278749">"Registrierung läuft…"</string>
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index c9fd205..e6fa00a 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -398,7 +398,8 @@
             prefSet.removePreference(mEnableVideoCalling);
         }
 
-        final PhoneAccountHandle simCallManager = mTelecomManager.getSimCallManager();
+        final PhoneAccountHandle simCallManager = mTelecomManager.getSimCallManagerForSubscription(
+                mPhone.getSubId());
         if (simCallManager != null) {
             Intent intent = PhoneAccountSettingsFragment.buildPhoneAccountConfigureIntent(
                     this, simCallManager);
@@ -442,6 +443,10 @@
                 }
             }
             mButtonWifiCalling.setSummary(resId);
+            Intent intent = mButtonWifiCalling.getIntent();
+            if (intent != null) {
+                intent.putExtra(Settings.EXTRA_SUB_ID, mPhone.getSubId());
+            }
             prefSet.addPreference(mButtonWifiCalling);
         }
 
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 1ea4180..e2e30ec 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -174,7 +174,7 @@
         @Override
         public void handleMessage(Message msg) {
             final int phoneId = msg.arg1;
-            log("mHandler: " + msg.what + " phoneId: " + phoneId);
+            logWithLocalLog("mHandler: " + msg.what + " phoneId: " + phoneId);
             switch (msg.what) {
                 case EVENT_CLEAR_CONFIG:
                 {
@@ -316,12 +316,17 @@
                 case EVENT_BIND_DEFAULT_TIMEOUT:
                 case EVENT_FETCH_DEFAULT_TIMEOUT:
                 {
-                    // If a ResponseReceiver callback is in the queue when this happens, we will
-                    // unbind twice and throw an exception.
-                    mContext.unbindService(mServiceConnection[phoneId]);
-                    removeMessages(EVENT_FETCH_DEFAULT_TIMEOUT);
-                    broadcastConfigChangedIntent(phoneId);
                     loge("bind/fetch time out from " + mPlatformCarrierConfigPackage);
+                    removeMessages(EVENT_FETCH_DEFAULT_TIMEOUT);
+                    // If we attempted to bind to the app, but the service connection is null due to
+                    // the race condition that clear config event happens before bind/fetch complete
+                    // then config was cleared while we were waiting and we should not continue.
+                    if (mServiceConnection[phoneId] != null) {
+                        // If a ResponseReceiver callback is in the queue when this happens, we will
+                        // unbind twice and throw an exception.
+                        mContext.unbindService(mServiceConnection[phoneId]);
+                        broadcastConfigChangedIntent(phoneId);
+                    }
                     notifySubscriptionInfoUpdater(phoneId);
                     break;
                 }
@@ -441,16 +446,20 @@
                 case EVENT_BIND_CARRIER_TIMEOUT:
                 case EVENT_FETCH_CARRIER_TIMEOUT:
                 {
-                    // If a ResponseReceiver callback is in the queue when this happens, we will
-                    // unbind twice and throw an exception.
-                    mContext.unbindService(mServiceConnection[phoneId]);
-                    removeMessages(EVENT_FETCH_CARRIER_TIMEOUT);
-                    broadcastConfigChangedIntent(phoneId);
                     loge("bind/fetch from carrier app timeout");
+                    removeMessages(EVENT_FETCH_CARRIER_TIMEOUT);
+                    // If we attempted to bind to the app, but the service connection is null due to
+                    // the race condition that clear config event happens before bind/fetch complete
+                    // then config was cleared while we were waiting and we should not continue.
+                    if (mServiceConnection[phoneId] != null) {
+                        // If a ResponseReceiver callback is in the queue when this happens, we will
+                        // unbind twice and throw an exception.
+                        mContext.unbindService(mServiceConnection[phoneId]);
+                        broadcastConfigChangedIntent(phoneId);
+                    }
                     notifySubscriptionInfoUpdater(phoneId);
                     break;
                 }
-
                 case EVENT_FETCH_CARRIER_DONE:
                 {
                     // If we attempted to bind to the app, but the service connection is null, then
@@ -926,6 +935,7 @@
     public void overrideConfig(int subscriptionId, PersistableBundle overrides) {
         mContext.enforceCallingOrSelfPermission(
                 android.Manifest.permission.MODIFY_PHONE_STATE, null);
+        //TODO: Also check for SHELL UID to restrict this method to testing only (b/131326259)
         int phoneId = SubscriptionManager.getPhoneId(subscriptionId);
         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
             log("Ignore invalid phoneId: " + phoneId + " for subId: " + subscriptionId);
@@ -942,7 +952,8 @@
         } else {
             mOverrideConfigs[phoneId].putAll(overrides);
         }
-        broadcastConfigChangedIntent(phoneId);
+
+        notifySubscriptionInfoUpdater(phoneId);
     }
 
     @Override
@@ -952,21 +963,17 @@
             log("Ignore invalid phoneId: " + phoneId + " for subId: " + subId);
             return;
         }
-        String callingPackageName = mContext.getPackageManager().getNameForUid(
-                Binder.getCallingUid());
-        // TODO: Check that the calling packages is privileged for subId specifically.
-        int privilegeStatus = TelephonyManager.from(mContext).checkCarrierPrivilegesForPackage(
-                callingPackageName);
-        // Requires the calling app to be either a carrier privileged app or
+
+        // Requires the calling app to be either a carrier privileged app for this subId or
         // system privileged app with MODIFY_PHONE_STATE permission.
-        if (privilegeStatus != TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
-            mContext.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE,
-                    "Require carrier privileges or MODIFY_PHONE_STATE permission.");
-        }
+        TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(mContext, subId,
+                "Require carrier privileges or MODIFY_PHONE_STATE permission.");
 
         // This method should block until deleting has completed, so that an error which prevents us
         // from clearing the cache is passed back to the carrier app. With the files successfully
         // deleted, this can return and we will eventually bind to the carrier app.
+        String callingPackageName = mContext.getPackageManager().getNameForUid(
+                Binder.getCallingUid());
         clearCachedConfigForPackage(callingPackageName);
         updateConfigForPhoneId(phoneId);
     }
@@ -975,7 +982,7 @@
     public void updateConfigForPhoneId(int phoneId, String simState) {
         mContext.enforceCallingOrSelfPermission(
                 android.Manifest.permission.MODIFY_PHONE_STATE, null);
-        log("update config for phoneId: " + phoneId + " simState: " + simState);
+        logWithLocalLog("update config for phoneId: " + phoneId + " simState: " + simState);
         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
             return;
         }
diff --git a/src/com/android/phone/CarrierXmlParser.java b/src/com/android/phone/CarrierXmlParser.java
index 4cf7e35..18602c9 100644
--- a/src/com/android/phone/CarrierXmlParser.java
+++ b/src/com/android/phone/CarrierXmlParser.java
@@ -18,6 +18,7 @@
 
 import android.content.Context;
 import android.content.res.XmlResourceParser;
+import android.support.annotation.VisibleForTesting;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.Log;
@@ -95,7 +96,9 @@
     private static final String ATTR_DEFINITION_KEY = "definition";
 
     HashMap<String, SsFeature> mFeatureMaps;
-    private static String sParserFormat = "";
+
+    @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
+    static String sParserFormat = "";
 
     // TAG_ENTRY_NUMBER and TAG_ENTRY_TIME is xml's entry value.
     // This is mapping user's input value. For example: number,time ...
@@ -155,6 +158,8 @@
                         mParserStr.add("");
                     }
                 }
+            } else {
+                Log.d(LOG_TAG, "no match");
             }
         }
 
diff --git a/src/com/android/phone/EmergencyAssistanceHelper.java b/src/com/android/phone/EmergencyAssistanceHelper.java
index b4e4421..1bf212e 100644
--- a/src/com/android/phone/EmergencyAssistanceHelper.java
+++ b/src/com/android/phone/EmergencyAssistanceHelper.java
@@ -29,7 +29,6 @@
 import android.os.Process;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
-import android.util.FeatureFlagUtils;
 import android.util.Log;
 
 import com.android.internal.util.CollectionUtils;
@@ -51,10 +50,6 @@
     public static String getIntentAction(Context context) {
         String action = context.getResources().getString(R.string.config_emergency_app_intent);
         if (!action.isEmpty()) {
-            // TODO: remove feature flag and this temporary intent once Emergency app was replaced.
-            if (!FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SAFETY_HUB)) {
-                return "com.android.emergency.action.EMERGENCY_ASSISTANCE";
-            }
             return action;
         }
 
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index c123e66..e67758d 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -149,12 +149,17 @@
 
 
     /**
-     * Returns true if Wifi calling is enabled for at least one phone.
+     * Returns true if Wifi calling is enabled for at least one subscription.
      */
     public static boolean isWifiCallingEnabled(Context context) {
-        int phoneCount = TelephonyManager.from(context).getPhoneCount();
-        for (int i = 0; i < phoneCount; i++) {
-            if (isWifiCallingEnabled(context, i)) {
+        SubscriptionManager subManager = context.getSystemService(SubscriptionManager.class);
+        if (subManager == null) {
+            Log.e(MobileNetworkFragment.LOG_TAG,
+                    "isWifiCallingEnabled: couldn't get system service.");
+            return false;
+        }
+        for (int subId : subManager.getActiveSubscriptionIdList()) {
+            if (isWifiCallingEnabled(context, subId)) {
                 return true;
             }
         }
@@ -162,11 +167,12 @@
     }
 
     /**
-     * Returns true if Wifi calling is enabled for the specific phone with id {@code phoneId}.
+     * Returns true if Wifi calling is enabled for the specific subscription with id {@code subId}.
      */
-    public static boolean isWifiCallingEnabled(Context context, int phoneId) {
+    public static boolean isWifiCallingEnabled(Context context, int subId) {
         final PhoneAccountHandle simCallManager =
-                TelecomManager.from(context).getSimCallManager();
+                TelecomManager.from(context).getSimCallManagerForSubscription(subId);
+        final int phoneId = SubscriptionManager.getSlotIndex(subId);
 
         boolean isWifiCallingEnabled;
         if (simCallManager != null) {
@@ -1890,14 +1896,14 @@
             }
 
             // Removes the preference if the wifi calling is disabled.
-            if (!isWifiCallingEnabled(getContext(), SubscriptionManager.getPhoneId(mSubId))) {
+            if (!isWifiCallingEnabled(getContext(), mSubId)) {
                 mCallingCategory.removePreference(mWiFiCallingPref);
                 return;
             }
 
             // See what Telecom thinks the SIM call manager is.
             final PhoneAccountHandle simCallManager =
-                    TelecomManager.from(getContext()).getSimCallManager();
+                    TelecomManager.from(getContext()).getSimCallManagerForSubscription(mSubId);
 
             // Check which SIM call manager is for the current sub ID.
             PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index de3fffc..942c1e2 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -569,9 +569,8 @@
         if (DBG) log("showDataDisconnectedRoaming()...");
 
         // "Mobile network settings" screen / dialog
-        Intent intent = new Intent(mContext, com.android.phone.MobileNetworkSettings.class);
+        Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
         intent.putExtra(Settings.EXTRA_SUB_ID, subId);
-        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
         PendingIntent contentIntent = PendingIntent.getActivity(mContext, subId, intent, 0);
 
         final CharSequence contentText = mContext.getText(R.string.roaming_reenable_message);
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 7ea0f66..0511727 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -121,6 +121,7 @@
 import com.android.internal.telephony.CommandException;
 import com.android.internal.telephony.DefaultPhoneNotifier;
 import com.android.internal.telephony.HalVersion;
+import com.android.internal.telephony.IIntegerConsumer;
 import com.android.internal.telephony.INumberVerificationCallback;
 import com.android.internal.telephony.ITelephony;
 import com.android.internal.telephony.IccCard;
@@ -139,8 +140,10 @@
 import com.android.internal.telephony.ServiceStateTracker;
 import com.android.internal.telephony.SmsApplication;
 import com.android.internal.telephony.SmsApplication.SmsApplicationData;
+import com.android.internal.telephony.SmsPermissions;
 import com.android.internal.telephony.SubscriptionController;
 import com.android.internal.telephony.TelephonyPermissions;
+import com.android.internal.telephony.dataconnection.ApnSettingUtils;
 import com.android.internal.telephony.emergency.EmergencyNumberTracker;
 import com.android.internal.telephony.euicc.EuiccConnector;
 import com.android.internal.telephony.ims.ImsResolver;
@@ -155,6 +158,7 @@
 import com.android.internal.telephony.uicc.UiccSlot;
 import com.android.internal.telephony.util.VoicemailNotificationSettingsUtil;
 import com.android.internal.util.HexDump;
+import com.android.phone.settings.PickSmsSubscriptionActivity;
 import com.android.phone.vvm.PhoneAccountHandleConverter;
 import com.android.phone.vvm.RemoteVvmTaskManager;
 import com.android.phone.vvm.VisualVoicemailSettingsUtil;
@@ -171,6 +175,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.NoSuchElementException;
 import java.util.Set;
 
 /**
@@ -247,6 +252,8 @@
     private static final int EVENT_REQUEST_CELL_INFO_UPDATE_DONE = 67;
     private static final int CMD_REQUEST_ENABLE_MODEM = 68;
     private static final int EVENT_ENABLE_MODEM_DONE = 69;
+    private static final int CMD_GET_MODEM_STATUS = 70;
+    private static final int EVENT_GET_MODEM_STATUS_DONE = 71;
 
     // Parameters of select command.
     private static final int SELECT_COMMAND = 0xA4;
@@ -1116,10 +1123,42 @@
                     ar = (AsyncResult) msg.obj;
                     request = (MainThreadRequest) ar.userObj;
                     request.result = (ar.exception == null);
+                    int phoneId = request.phone.getPhoneId();
                     //update the cache as modem status has changed
-                    mPhoneConfigurationManager.addToPhoneStatusCache(
-                            request.phone.getPhoneId(), msg.arg1 == 1);
-                    updateModemStateMetrics();
+                    if ((boolean) request.result) {
+                        mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
+                        updateModemStateMetrics();
+                    } else {
+                        Log.e(LOG_TAG, msg.what + " failure. Not updating modem status."
+                                + ar.exception);
+                    }
+                    notifyRequester(request);
+                    break;
+                case CMD_GET_MODEM_STATUS:
+                    request = (MainThreadRequest) msg.obj;
+                    onCompleted = obtainMessage(EVENT_GET_MODEM_STATUS_DONE, request);
+                    PhoneConfigurationManager.getInstance()
+                            .getPhoneStatusFromModem(request.phone, onCompleted);
+                    break;
+                case EVENT_GET_MODEM_STATUS_DONE:
+                    ar = (AsyncResult) msg.obj;
+                    request = (MainThreadRequest) ar.userObj;
+                    int id = request.phone.getPhoneId();
+                    if (ar.exception == null && ar.result != null) {
+                        request.result = ar.result;
+                        //update the cache as modem status has changed
+                        mPhoneConfigurationManager.addToPhoneStatusCache(id,
+                                (boolean) request.result);
+                    } else {
+                        // Return true if modem status cannot be retrieved. For most cases,
+                        // modem status is on. And for older version modems, GET_MODEM_STATUS
+                        // and disable modem are not supported. Modem is always on.
+                        // TODO: this should be fixed in R to support a third
+                        // status UNKNOWN b/131631629
+                        request.result = true;
+                        Log.e(LOG_TAG, msg.what + " failure. Not updating modem status."
+                                + ar.exception);
+                    }
                     notifyRequester(request);
                     break;
                 default:
@@ -2100,10 +2139,16 @@
             case DENIED_HARD:
                 throw new SecurityException("Not allowed to access cell info");
             case DENIED_SOFT:
+                try {
+                    cb.onCellInfo(new ArrayList<CellInfo>());
+                } catch (RemoteException re) {
+                    // Drop without consequences
+                }
                 return;
         }
 
-        final Phone phone = getPhone(subId);
+
+        final Phone phone = getPhoneFromSubId(subId);
         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
 
         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
@@ -3031,10 +3076,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
-            boolean isRoaming = TelephonyManager.from(
-                    getPhone(subId).getContext()).isNetworkRoaming(subId);
             ImsManager.getInstance(mApp,
-                    getSlotIndexOrException(subId)).setWfcNonPersistent(isCapable, mode, isRoaming);
+                    getSlotIndexOrException(subId)).setWfcNonPersistent(isCapable, mode);
         } finally {
             Binder.restoreCallingIdentity(identity);
         }
@@ -4448,9 +4491,16 @@
                 }
             }
         }
-        return mNetworkScanRequestTracker.startNetworkScan(
-                request, messenger, binder, getPhone(subId),
-                callingPackage);
+        int callingUid = Binder.getCallingUid();
+        int callingPid = Binder.getCallingPid();
+        final long identity = Binder.clearCallingIdentity();
+        try {
+            return mNetworkScanRequestTracker.startNetworkScan(
+                    request, messenger, binder, getPhone(subId),
+                    callingUid, callingPid, callingPackage);
+        } finally {
+            Binder.restoreCallingIdentity(identity);
+        }
     }
 
     private SecurityException checkNetworkRequestForSanitizedLocationAccess(
@@ -4484,9 +4534,10 @@
         TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(
                 mApp, subId, "stopNetworkScan");
 
+        int callingUid = Binder.getCallingUid();
         final long identity = Binder.clearCallingIdentity();
         try {
-            mNetworkScanRequestTracker.stopNetworkScan(scanId);
+            mNetworkScanRequestTracker.stopNetworkScan(scanId, callingUid);
         } finally {
             Binder.restoreCallingIdentity(identity);
         }
@@ -4936,7 +4987,7 @@
     }
 
     @Override
-    public String[] getMergedSubscriberIds(String callingPackage) {
+    public String[] getMergedSubscriberIds(int subId, String callingPackage) {
         // This API isn't public, so no need to provide a valid subscription ID - we're not worried
         // about carrier-privileged callers not having access.
         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
@@ -4945,6 +4996,9 @@
             return null;
         }
 
+        // Clear calling identity, when calling TelephonyManager, because callerUid must be
+        // the process, where TelephonyManager was instantiated.
+        // Otherwise AppOps check will fail.
         final long identity  = Binder.clearCallingIdentity();
         try {
             final Context context = mApp;
@@ -4953,12 +5007,10 @@
 
             // Figure out what subscribers are currently active
             final ArraySet<String> activeSubscriberIds = new ArraySet<>();
-            // Clear calling identity, when calling TelephonyManager, because callerUid must be
-            // the process, where TelephonyManager was instantiated.
-            // Otherwise AppOps check will fail.
 
-            final int[] subIds = sub.getActiveSubscriptionIdList();
-            for (int subId : subIds) {
+            // Only consider subs which match the current subId
+            // This logic can be simplified. See b/131189269 for progress.
+            if (isActiveSubscription(subId)) {
                 activeSubscriberIds.add(tele.getSubscriberId(subId));
             }
 
@@ -5543,6 +5595,7 @@
                                 .setCallingPid(Binder.getCallingPid())
                                 .setCallingUid(Binder.getCallingUid())
                                 .setMethod("getServiceStateForSubscriber")
+                                .setLogAsInfo(true)
                                 .setMinSdkVersionForFine(Build.VERSION_CODES.Q)
                                 .build());
 
@@ -5553,6 +5606,7 @@
                                 .setCallingPid(Binder.getCallingPid())
                                 .setCallingUid(Binder.getCallingUid())
                                 .setMethod("getServiceStateForSubscriber")
+                                .setLogAsInfo(true)
                                 .setMinSdkVersionForCoarse(Build.VERSION_CODES.Q)
                                 .build());
         // We don't care about hard or soft here -- all we need to know is how much info to scrub.
@@ -6289,14 +6343,16 @@
 
     @Override
     public List<UiccCardInfo> getUiccCardsInfo(String callingPackage) {
+        boolean hasReadPermission = false;
         try {
             enforceReadPrivilegedPermission("getUiccCardsInfo");
+            hasReadPermission = true;
         } catch (SecurityException e) {
             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
             // has carrier privileges on an active UICC
             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
                         != TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
-                throw new SecurityException("Caller does not have carrier privileges on any UICC");
+                throw new SecurityException("Caller does not have permission.");
             }
         }
 
@@ -6304,27 +6360,30 @@
         try {
             UiccController uiccController = UiccController.getInstance();
             ArrayList<UiccCardInfo> cardInfos = uiccController.getAllUiccCardInfos();
-
-            ApplicationInfo ai = mApp.getPackageManager().getApplicationInfo(callingPackage, 0);
-            if ((ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
-                // Remove private info if the caller doesn't have access
-                ArrayList<UiccCardInfo> filteredInfos = new ArrayList<>();
-                for (UiccCardInfo cardInfo : cardInfos) {
-                    UiccCard card = uiccController.getUiccCard(cardInfo.getSlotIndex());
-                    UiccProfile profile = card.getUiccProfile();
-                    if (profile.getCarrierPrivilegeStatus(mApp.getPackageManager(), callingPackage)
-                            != TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
-                        filteredInfos.add(cardInfo.getUnprivileged());
-                    } else {
-                        filteredInfos.add(cardInfo);
-                    }
-                }
-                return filteredInfos;
+            if (hasReadPermission) {
+                return cardInfos;
             }
-            return cardInfos;
-        } catch (PackageManager.NameNotFoundException e) {
-            // This should not happen since we pass the package info in from TelephonyManager
-            throw new SecurityException("Invalid calling package.");
+
+            // Remove private info if the caller doesn't have access
+            ArrayList<UiccCardInfo> filteredInfos = new ArrayList<>();
+            for (UiccCardInfo cardInfo : cardInfos) {
+                // For an inactive eUICC, the UiccCard will be null even though the UiccCardInfo
+                // is available
+                UiccCard card = uiccController.getUiccCardForSlot(cardInfo.getSlotIndex());
+                if (card == null || card.getUiccProfile() == null) {
+                    // assume no access if the card or profile is unavailable
+                    filteredInfos.add(cardInfo.getUnprivileged());
+                    continue;
+                }
+                UiccProfile profile = card.getUiccProfile();
+                if (profile.getCarrierPrivilegeStatus(mApp.getPackageManager(), callingPackage)
+                        == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
+                    filteredInfos.add(cardInfo);
+                } else {
+                    filteredInfos.add(cardInfo.getUnprivileged());
+                }
+            }
+            return filteredInfos;
         } finally {
             Binder.restoreCallingIdentity(identity);
         }
@@ -6805,7 +6864,11 @@
 
         final long identity = Binder.clearCallingIdentity();
         try {
-            return PhoneConfigurationManager.getInstance().getPhoneStatus(phone);
+            try {
+                return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
+            } catch (NoSuchElementException ex) {
+                return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
+            }
         } finally {
             Binder.restoreCallingIdentity(identity);
         }
@@ -6954,4 +7017,73 @@
         if (hv.equals(HalVersion.UNKNOWN)) return -1;
         return hv.major * 100 + hv.minor;
     }
+
+    /**
+     * Return whether data is enabled for certain APN type. This will tell if framework will accept
+     * corresponding network requests on a subId.
+     *
+     *  Data is enabled if:
+     *  1) user data is turned on, or
+     *  2) APN is un-metered for this subscription, or
+     *  3) APN type is whitelisted. E.g. MMS is whitelisted if
+     *  {@link SubscriptionManager#setAlwaysAllowMmsData} is turned on.
+     *
+     * @return whether data is allowed for a apn type.
+     *
+     * @hide
+     */
+    @Override
+    public boolean isDataEnabledForApn(int apnType, int subId, String callingPackage) {
+        if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+                mApp, subId, callingPackage, "isDataEnabledForApn")) {
+            throw new SecurityException("Needs READ_PHONE_STATE for isDataEnabledForApn");
+        }
+
+        // Now that all security checks passes, perform the operation as ourselves.
+        final long identity = Binder.clearCallingIdentity();
+        try {
+            Phone phone = getPhone(subId);
+            if (phone == null) return false;
+
+            boolean isMetered = ApnSettingUtils.isMeteredApnType(ApnSetting.getApnTypeString(
+                    apnType), phone);
+            return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
+        } finally {
+            Binder.restoreCallingIdentity(identity);
+        }
+    }
+
+    @Override
+    public boolean isApnMetered(int apnType, int subId) {
+        enforceReadPrivilegedPermission("isApnMetered");
+
+        // Now that all security checks passes, perform the operation as ourselves.
+        final long identity = Binder.clearCallingIdentity();
+        try {
+            Phone phone = getPhone(subId);
+            if (phone == null) return true; // By default return true.
+
+            return ApnSettingUtils.isMeteredApnType(ApnSetting.getApnTypeString(
+                    apnType), phone);
+        } finally {
+            Binder.restoreCallingIdentity(identity);
+        }
+    }
+
+    @Override
+    public void enqueueSmsPickResult(String callingPackage, IIntegerConsumer pendingSubIdResult) {
+        SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
+                (AppOpsManager) mApp.getSystemService(Context.APP_OPS_SERVICE));
+        if (!permissions.checkCallingCanSendSms(callingPackage, "Sending message")) {
+            throw new SecurityException("Requires SEND_SMS permission to perform this operation");
+        }
+        PickSmsSubscriptionActivity.addPendingResult(pendingSubIdResult);
+        Intent intent = new Intent();
+        intent.setClass(mApp, PickSmsSubscriptionActivity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        // Bring up choose default SMS subscription dialog right now
+        intent.putExtra(PickSmsSubscriptionActivity.DIALOG_TYPE_KEY,
+                PickSmsSubscriptionActivity.SMS_PICK_FOR_MESSAGE);
+        mApp.startActivity(intent);
+    }
 }
diff --git a/src/com/android/phone/settings/PickSmsSubscriptionActivity.java b/src/com/android/phone/settings/PickSmsSubscriptionActivity.java
new file mode 100644
index 0000000..cfbce28
--- /dev/null
+++ b/src/com/android/phone/settings/PickSmsSubscriptionActivity.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2019 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.phone.settings;
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.telephony.SubscriptionManager;
+import android.util.Log;
+
+import com.android.internal.telephony.IIntegerConsumer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Trampolines a request to Settings to get the SMS subscription associated with an SmsManager
+ * operation.
+ *
+ * Since a Service can not start an Activity with
+ * {@link Activity#startActivityForResult(Intent, int)} and get a response (only Activities can
+ * handle the results), we have to "Trampoline" this operation by creating an empty Activity whose
+ * only job is to call startActivityForResult with the correct Intent and handle the result.
+ */
+// TODO: SmsManager should be constructed with an activity context so it can start as part of its
+// task and fall back to PickSmsSubscriptionActivity being called in PhoneInterfaceManager if not
+// called from an activity context.
+public class PickSmsSubscriptionActivity extends Activity {
+
+    private static final String LOG_TAG = "PickSmsSubActivity";
+
+    // Defined in Settings SimDialogActivity
+    private static final String RESULT_SUB_ID = "result_sub_id";
+    public static final String DIALOG_TYPE_KEY = "dialog_type";
+    public static final int SMS_PICK_FOR_MESSAGE = 4;
+
+    private static final ComponentName SETTINGS_SUB_PICK_ACTIVITY = new ComponentName(
+            "com.android.settings", "com.android.settings.sim.SimDialogActivity");
+
+    private static final List<IIntegerConsumer> sSmsPickPendingList = new ArrayList<>();
+
+    private static final int REQUEST_GET_SMS_SUB_ID = 1;
+
+    /**
+     * Adds a consumer to the list of pending results that will be accepted once the activity
+     * completes.
+     */
+    public static void addPendingResult(IIntegerConsumer consumer) {
+        synchronized (sSmsPickPendingList) {
+            sSmsPickPendingList.add(consumer);
+        }
+        Log.i(LOG_TAG, "queue pending result, token: " + consumer);
+    }
+
+    private static void sendResultAndClear(int resultId) {
+        // If the calling process died, just ignore callback.
+        synchronized (sSmsPickPendingList) {
+            for (IIntegerConsumer c : sSmsPickPendingList) {
+                try {
+                    c.accept(resultId);
+                    Log.i(LOG_TAG, "Result received, token: " + c + ", result: " + resultId);
+                } catch (RemoteException e) {
+                    // The calling process died, skip this one.
+                }
+            }
+            sSmsPickPendingList.clear();
+        }
+    }
+
+    // Keep track if this activity has been stopped (i.e. user navigated away, power screen off,...)
+    // if so, treat it as the user navigating away and end the task if it is restarted without an
+    // onCreate/onNewIntent.
+    private boolean mPreviouslyStopped = false;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        mPreviouslyStopped = false;
+    }
+
+    @Override
+    protected void onNewIntent(Intent intent) {
+        mPreviouslyStopped = false;
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        // This is cause a little jank with the recents display, but there is no other way to handle
+        // the case where activity has stopped and we want to dismiss the dialog. We use the
+        // tag "excludeFromRecents", but in the cases where it is still shown, kill it in onResume.
+        if (mPreviouslyStopped) {
+            finishAndRemoveTask();
+        } else {
+            launchSmsPicker(new Intent(getIntent()));
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        // User navigated away from dialog, send invalid sub id result.
+        mPreviouslyStopped = true;
+        sendResultAndClear(SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+        // triggers cancelled result for onActivityResult
+        finishActivity(REQUEST_GET_SMS_SUB_ID);
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (requestCode == REQUEST_GET_SMS_SUB_ID) {
+            int result = data == null ? SubscriptionManager.INVALID_SUBSCRIPTION_ID :
+                    data.getIntExtra(RESULT_SUB_ID, SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+            if (resultCode == Activity.RESULT_OK) {
+                sendResultAndClear(result);
+            } else {
+                sendResultAndClear(SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+            }
+        }
+        // This will be handled in onResume - we do not want to call this all the time here because
+        // we need to be able to restart if stopped and a new intent comes in via onNewIntent.
+        if (!mPreviouslyStopped) {
+            finishAndRemoveTask();
+        }
+    }
+
+    private void launchSmsPicker(Intent trampolineIntent) {
+        trampolineIntent.setComponent(SETTINGS_SUB_PICK_ACTIVITY);
+        // Remove this flag if it exists, we want the settings activity to be part of this task.
+        trampolineIntent.removeFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        startActivityForResult(trampolineIntent, REQUEST_GET_SMS_SUB_ID);
+    }
+}
diff --git a/src/com/android/services/telephony/ImsConference.java b/src/com/android/services/telephony/ImsConference.java
index cada504..1f157e3 100644
--- a/src/com/android/services/telephony/ImsConference.java
+++ b/src/com/android/services/telephony/ImsConference.java
@@ -209,6 +209,11 @@
             Log.v(this, "onExtrasRemoved: c=" + c + " key=" + keys);
             removeExtras(keys);
         }
+
+        @Override
+        public void onConnectionEvent(Connection c, String event, Bundle extras) {
+            sendConnectionEvent(event, extras);
+        }
     };
 
     /**
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index fd7eeb2..498625d 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -177,6 +177,8 @@
         public int capabilities;
         // By default, we will assume that the slots are not locked.
         public boolean isLocked = false;
+        // Is the emergency number associated with the slot
+        public boolean hasDialedEmergencyNumber = false;
 
         public SlotStatus(int slotId, int capabilities) {
             this.slotId = slotId;
@@ -1356,31 +1358,41 @@
         if (potentialEmergencyPhones.size() > 0) {
             Log.i(this, "getPhoneForEmergencyCall, Phone Id that supports emergency number:"
                     + potentialEmergencyPhones.get(0).getPhoneId());
-            return potentialEmergencyPhones.get(0);
+            return getFirstPhoneForEmergencyCall(potentialEmergencyPhones);
         }
         // c)
         return getFirstPhoneForEmergencyCall();
     }
 
+    @VisibleForTesting
+    public Phone getFirstPhoneForEmergencyCall() {
+        return getFirstPhoneForEmergencyCall(null);
+    }
+
     /**
      * Retrieves the most sensible Phone to use for an emergency call using the following Priority
      *  list (for multi-SIM devices):
      *  1) The User's SIM preference for Voice calling
      *  2) The First Phone that is currently IN_SERVICE or is available for emergency calling
-     *  3) If there is a PUK locked SIM, compare the SIMs that are not PUK locked. If all the SIMs
-     *     are locked, skip to condition 4).
-     *  4) The Phone with more Capabilities.
-     *  5) The First Phone that has a SIM card in it (Starting from Slot 0...N)
-     *  6) The Default Phone (Currently set as Slot 0)
+     *  3) Prioritize phones that have the dialed emergency number as part of their emergency
+     *     number list
+     *  4) If there is a PUK locked SIM, compare the SIMs that are not PUK locked. If all the SIMs
+     *     are locked, skip to condition 5).
+     *  5) The Phone with more Capabilities.
+     *  6) The First Phone that has a SIM card in it (Starting from Slot 0...N)
+     *  7) The Default Phone (Currently set as Slot 0)
      */
     @VisibleForTesting
-    public Phone getFirstPhoneForEmergencyCall() {
+    public Phone getFirstPhoneForEmergencyCall(List<Phone> phonesWithEmergencyNumber) {
         // 1)
         int phoneId = mSubscriptionManagerProxy.getDefaultVoicePhoneId();
         if (phoneId != SubscriptionManager.INVALID_PHONE_INDEX) {
             Phone defaultPhone = mPhoneFactoryProxy.getPhone(phoneId);
             if (defaultPhone != null && isAvailableForEmergencyCalls(defaultPhone)) {
-                return defaultPhone;
+                if (phonesWithEmergencyNumber == null
+                        || phonesWithEmergencyNumber.contains(defaultPhone)) {
+                    return defaultPhone;
+                }
             }
         }
 
@@ -1394,25 +1406,38 @@
             }
             // 2)
             if (isAvailableForEmergencyCalls(phone)) {
-                // the slot has the radio on & state is in service.
-                Log.i(this, "getFirstPhoneForEmergencyCall, radio on & in service, Phone Id:" + i);
-                return phone;
+                if (phonesWithEmergencyNumber == null
+                        || phonesWithEmergencyNumber.contains(phone)) {
+                    // the slot has the radio on & state is in service.
+                    Log.i(this,
+                            "getFirstPhoneForEmergencyCall, radio on & in service, Phone Id:" + i);
+                    return phone;
+                }
             }
-            // 4)
+            // 5)
             // Store the RAF Capabilities for sorting later.
             int radioAccessFamily = phone.getRadioAccessFamily();
             SlotStatus status = new SlotStatus(i, radioAccessFamily);
             phoneSlotStatus.add(status);
             Log.i(this, "getFirstPhoneForEmergencyCall, RAF:" +
                     Integer.toHexString(radioAccessFamily) + " saved for Phone Id:" + i);
-            // 3)
+            // 4)
             // Report Slot's PIN/PUK lock status for sorting later.
             int simState = mSubscriptionManagerProxy.getSimStateForSlotIdx(i);
             if (simState == TelephonyManager.SIM_STATE_PIN_REQUIRED ||
                     simState == TelephonyManager.SIM_STATE_PUK_REQUIRED) {
                 status.isLocked = true;
             }
-            // 5)
+            // 3) Store if the Phone has the corresponding emergency number
+            if (phonesWithEmergencyNumber != null) {
+                for (Phone phoneWithEmergencyNumber : phonesWithEmergencyNumber) {
+                    if (phoneWithEmergencyNumber != null
+                            && phoneWithEmergencyNumber.getPhoneId() == i) {
+                        status.hasDialedEmergencyNumber = true;
+                    }
+                }
+            }
+            // 6)
             if (firstPhoneWithSim == null && mTelephonyManagerProxy.hasIccCard(i)) {
                 // The slot has a SIM card inserted, but is not in service, so keep track of this
                 // Phone. Do not return because we want to make sure that none of the other Phones
@@ -1422,19 +1447,28 @@
                         firstPhoneWithSim.getPhoneId());
             }
         }
-        // 6)
+        // 7)
         if (firstPhoneWithSim == null && phoneSlotStatus.isEmpty()) {
-            // No Phones available, get the default.
-            Log.i(this, "getFirstPhoneForEmergencyCall, return default phone");
-            return mPhoneFactoryProxy.getDefaultPhone();
+            if (phonesWithEmergencyNumber == null || phonesWithEmergencyNumber.isEmpty()) {
+                // No Phones available, get the default
+                Log.i(this, "getFirstPhoneForEmergencyCall, return default phone");
+                return  mPhoneFactoryProxy.getDefaultPhone();
+            }
+            return phonesWithEmergencyNumber.get(0);
         } else {
-            // 4)
+            // 5)
             final int defaultPhoneId = mPhoneFactoryProxy.getDefaultPhone().getPhoneId();
             final Phone firstOccupiedSlot = firstPhoneWithSim;
             if (!phoneSlotStatus.isEmpty()) {
                 // Only sort if there are enough elements to do so.
                 if (phoneSlotStatus.size() > 1) {
                     Collections.sort(phoneSlotStatus, (o1, o2) -> {
+                        if (!o1.hasDialedEmergencyNumber && o2.hasDialedEmergencyNumber) {
+                            return -1;
+                        }
+                        if (o1.hasDialedEmergencyNumber && !o2.hasDialedEmergencyNumber) {
+                            return 1;
+                        }
                         // First start by seeing if either of the phone slots are locked. If they
                         // are, then sort by non-locked SIM first. If they are both locked, sort
                         // by capability instead.
@@ -1480,7 +1514,7 @@
                         "with highest capability");
                 return mPhoneFactoryProxy.getPhone(mostCapablePhoneId);
             } else {
-                // 5)
+                // 6)
                 return firstPhoneWithSim;
             }
         }
diff --git a/testapps/SmsManagerTestApp/Android.mk b/testapps/SmsManagerTestApp/Android.mk
new file mode 100644
index 0000000..307366b
--- /dev/null
+++ b/testapps/SmsManagerTestApp/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+src_dirs := src
+res_dirs := res
+
+LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs))
+LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs))
+
+LOCAL_PACKAGE_NAME := SmsManagerTestApp
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
diff --git a/testapps/SmsManagerTestApp/AndroidManifest.xml b/testapps/SmsManagerTestApp/AndroidManifest.xml
new file mode 100644
index 0000000..c5f4621
--- /dev/null
+++ b/testapps/SmsManagerTestApp/AndroidManifest.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2017 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
+  -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="com.android.phone.testapps.smsmanagertestapp">
+    <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="29" />
+    <uses-permission android:name="android.permission.SEND_SMS"/>
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
+    <application android:label="SmsManagerTestApp">
+        <activity
+            android:name=".SmsManagerTestApp"
+            android:label="SmsManagerTestApp">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <service android:name=".SmsManagerTestService" android:exported="false" />
+        <receiver android:name=".SendStatusReceiver"
+                  android:exported="false">
+            <intent-filter>
+                <action android:name="com.android.phone.testapps.smsmanagertestapp.message_sent_action" />
+                <data android:scheme="content" />
+            </intent-filter>
+        </receiver>
+
+    </application>
+</manifest>
+
diff --git a/testapps/SmsManagerTestApp/res/layout/activity_main.xml b/testapps/SmsManagerTestApp/res/layout/activity_main.xml
new file mode 100644
index 0000000..39fb6c6
--- /dev/null
+++ b/testapps/SmsManagerTestApp/res/layout/activity_main.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2017 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
+  -->
+
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:paddingLeft="4dp">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical" >
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" android:layout_weight="0"
+            android:text="Outgoing SMS Phone Number"/>
+
+        <EditText
+            android:id="@+id/phone_number_text"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:inputType="phone" android:text="5555551212"/>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height= "1dp"
+            android:paddingRight="4dp"
+            android:background="?android:attr/listDivider" />
+
+        <Button
+            android:id="@+id/send_text_button"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingRight="4dp"
+            android:text="@string/send_text_button"/>
+        <Button
+            android:id="@+id/send_text_button_service"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingRight="4dp"
+            android:text="@string/send_text_service_button"/>
+        <Button
+            android:id="@+id/get_sub_for_result_button"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingRight="4dp"
+            android:text="@string/get_sub_for_result_button"/>
+    </LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/testapps/SmsManagerTestApp/res/values/donottranslate_strings.xml b/testapps/SmsManagerTestApp/res/values/donottranslate_strings.xml
new file mode 100644
index 0000000..d6497a3
--- /dev/null
+++ b/testapps/SmsManagerTestApp/res/values/donottranslate_strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2017 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>
+    <string name="send_text_button">Send Outgoing Text Now.</string>
+    <string name="send_text_service_button">Send Outgoing Text after 5 sec.</string>
+    <string name="get_sub_for_result_button">Ask user for sub id.</string>
+</resources>
\ No newline at end of file
diff --git a/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SendStatusReceiver.java b/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SendStatusReceiver.java
new file mode 100644
index 0000000..03709d1
--- /dev/null
+++ b/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SendStatusReceiver.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2019 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.phone.testapps.smsmanagertestapp;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.widget.Toast;
+
+/**
+ * Handles the PendingIntent result from SMS messages send to Telephony. Reports the results of
+ * those messages using Toasts.
+ */
+public class SendStatusReceiver extends BroadcastReceiver {
+
+    public static final String MESSAGE_SENT_ACTION =
+            "com.android.phone.testapps.smsmanagertestapp.message_sent_action";
+
+    // Defined by platform, but no constant provided. See docs for SmsManager.sendTextMessage.
+    private static final String EXTRA_ERROR_CODE = "errorCode";
+    private static final String EXTRA_NO_DEFAULT = "noDefault";
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        final int resultCode = getResultCode();
+        if (MESSAGE_SENT_ACTION.equals(intent.getAction())) {
+            int errorCode = intent.getIntExtra(EXTRA_ERROR_CODE, -1);
+            boolean userCancel = intent.getBooleanExtra(EXTRA_NO_DEFAULT, false);
+            if (userCancel) {
+                Toast.makeText(context, "SMS not sent, user cancelled.", Toast.LENGTH_LONG).show();
+            } else {
+                Toast.makeText(context, "SMS result=" + resultCode + ", error extra=" + errorCode,
+                        Toast.LENGTH_LONG).show();
+            }
+        }
+    }
+}
diff --git a/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SmsManagerTestApp.java b/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SmsManagerTestApp.java
new file mode 100644
index 0000000..75536f3
--- /dev/null
+++ b/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SmsManagerTestApp.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2019 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.phone.testapps.smsmanagertestapp;
+
+import android.Manifest;
+import android.app.Activity;
+import android.app.PendingIntent;
+import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.os.Bundle;
+import android.telephony.SmsManager;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+/**
+ * Supports sending an SMS immediately and offloading the sending of the SMS to a background task.
+ */
+public class SmsManagerTestApp extends Activity {
+
+    private static final int REQUEST_PERMISSION_READ_STATE = 1;
+    private static final int REQUEST_GET_SMS_SUB_ID = 2;
+
+    private static final ComponentName SETTINGS_SUB_PICK_ACTIVITY = new ComponentName(
+            "com.android.settings", "com.android.settings.sim.SimDialogActivity");
+
+    /*
+     * Forwarded constants from SimDialogActivity.
+     */
+    private static final String DIALOG_TYPE_KEY = "dialog_type";
+    public static final String RESULT_SUB_ID = "result_sub_id";
+    private static final int SMS_PICK = 2;
+
+    private static int sMessageId = 0;
+    private boolean mIsReadPhoneStateGranted = false;
+
+    private EditText mPhoneNumber;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_main);
+
+        findViewById(R.id.send_text_button).setOnClickListener(this::sendOutgoingSms);
+        findViewById(R.id.send_text_button_service)
+                .setOnClickListener(this::sendOutgoingSmsService);
+        findViewById(R.id.get_sub_for_result_button).setOnClickListener(this::getSubIdForResult);
+        mPhoneNumber = (EditText) findViewById(R.id.phone_number_text);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (checkSelfPermission(Manifest.permission.READ_PHONE_STATE)
+                != PackageManager.PERMISSION_GRANTED
+                || checkSelfPermission(Manifest.permission.SEND_SMS)
+                        != PackageManager.PERMISSION_GRANTED) {
+            mIsReadPhoneStateGranted = false;
+            requestPermissions(new String[]{Manifest.permission.READ_PHONE_STATE,
+                    Manifest.permission.SEND_SMS}, REQUEST_PERMISSION_READ_STATE);
+        } else {
+            mIsReadPhoneStateGranted = true;
+        }
+        if (mIsReadPhoneStateGranted) {
+            mPhoneNumber.setText(getPhoneNumber(), TextView.BufferType.NORMAL);
+        }
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        stopService(new Intent(this, SmsManagerTestService.class));
+    }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, String[] permissions,
+            int[] grantResults) {
+        switch (requestCode) {
+            case REQUEST_PERMISSION_READ_STATE: {
+                if (grantResults.length > 0
+                        && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+                    mIsReadPhoneStateGranted = true;
+                } else {
+                    // permission denied
+                    Toast.makeText(this, "read_phone_state denied.", Toast.LENGTH_SHORT).show();
+                }
+            }
+
+        }
+
+        if (mIsReadPhoneStateGranted) {
+            mPhoneNumber.setText(getPhoneNumber(), TextView.BufferType.NORMAL);
+        }
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        switch (requestCode) {
+            case (REQUEST_GET_SMS_SUB_ID) : {
+                int resultSubId;
+                if (resultCode == RESULT_OK) {
+                    resultSubId = data == null ? -1 : data.getIntExtra(RESULT_SUB_ID,
+                            SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+                    Toast.makeText(this, "User picked sub id = " + resultSubId,
+                            Toast.LENGTH_LONG).show();
+                } else {
+                    Toast.makeText(this, "User cancelled dialog.",
+                            Toast.LENGTH_SHORT).show();
+                }
+                break;
+            }
+        }
+    }
+
+
+    private void sendOutgoingSms(View view) {
+        String phoneNumber = mPhoneNumber.getText().toString();
+        if (TextUtils.isEmpty(phoneNumber)) {
+            Toast.makeText(this, "Couldn't get phone number from view! Ignoring request...",
+                    Toast.LENGTH_SHORT).show();
+            return;
+        }
+        if (mIsReadPhoneStateGranted) {
+            SmsManager m = SmsManager.getDefault();
+            m.sendTextMessage(phoneNumber, null, "Test",
+                    PendingIntent.getBroadcast(this, sMessageId, getSendStatusIntent(), 0),
+                    null);
+            sMessageId++;
+        }
+    }
+
+    private void sendOutgoingSmsService(View view) {
+        String phoneNumber = mPhoneNumber.getText().toString();
+        if (TextUtils.isEmpty(phoneNumber)) {
+            Toast.makeText(this, "Couldn't get phone number from view! Ignoring request...",
+                    Toast.LENGTH_SHORT).show();
+            return;
+        }
+        if (mIsReadPhoneStateGranted) {
+            Intent sendSmsIntent = new Intent(SmsManagerTestService.SEND_SMS);
+            sendSmsIntent.putExtra(SmsManagerTestService.EXTRA_SEND_TEXT, "Text");
+            sendSmsIntent.putExtra(SmsManagerTestService.EXTRA_SEND_NUMBER, phoneNumber);
+            sendSmsIntent.putExtra(SmsManagerTestService.EXTRA_SEND_INTENT,
+                    PendingIntent.getBroadcast(this, sMessageId, getSendStatusIntent(), 0));
+            sendSmsIntent.setComponent(new ComponentName(this, SmsManagerTestService.class));
+            startService(sendSmsIntent);
+            sMessageId++;
+        }
+    }
+    private void getSubIdForResult(View view) {
+        // ask the user for a default SMS SIM.
+        Intent intent = new Intent();
+        intent.setComponent(SETTINGS_SUB_PICK_ACTIVITY);
+        intent.putExtra(DIALOG_TYPE_KEY, SMS_PICK);
+        try {
+            startActivity(intent, null);
+        } catch (ActivityNotFoundException anfe) {
+            // If Settings is not installed, only log the error as we do not want to break
+            // legacy applications.
+            Toast.makeText(this, "Unable to launch Settings application.",
+                    Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private Intent getSendStatusIntent() {
+        // Encode requestId in intent data
+        return new Intent(SendStatusReceiver.MESSAGE_SENT_ACTION, null, this,
+                SendStatusReceiver.class);
+    }
+
+    private String getPhoneNumber() {
+        String result = "6505551212";
+        int defaultSmsSub = SubscriptionManager.getDefaultSmsSubscriptionId();
+        if (mIsReadPhoneStateGranted) {
+            TelephonyManager tm = getSystemService(TelephonyManager.class);
+            if (tm != null) {
+                tm = tm.createForSubscriptionId(defaultSmsSub);
+                String line1Number = tm.getLine1Number();
+                if (!TextUtils.isEmpty(line1Number)) {
+                    return line1Number;
+                }
+            }
+        } else {
+            Toast.makeText(this, "Couldn't resolve line 1 due to permissions error.",
+                    Toast.LENGTH_LONG).show();
+        }
+        return result;
+    }
+}
diff --git a/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SmsManagerTestService.java b/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SmsManagerTestService.java
new file mode 100644
index 0000000..fcf4a67
--- /dev/null
+++ b/testapps/SmsManagerTestApp/src/com/android/phone/testapps/smsmanagertestapp/SmsManagerTestService.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2019 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.phone.testapps.smsmanagertestapp;
+
+import android.app.IntentService;
+import android.app.PendingIntent;
+import android.content.Intent;
+import android.os.AsyncTask;
+import android.telephony.SmsManager;
+import android.util.Log;
+
+/**
+ * IntentService whose purpose is to handle outgoing SMS intents for this application and schedule
+ * them onto a AsyncTask to sleep for 5 seconds. This allows us to simulate SMS messages being sent
+ * from background services.
+ */
+public class SmsManagerTestService extends IntentService {
+
+    private static final String LOG_TAG = "smsmanagertestservice";
+
+    private static class SendSmsJob extends AsyncTask<Intent, Void, Void> {
+
+        @Override
+        protected Void doInBackground(Intent... intents) {
+            Intent intent = intents[0];
+            try {
+                Thread.sleep(5000);
+            } catch (InterruptedException e) {
+                // testing
+            }
+
+            String text = intent.getStringExtra(EXTRA_SEND_TEXT);
+            String phoneNumber = intent.getStringExtra(EXTRA_SEND_NUMBER);
+            PendingIntent sendIntent = intent.getParcelableExtra(EXTRA_SEND_INTENT);
+            sendSms(phoneNumber, text, sendIntent);
+            return null;
+        }
+
+        @Override
+        protected void onPostExecute(Void aVoid) {
+            Log.i(LOG_TAG, "SMS sent");
+        }
+
+    }
+
+    public static final String SEND_SMS = "com.android.phone.testapps.smsmanagertestapp.send_sms";
+    public static final String EXTRA_SEND_TEXT = "text";
+    public static final String EXTRA_SEND_NUMBER = "number";
+    public static final String EXTRA_SEND_INTENT = "sendIntent";
+
+    public SmsManagerTestService() {
+        super("SmsManagerTestService");
+    }
+
+
+    @Override
+    protected void onHandleIntent(Intent intent) {
+        switch (intent.getAction()) {
+            case SEND_SMS : {
+                new SendSmsJob().execute(intent);
+                break;
+            }
+        }
+    }
+
+    private static void sendSms(String phoneNumber, String text, PendingIntent sendIntent) {
+        SmsManager m = SmsManager.getDefault();
+        m.sendTextMessage(phoneNumber, null, text, sendIntent, null);
+    }
+}
diff --git a/tests/src/com/android/phone/CarrierXmlParserTest.java b/tests/src/com/android/phone/CarrierXmlParserTest.java
new file mode 100644
index 0000000..92a8ba7
--- /dev/null
+++ b/tests/src/com/android/phone/CarrierXmlParserTest.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2019 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.phone;
+
+import static org.junit.Assert.assertEquals;
+
+import android.content.Context;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Collections;
+import java.util.Vector;
+
+@RunWith(AndroidJUnit4.class)
+public class CarrierXmlParserTest {
+    private CarrierXmlParser mCarrierXmlParser;
+    private Context mContext;
+
+    @Before
+    public void setUp() throws Exception {
+        mContext = InstrumentationRegistry.getTargetContext();
+    }
+
+    @Test
+    public void verifyParserFormat_shouldSameAsXml() {
+        String expected =
+                "((\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*"
+                        + "([^*#]*)(\\*([^*#]*))?)?)?)?)?)?)?#)";
+
+        mCarrierXmlParser = new CarrierXmlParser(mContext, -1);
+
+        assertEquals(expected, mCarrierXmlParser.sParserFormat);
+    }
+
+    @Test
+    public void verifyUssdParser_shouldMatchText() {
+        String parserFormat =
+                "((\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*"
+                        + "([^*#]*)(\\*([^*#]*))?)?)?)?)?)?)?#)";
+        String text = "120*1*7*123456789*20*1*0*0#";
+        String[] expectedContent = {"120*1*7*123456789*20*1*0*0#",
+                "120*1*7*123456789*20*1*0*0#",
+                "120",
+                "*1*7*123456789*20*1*0*0",
+                "1",
+                "*7*123456789*20*1*0*0",
+                "7",
+                "*123456789*20*1*0*0",
+                "123456789",
+                "*20*1*0*0",
+                "20",
+                "*1*0*0",
+                "1",
+                "*0*0",
+                "0",
+                "*0",
+                "0"};
+        Vector<String> expected = new Vector<>();
+        Collections.addAll(expected, expectedContent);
+
+        CarrierXmlParser.UssdParser ussdParser = new CarrierXmlParser.UssdParser(parserFormat);
+        ussdParser.newFromResponseString(text);
+
+        assertEquals(expected, ussdParser.getResult());
+    }
+}