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

Commit 9dea9c86 authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Merge "Revert "Speculative DISCONNECTING fix for ImsPhoneCallTracker"" am: 0a72d2be

am: ab44afee

Change-Id: I4fdec36ec6ff761afff98b8396cb649c79d9b177
parents 42e2a286 ab44afee
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -217,14 +217,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:
@@ -1359,8 +1354,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) {
@@ -1387,12 +1380,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) {
@@ -2705,20 +2692,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
@@ -381,18 +380,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) {
@@ -411,7 +401,6 @@ public class ImsPhoneConnection extends Connection implements

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

            mOwner.mPhone.notifyDisconnect(this);