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

Commit a4370801 authored by Bryce Lee's avatar Bryce Lee Committed by android-build-merger
Browse files

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

am: 6afefa40

* commit '6afefa40':
  Account for scheme when checking if we can handle a call.
parents d4478300 6afefa40
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"));