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

Commit 72742deb authored by Hyunho Shin's avatar Hyunho Shin Committed by Automerger Merge Worker
Browse files

Merge "The framework sends a hang up request to the modem before terminating...

Merge "The framework sends a hang up request to the modem before terminating the connection" into tm-dev am: b654919a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/17409746



Change-Id: I1b1a663c4546908fa268827de9aad4c738027883
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5f852753 b654919a
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -1193,7 +1193,19 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    @VisibleForTesting
    public void hangupAllOrphanedConnections(int disconnectCause) {
        Log.w(LOG_TAG, "hangupAllOngoingConnections called for cause " + disconnectCause);

        // Send a call terminate request to all available connections.
        // In the ImsPhoneCallTrackerTest, when the hangup() of the connection call,
        // onCallTerminated() is called immediately and the connection is removed.
        // As a result, an IndexOutOfBoundsException is thrown.
        // This is why it counts backwards.
        int size = getConnections().size();
        for (int index = size - 1; index > -1; index--) {
            try {
                getConnections().get(index).hangup();
            } catch (CallStateException e) {
                loge("Failed to disconnet call...");
            }
        }
        // Move connections to disconnected and notify the reason why.
        for (ImsPhoneConnection connection : mConnections) {
            connection.update(connection.getImsCall(), ImsPhoneCall.State.DISCONNECTED);