Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea3b162a authored by twyen's avatar twyen Committed by Copybara-Service
Browse files

Don't show SIM selection and swap SIM for emergency calls.

TEST=TAP
Bug: 73012833,73718978
Test: TAP
PiperOrigin-RevId: 194110263
Change-Id: I54dbbaada89e4974030e0b3a397040d4d686bcae
parent 15887c74
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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) {
+2 −1
Original line number Diff line number Diff line
@@ -485,7 +485,8 @@ public class CallButtonPresenter

    otherAccount = TelecomUtil.getOtherAccount(getContext(), call.getAccountHandle());
    boolean showSwapSim =
        otherAccount != null
        !call.isEmergencyCall()
            && otherAccount != null
            && !call.isVoiceMailNumber()
            && DialerCall.State.isDialing(call.getState())
            // Most devices cannot make calls on 2 SIMs at the same time.