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

Commit cb104a61 authored by Shriram Ganesh's avatar Shriram Ganesh Committed by Etan Cohen
Browse files

Do not disconnect voice calls during phone object switch.

In cases like emergency call attempted in oos or IMS SRVCC
there is possibility that the phone object switch due to
RAT change can happen while a voice call is in progress.
To avoid call disconnect in such cases, do not hangup connections
while disposing CallTracker objects.

Change-Id: I890d6bcea958288eab8f557073f871820ddd3b52

Conflicts:
	src/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
	src/java/com/android/internal/telephony/gsm/GsmCallTracker.java
parent 888c60a7
Loading
Loading
Loading
Loading
+2 −23
Original line number Diff line number Diff line
@@ -105,33 +105,12 @@ public final class CdmaCallTracker extends CallTracker {
    }

    public void dispose() {
        Rlog.d(LOG_TAG, "CdmaCallTracker dispose");
        mCi.unregisterForLineControlInfo(this);
        mCi.unregisterForCallStateChanged(this);
        mCi.unregisterForOn(this);
        mCi.unregisterForNotAvailable(this);
        mCi.unregisterForCallWaitingInfo(this);
        for(CdmaConnection c : mConnections) {
            try {
                if(c != null) {
                    hangup(c);
                    // Since by now we are unregistered, we won't notify
                    // PhoneApp that the call is gone. Do that here
                    Rlog.d(LOG_TAG, "dispose: call connnection onDisconnect, cause LOST_SIGNAL");
                    c.onDisconnect(DisconnectCause.LOST_SIGNAL);
                }
            } catch (CallStateException ex) {
                Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex);
            }
        }

        try {
            if(mPendingMO != null) {
                hangup(mPendingMO);
                Rlog.d(LOG_TAG, "dispose: call mPendingMO.onDsiconnect, cause LOST_SIGNAL");
                mPendingMO.onDisconnect(DisconnectCause.LOST_SIGNAL);
            }
        } catch (CallStateException ex) {
            Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex);
        }

        clearDisconnected();

+1 −23
Original line number Diff line number Diff line
@@ -108,34 +108,12 @@ public final class GsmCallTracker extends CallTracker {
    }

    public void dispose() {
        Rlog.d(LOG_TAG, "GsmCallTracker dispose");
        //Unregister for all events
        mCi.unregisterForCallStateChanged(this);
        mCi.unregisterForOn(this);
        mCi.unregisterForNotAvailable(this);

        for(GsmConnection c : mConnections) {
            try {
                if(c != null) {
                    hangup(c);
                    // Since by now we are unregistered, we won't notify
                    // PhoneApp that the call is gone. Do that here
                    Rlog.d(LOG_TAG, "dispose: call connnection onDisconnect, cause LOST_SIGNAL");
                    c.onDisconnect(DisconnectCause.LOST_SIGNAL);
                }
            } catch (CallStateException ex) {
                Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex);
            }
        }

        try {
            if(mPendingMO != null) {
                hangup(mPendingMO);
                Rlog.d(LOG_TAG, "dispose: call mPendingMO.onDsiconnect, cause LOST_SIGNAL");
                mPendingMO.onDisconnect(DisconnectCause.LOST_SIGNAL);
            }
        } catch (CallStateException ex) {
            Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex);
        }

        clearDisconnected();
    }