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

Commit 6afefa40 authored by Bryce Lee's avatar Bryce Lee
Browse files

Account for scheme when checking if we can handle a call.

Previously we were only accounting for if there was a call capable account.
This leaves the possibility that we have a call capable account for only
one scheme, but are asked to handle another.

Bug: 25202039
Change-Id: Iaf7173886faf8024f6a101e2e912cd1f77e18390
parent de0ac37d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -719,11 +719,16 @@ public class CallsManager extends Call.ListenerBase implements VideoProviderProx
            call.setTargetPhoneAccount(null);
        }

        final boolean requireCallCapableAccountByHandle = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_requireCallCapableAccountForHandle);

        if (call.getTargetPhoneAccount() != null || call.isEmergencyCall()) {
            // If the account has been set, proceed to place the outgoing call.
            // Otherwise the connection will be initiated when the account is set by the user.
            call.startCreateConnection(mPhoneAccountRegistrar);
        } else if (mPhoneAccountRegistrar.getCallCapablePhoneAccounts(null, false).isEmpty()) {
        } else if (mPhoneAccountRegistrar.getCallCapablePhoneAccounts(
                requireCallCapableAccountByHandle ? call.getHandle().getScheme() : null, false)
                .isEmpty()) {
            // If there are no call capable accounts, disconnect the call.
            markCallAsDisconnected(call, new DisconnectCause(DisconnectCause.CANCELED,
                    "No registered PhoneAccounts"));