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

Commit 1a373830 authored by Roshan Pius's avatar Roshan Pius
Browse files

Fetch phoneaccount from child for live conf calls.

Some conference calls don't seem to have a targetPhoneAccount set on
them. So, fetch the targetPhoneAccount from the child calls if it is not
set on the conference call for any new calls placed.

BUG: 22954116
Change-Id: Id97cf70954593b863bebce0903717cc806b0e3fe
parent ba9ac49f
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -590,9 +590,19 @@ public class CallsManager extends Call.ListenerBase implements VideoProviderProx

        Log.v(this, "startOutgoingCall found accounts = " + accounts);

        if (mForegroundCall != null && mForegroundCall.getTargetPhoneAccount() != null) {
        if (mForegroundCall != null) {
            Call ongoingCall = mForegroundCall;
            // If there is an ongoing call, use the same phone account to place this new call.
            phoneAccountHandle = mForegroundCall.getTargetPhoneAccount();
            // If the ongoing call is a conference call, we fetch the phone account from the
            // child calls because we don't have targetPhoneAccount set on Conference calls.
            // TODO: Set targetPhoneAccount for all conference calls (b/23035408).
            if (ongoingCall.getTargetPhoneAccount() == null &&
                    !ongoingCall.getChildCalls().isEmpty()) {
                ongoingCall = ongoingCall.getChildCalls().get(0);
            }
            if (ongoingCall.getTargetPhoneAccount() != null) {
                phoneAccountHandle = ongoingCall.getTargetPhoneAccount();
            }
        }

        // Only dial with the requested phoneAccount if it is still valid. Otherwise treat this call