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

Commit 31c56fde authored by Yorke Lee's avatar Yorke Lee Committed by Android (Google) Code Review
Browse files

Merge "Disconnect SELECT_PHONE_ACCOUNT call to make room for outgoing call" into mnc-dev

parents 20f7edfc 867907d6
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -1393,15 +1393,19 @@ public class CallsManager extends Call.ListenerBase {
            }

            if (hasMaximumOutgoingCalls()) {
                // Disconnect the current outgoing call if it's not an emergency call. If the user
                // tries to make two outgoing calls to different emergency call numbers, we will try
                // to connect the first outgoing call.
                if (isEmergency) {
                Call outgoingCall = getFirstCallWithState(OUTGOING_CALL_STATES);
                    if (!outgoingCall.isEmergencyCall()) {
                if (isEmergency && !outgoingCall.isEmergencyCall()) {
                    // Disconnect the current outgoing call if it's not an emergency call. If the
                    // user tries to make two outgoing calls to different emergency call numbers,
                    // we will try to connect the first outgoing call.
                    outgoingCall.disconnect();
                    return true;
                }
                if (outgoingCall.getState() == CallState.SELECT_PHONE_ACCOUNT) {
                    // If there is an orphaned call in the {@link CallState#SELECT_PHONE_ACCOUNT}
                    // state, just disconnect it since the user has explicitly started a new call.
                    outgoingCall.disconnect();
                    return true;
                }
                return false;
            }
+3 −2
Original line number Diff line number Diff line
@@ -271,8 +271,9 @@ public final class InCallController extends CallsManagerListenerBase {
        Iterator<Map.Entry<ComponentName, InCallServiceConnection>> iterator =
            mServiceConnections.entrySet().iterator();
        while (iterator.hasNext()) {
            Log.i(this, "Unbinding from InCallService %s");
            mContext.unbindService(iterator.next().getValue());
            final Map.Entry<ComponentName, InCallServiceConnection> entry = iterator.next();
            Log.i(this, "Unbinding from InCallService %s", entry.getKey());
            mContext.unbindService(entry.getValue());
            iterator.remove();
        }
        mInCallServices.clear();