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

Commit b66f329a authored by Seth Shelnutt's avatar Seth Shelnutt Committed by Ricardo Cerqueira
Browse files

CallTracker: Add back-off and retry toggle to getCurrentCalls

Add a system property to handle cases where the modem
reacts slowly and does not update CURRENT_CALLS to include calls which
are dialing. A delay is introduced to avoid spamming the modem and then
GetCurrentCalls is called again in order to avoid the calltracker from
marking the call as ended when it is still active.

Tested and LS970 and E970 (Sprint and ATT LG Optimus G).

Change-Id: I7d3aac00b811bceb2909adf239492962a737de4a

Conflicts:
	src/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
	src/java/com/android/internal/telephony/gsm/GsmCallTracker.java
parent 9d23cc8d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ public final class CdmaCallTracker extends CallTracker {
    CdmaConnection mPendingMO;
    boolean mHangupPendingMO;
    boolean mPendingCallInEcm=false;
    //Used to re-request the list of current calls
    boolean slowModem = (SystemProperties.getInt("ro.telephony.slowModem",0) != 0);

    boolean mIsInEmergencyCall = false;
    CDMAPhone mPhone;

@@ -497,6 +500,13 @@ public final class CdmaCallTracker extends CallTracker {
        boolean needsPollDelay = false;
        boolean unknownConnectionAppeared = false;

        if (slowModem) {
            if (polledCalls.size() == 0 && !hangupPendingMO && pendingMO != null) {
                lastRelevantPoll = obtainMessage(EVENT_POLL_CALLS_RESULT);
                cm.getCurrentCalls(lastRelevantPoll);
                return;
            }
        }
        for (int i = 0, curDC = 0, dcSize = polledCalls.size()
                ; i < mConnections.length; i++) {
            CdmaConnection conn = mConnections[i];
@@ -827,6 +837,7 @@ public final class CdmaCallTracker extends CallTracker {
                    "does not belong to CdmaCallTracker " + this);
        }

        hangupPendingMO = true;
        call.onHangupLocal();
        mPhone.notifyPreciseCallStateChanged();
    }
+11 −0
Original line number Diff line number Diff line
@@ -81,6 +81,8 @@ public final class GsmCallTracker extends CallTracker {
    GsmConnection mPendingMO;
    boolean mHangupPendingMO;

    //Used to re-request the list of current calls
    boolean slowModem = (SystemProperties.getInt("ro.telephony.slowModem",0) != 0);
    GSMPhone mPhone;

    boolean mDesiredMute = false;    // false = mute off
@@ -451,6 +453,14 @@ public final class GsmCallTracker extends CallTracker {
        boolean needsPollDelay = false;
        boolean unknownConnectionAppeared = false;

        if (slowModem) {
            if (polledCalls.size() == 0 && !hangupPendingMO && pendingMO != null) {
                lastRelevantPoll = obtainMessage(EVENT_POLL_CALLS_RESULT);
                cm.getCurrentCalls(lastRelevantPoll);
                return;
            }
        }

        for (int i = 0, curDC = 0, dcSize = polledCalls.size()
                ; i < mConnections.length; i++) {
            GsmConnection conn = mConnections[i];
@@ -778,6 +788,7 @@ public final class GsmCallTracker extends CallTracker {
                    "does not belong to GsmCallTracker " + this);
        }

        hangupPendingMO = true;
        call.onHangupLocal();
        mPhone.notifyPreciseCallStateChanged();
    }