diff options
author | twyen <twyen@google.com> | 2018-04-24 10:45:08 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-24 12:14:14 -0700 |
commit | ea3b162a8d99fb08654c1b8ca69f47ca7a733649 (patch) | |
tree | e701213640c084ab4537ba981ae1ed01ae09b2e3 /java/com/android/dialer/precall/impl/CallingAccountSelector.java | |
parent | 15887c748bfa55a7c208ce845d30b82f824f90c2 (diff) |
Don't show SIM selection and swap SIM for emergency calls.
TEST=TAP
Bug: 73012833,73718978
Test: TAP
PiperOrigin-RevId: 194110263
Change-Id: I54dbbaada89e4974030e0b3a397040d4d686bcae
Diffstat (limited to 'java/com/android/dialer/precall/impl/CallingAccountSelector.java')
-rw-r--r-- | java/com/android/dialer/precall/impl/CallingAccountSelector.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index 56b392b19..16e7641ba 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java @@ -25,6 +25,7 @@ import android.support.annotation.VisibleForTesting; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; +import android.telephony.PhoneNumberUtils; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener; import com.android.dialer.callintent.CallIntentBuilder; @@ -65,6 +66,10 @@ public class CallingAccountSelector implements PreCallAction { if (builder.getPhoneAccountHandle() != null) { return false; } + if (PhoneNumberUtils.isEmergencyNumber(builder.getUri().getSchemeSpecificPart())) { + return false; + } + TelecomManager telecomManager = context.getSystemService(TelecomManager.class); List<PhoneAccountHandle> accounts = telecomManager.getCallCapablePhoneAccounts(); if (accounts.size() <= 1) { |