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

Commit 06dcba08 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
parent 3dba6580
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -75,6 +75,10 @@ public final class CdmaCallTracker extends CallTracker {

    CdmaConnection pendingMO;
    boolean hangupPendingMO;

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

    boolean pendingCallInEcm=false;
    boolean mIsInEmergencyCall = false;
    CDMAPhone phone;
@@ -496,6 +500,13 @@ public final class CdmaCallTracker extends CallTracker {
        boolean needsPollDelay = false;
        boolean unknownConnectionAppeared = false;

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

        hangupPendingMO = true;
        call.onHangupLocal();
        phone.notifyPreciseCallStateChanged();
    }
+12 −0
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ public final class GsmCallTracker extends CallTracker {
    GsmConnection pendingMO;
    boolean hangupPendingMO;

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

    GSMPhone phone;

    boolean desiredMute = false;    // false = mute off
@@ -432,6 +435,14 @@ public final class GsmCallTracker extends CallTracker {
        boolean needsPollDelay = false;
        boolean unknownConnectionAppeared = false;

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

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

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