summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-07-15 17:52:44 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-07-15 17:52:44 +0000
commit27f179c338705abdc538d98db6879b2a25ff2d8e (patch)
treeac27662512de3421b7fd6e4941f32e91a1c190e6
parentd0d8255d4843e5a10afd5467663b8721eed7d1ae (diff)
parent95cf35edc024a4822f74696008882ec36c5e1c9c (diff)
downloadplatform_packages_services_Telephony-android10-s2-release.tar.gz
platform_packages_services_Telephony-android10-s2-release.tar.bz2
platform_packages_services_Telephony-android10-s2-release.zip
Merge cherrypicks of [8655472, 8655254, 8655915, 8655916, 8655554, 8655935, 8655917, 8655800, 8655789, 8655473, 8655918, 8655474, 8655408, 8655351] into qt-releaseandroid-vts-10.0_r1android-cts-10.0_r2android-cts-10.0_r1android-10.0.0_r6android-10.0.0_r5android-10.0.0_r4android-10.0.0_r3android-10.0.0_r2android-10.0.0_r1android10-s2-releaseandroid10-s1-release
Change-Id: I45448ce3163f897e815d61fb43ce62367f955129
-rw-r--r--src/com/android/services/telephony/TelephonyConnectionService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 80ba5b1c2..6637e19a0 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -56,6 +56,7 @@ import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.PhoneSwitcher;
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;
@@ -637,8 +638,11 @@ public class TelephonyConnectionService extends ConnectionService {
// 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.
connectionToEvaluate.setDisconnected(
DisconnectCauseUtil.toTelecomDisconnectCause(