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

Commit 828a1100 authored by Sandeep Gutta's avatar Sandeep Gutta Committed by Jack Yu
Browse files

Hold on data-stall recovery logic during voice call on other sub.

- Data stall may get falsely triggered if there is a voice call on
  other sub and data is dormant on current data subscription.
- As part of recovery, telephony may bring-down the PDP or even reset
  the modem.
- Do not proceed the data-stall logic if there is an active voice
  call on any of the subscriptions.

Merged-In: I135f012c549bf8a2a32d14de05b2d49b62eb4d1b
Change-Id: I135f012c549bf8a2a32d14de05b2d49b62eb4d1b
Bug: 34760370
Test: Manual
parent 76e7c597
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ import com.android.internal.telephony.GsmCdmaPhone;
import com.android.internal.telephony.ITelephony;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.ServiceStateTracker;
import com.android.internal.telephony.TelephonyIntents;
@@ -4743,7 +4744,7 @@ public class DcTracker extends Handler {
            mSentSinceLastRecv = 0;
            putRecoveryAction(RecoveryAction.GET_DATA_CALL_LIST);
        } else if (sent > 0 && received == 0) {
            if (mPhone.getState() == PhoneConstants.State.IDLE) {
            if (isPhoneStateIdle()) {
                mSentSinceLastRecv += sent;
            } else {
                mSentSinceLastRecv = 0;
@@ -4761,6 +4762,17 @@ public class DcTracker extends Handler {
        }
    }

    private boolean isPhoneStateIdle() {
        for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
            Phone phone = PhoneFactory.getPhone(i);
            if (phone != null && phone.getState() != PhoneConstants.State.IDLE) {
                log("isPhoneStateIdle false: Voice call active on phone " + i);
                return false;
            }
        }
        return true;
    }

    private void onDataStallAlarm(int tag) {
        if (mDataStallAlarmTag != tag) {
            if (DBG) {