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

Commit 1f93ea2e authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Modify call cleanup when emergency call dialed.

am: 6e829164

Change-Id: I193f1a57c4ccdac9be2d1ea2c6f4522615034476
parents 42e8f6ed 6e829164
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -1423,11 +1423,8 @@ public class CallsManager extends Call.ListenerBase
                notifyCreateConnectionFailed(call.getTargetPhoneAccount(), call);
            } else {
                if (call.isEmergencyCall()) {
                    // Disconnect calls from other ConnectionServices other than the one the
                    // emergency call targets.
                    // Except, do not disconnect calls from the Connection Manager's
                    // ConnectionService.
                    disconnectCallsHaveDifferentConnectionService(call);
                    // Drop any ongoing self-managed calls to make way for an emergency call.
                    disconnectSelfManagedCalls("place emerg call" /* reason */);
                }

                call.startCreateConnection(mPhoneAccountRegistrar);
@@ -3248,16 +3245,6 @@ public class CallsManager extends Call.ListenerBase
        mCallAudioManager.switchBaseline();
    }

    private void disconnectCallsHaveDifferentConnectionService(Call exceptCall) {
        String csPackage = exceptCall.getConnectionService() != null ?
                exceptCall.getConnectionService().getComponentName().toShortString() : "null";
        mCalls.stream().filter(c ->
                c.getConnectionService() != exceptCall.getConnectionService()
                        && c.getConnectionManagerPhoneAccount()
                        != exceptCall.getConnectionManagerPhoneAccount())
                .forEach(c -> c.disconnect("CS not " + csPackage));
    }

    /**
     * Dumps the state of the {@link CallsManager}.
     *