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

Commit e8a4b649 authored by Jiju Kinattingal's avatar Jiju Kinattingal Committed by Linux Build Service Account
Browse files

System Property to Ignore Out of State Indications in DataStateTracker

We ignore the out of service bursts, if there service is indeed lost, the
data call disconnect indication will be sent by the modem, else we wait
optimistically for a quick reattach.
This change is guarded by a system property

Change-Id: I36f709b4cfc04a68542ec64c905f0850d2db231d
parent 82ee99d4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -74,6 +74,11 @@ import java.util.concurrent.atomic.AtomicReference;
public abstract class PhoneBase extends Handler implements Phone {
    private static final String LOG_TAG = "PhoneBase";

    /**
     * Indicates whether Out Of Service is considered as data call disconnect.
     */
    protected static final String PROPERTY_OOS_IS_DISCONNECT = "persist.telephony.oosisdc";

    // Key used to read and write the saved network selection numeric value
    public static final String NETWORK_SELECTION_KEY = "network_selection_key";
    // Key used to read and write the saved network selection operator name
@@ -181,6 +186,10 @@ public abstract class PhoneBase extends Handler implements Phone {
        return mActionAttached;
    }

    // Flag that indicates that Out Of Service is considered as data call disconnect
    protected boolean mOosIsDisconnect = SystemProperties.getBoolean(
            PROPERTY_OOS_IS_DISCONNECT, true);

    /**
     * Set a system property, unless we're in unit test mode
     */
@@ -313,6 +322,7 @@ public abstract class PhoneBase extends Handler implements Phone {
        mSmsUsageMonitor = new SmsUsageMonitor(context);
        mUiccController = UiccController.getInstance();
        mUiccController.registerForIccChanged(this, EVENT_ICC_CHANGED, null);
        Rlog.d(LOG_TAG, "mOosIsDisconnect=" + mOosIsDisconnect);
    }

    @Override
+5 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.os.Message;
import android.preference.PreferenceManager;
import android.provider.Telephony;
import android.telephony.Rlog;
import android.telephony.ServiceState;

import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.OperatorInfo;
@@ -99,6 +100,10 @@ public class CDMALTEPhone extends CDMAPhone {
            // removeReferences() have already been called

            ret = PhoneConstants.DataState.DISCONNECTED;
        } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE &&
                            mOosIsDisconnect) {
            ret = PhoneConstants.DataState.DISCONNECTED;
            Rlog.d(LOG_LTE_TAG, "getDataConnectionState: Data is Out of Service. ret = " + ret);
        } else if (mDcTracker.isApnTypeEnabled(apnType) == false) {
            ret = PhoneConstants.DataState.DISCONNECTED;
        } else {
+3 −1
Original line number Diff line number Diff line
@@ -657,10 +657,12 @@ public class CDMAPhone extends PhoneBase {
             // already been called

             ret = PhoneConstants.DataState.DISCONNECTED;
        } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) {
        } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE
                && mOosIsDisconnect) {
            // If we're out of service, open TCP sockets may still work
            // but no data will flow
            ret = PhoneConstants.DataState.DISCONNECTED;
            Rlog.d(LOG_TAG, "getDataConnectionState: Data is Out of Service. ret = " + ret);
        } else if (mDcTracker.isApnTypeEnabled(apnType) == false ||
                mDcTracker.isApnTypeActive(apnType) == false) {
            ret = PhoneConstants.DataState.DISCONNECTED;
+3 −1
Original line number Diff line number Diff line
@@ -299,10 +299,12 @@ public class GSMPhone extends PhoneBase {

            ret = PhoneConstants.DataState.DISCONNECTED;
        } else if (mSST.getCurrentDataConnectionState()
                != ServiceState.STATE_IN_SERVICE) {
                != ServiceState.STATE_IN_SERVICE
                && mOosIsDisconnect) {
            // If we're out of service, open TCP sockets may still work
            // but no data will flow
            ret = PhoneConstants.DataState.DISCONNECTED;
            Rlog.d(LOG_TAG, "getDataConnectionState: Data is Out of Service. ret = " + ret);
        } else if (mDcTracker.isApnTypeEnabled(apnType) == false ||
                mDcTracker.isApnTypeActive(apnType) == false) {
            //TODO: isApnTypeActive() is just checking whether ApnContext holds