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

Commit 8513ed3e authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Modify call cleanup when emergency call dialed.

am: fe791132

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


                call.startCreateConnection(mPhoneAccountRegistrar);
                call.startCreateConnection(mPhoneAccountRegistrar);
@@ -3274,16 +3271,6 @@ public class CallsManager extends Call.ListenerBase
        mCallAudioManager.switchBaseline();
        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}.
     * Dumps the state of the {@link CallsManager}.
     *
     *