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

Commit e6b1c5b4 authored by Hun Suk Choi's avatar Hun Suk Choi Committed by Jake Choi
Browse files

Fix abnormal state of GsmCdmaCall after hangup

TelephonyConnection can try to hangup a call
when it was disconnected by the remote party already
but the DISCONNECTED message is not received.
In that case, GsmCdmaCall remains in DISCONNECTING state.

Test: aTest FrameworksTelephonyTests
Bug: 168047279
Change-Id: Ia88c958662ca84fb800729fc19cbffb145f44456
parent 3da75413
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.internal.telephony;

import android.compat.annotation.UnsupportedAppUsage;

import com.android.internal.annotations.VisibleForTesting;

/**
 * {@hide}
 */
@@ -146,7 +148,11 @@ public class GsmCdmaCall extends Call {
     * Note that at this point, the hangup request has been dispatched to the radio
     * but no response has yet been received so update() has not yet been called
     */
    void onHangupLocal() {
    @VisibleForTesting
    public void onHangupLocal() {
        if (!mState.isAlive()) {
            return;
        }
        for (Connection conn : getConnections()) {
            ((GsmCdmaConnection) conn).onHangupLocal();
        }
+2 −0
Original line number Diff line number Diff line
@@ -121,6 +121,8 @@ public class GsmCdmaCallTest extends TelephonyTest {
        doReturn(Call.State.DISCONNECTED).when(mConnection2).getState();
        mCallUnderTest.connectionDisconnected(null);
        assertEquals(Call.State.DISCONNECTED, mCallUnderTest.getState());
        mCallUnderTest.onHangupLocal();
        assertEquals(Call.State.DISCONNECTED, mCallUnderTest.getState());
    }

}
 No newline at end of file