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

Commit 0a72d2be authored by Brad Ebinger's avatar Brad Ebinger Committed by Gerrit Code Review
Browse files

Merge "Revert "Speculative DISCONNECTING fix for ImsPhoneCallTracker""

parents e3d52a29 4f47ce14
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -216,14 +216,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    private static final int EVENT_DATA_ENABLED_CHANGED = 23;
    private static final int EVENT_GET_IMS_SERVICE = 24;
    private static final int EVENT_CHECK_FOR_WIFI_HANDOVER = 25;
    private static final int EVENT_CLEAR_DISCONNECTING_CONN = 26;

    private static final int TIMEOUT_HANGUP_PENDINGMO = 500;

    // The number of milliseconds the CallTracker will wait before manually disconnecting the
    // connection due to the modem not responding.
    private static final int TIMEOUT_CLEAR_DISCONNECTING_CONN = 5000;

    // Initial condition for ims connection retry.
    private static final int IMS_RETRY_STARTING_TIMEOUT_MS = 500; // ms
    // Ceiling bitshift amount for service query timeout, calculated as:
@@ -1337,8 +1332,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        }

        ImsCall imsCall = call.getImsCall();
        // Get first connection that is associated with imsCall.
        ImsPhoneConnection imsPhoneConnection = call.getFirstConnection();
        boolean rejectCall = false;

        if (call == mRingingCall) {
@@ -1365,12 +1358,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        }

        call.onHangupLocal();
        // Schedule a cleaning event for the ImsPhoneCall. If the modem has not responded in
        // TIMEOUT_CLEAR_DISCONNECTING_CONN milliseconds, manually disconnect the connection.
        if (!hasMessages(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection)) {
            sendMessageDelayed(obtainMessage(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection),
                    TIMEOUT_CLEAR_DISCONNECTING_CONN);
        }

        try {
            if (imsCall != null) {
@@ -2682,20 +2669,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    }
                }
                break;
            case EVENT_CLEAR_DISCONNECTING_CONN:
                if (msg.obj instanceof ImsPhoneConnection) {
                    ImsPhoneConnection imsPhoneConnection = (ImsPhoneConnection) msg.obj;
                    removeMessages(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection);

                    // We have timed out waiting for the modem while disconnecting this connection.
                    // Manually disconnect to avoid tracking an invalid call.
                    if (imsPhoneConnection != null && imsPhoneConnection.isDisconnecting()) {
                        Rlog.e(LOG_TAG, "No response from modem. Manually disconnecting: " +
                                imsPhoneConnection);
                        imsPhoneConnection.onDisconnect();
                    }
                }
                break;
        }
    }

+0 −11
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ public class ImsPhoneConnection extends Connection implements
    private Bundle mExtras = new Bundle();

    private boolean mDisconnected;
    private boolean mDisconnecting = false;

    /*
    int mIndex;          // index in ImsPhoneCallTracker.connections[], -1 if unassigned
@@ -391,18 +390,9 @@ public class ImsPhoneConnection extends Connection implements
     */
    void
    onHangupLocal() {
        mDisconnecting = true;
        mCause = DisconnectCause.LOCAL;
    }

    /**
     * Return whether or not this connection is DISCONNECTING and waiting for a signal from the
     * modem to disconnect.
     */
    boolean isDisconnecting() {
        return mDisconnecting;
    }

    /** Called when the connection has been disconnected */
    @Override
    public boolean onDisconnect(int cause) {
@@ -421,7 +411,6 @@ public class ImsPhoneConnection extends Connection implements

            mDisconnectTime = System.currentTimeMillis();
            mDuration = SystemClock.elapsedRealtime() - mConnectTimeReal;
            mDisconnecting = false;
            mDisconnected = true;

            mOwner.mPhone.notifyDisconnect(this);