Merge "Require READ_PHONE_STATE for getNetworkType"
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 136db0c..239371a 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/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 498625d..0042ff5 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -54,6 +54,7 @@
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.RIL;
+import com.android.internal.telephony.SubscriptionController;
import com.android.internal.telephony.imsphone.ImsExternalCallTracker;
import com.android.internal.telephony.imsphone.ImsPhone;
import com.android.internal.telephony.imsphone.ImsPhoneConnection;
@@ -582,8 +583,11 @@
// Notify Telecom of the new Connection type.
// TODO: Switch out the underlying connection instead of creating a new
// one and causing UI Jank.
+ boolean noActiveSimCard = SubscriptionController.getInstance()
+ .getActiveSubInfoCount(phone.getContext().getOpPackageName()) == 0;
+ // If there's no active sim card and the device is in emergency mode, use E account.
addExistingConnection(PhoneUtils.makePstnPhoneAccountHandleWithPrefix(
- phone, "", isEmergencyNumber), repConnection);
+ phone, "", isEmergencyNumber && noActiveSimCard), repConnection);
// Remove the old connection from Telecom after.
originalConnection.setDisconnected(
DisconnectCauseUtil.toTelecomDisconnectCause(