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

Commit e2494119 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am ad4d9e5b: Allow CdmaDataConnectionTracker to handle...

am ad4d9e5b: Allow CdmaDataConnectionTracker to handle RIL_UNSOL_OTA_PROVISION_STATUS and when data roaming is enabled reset the retry manager.

Merge commit 'ad4d9e5b'

* commit 'ad4d9e5b':
  Allow CdmaDataConnectionTracker to handle RIL_UNSOL_OTA_PROVISION_STATUS
parents 53d54234 ad4d9e5b
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ public abstract class DataConnectionTracker extends Handler {
    protected static final int EVENT_PS_RESTRICT_ENABLED = 32;
    protected static final int EVENT_PS_RESTRICT_DISABLED = 33;
    public static final int EVENT_CLEAN_UP_CONNECTION = 34;
    protected static final int EVENT_CDMA_OTA_PROVISION = 35;

    //***** Constants

@@ -146,6 +147,9 @@ public abstract class DataConnectionTracker extends Handler {
    protected int mNoRecvPollCount = 0;
    protected boolean netStatPollEnabled = false;

    /** Manage the behavior of data retry after failure */
    protected final RetryManager mRetryMgr = new RetryManager();

    // wifi connection status will be updated by sticky intent
    protected boolean mIsWifiConnected = false;

@@ -202,10 +206,13 @@ public abstract class DataConnectionTracker extends Handler {
        if (getDataOnRoamingEnabled() != enabled) {
            Settings.Secure.putInt(phone.getContext().getContentResolver(),
                Settings.Secure.DATA_ROAMING, enabled ? 1 : 0);
            if (phone.getServiceState().getRoaming()) {
                if (enabled) {
                    mRetryMgr.resetRetryCount();
                }
                sendMessage(obtainMessage(EVENT_ROAMING_ON));
            }
        }
        Message roamingMsg = phone.getServiceState().getRoaming() ?
            obtainMessage(EVENT_ROAMING_ON) : obtainMessage(EVENT_ROAMING_OFF);
        sendMessage(roamingMsg);
    }

    //Retrieve the data roaming setting from the shared preferences.
@@ -243,6 +250,9 @@ public abstract class DataConnectionTracker extends Handler {
                break;

            case EVENT_ROAMING_OFF:
                if (getDataOnRoamingEnabled() == false) {
                    mRetryMgr.resetRetryCount();
                }
                onRoamingOff();
                break;

+22 −3
Original line number Diff line number Diff line
@@ -76,9 +76,6 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
    /** Currently active CdmaDataConnection */
    private CdmaDataConnection mActiveDataConnection;

    /** Manage the behavior of data retry after failure */
    private final RetryManager mRetryMgr = new RetryManager();

    /** Defined cdma connection profiles */
    private static final int EXTERNAL_NETWORK_DEFAULT_ID = 0;
    private static final int EXTERNAL_NETWORK_NUM_TYPES  = 1;
@@ -163,6 +160,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
        p.mSST.registerForCdmaDataConnectionDetached(this, EVENT_CDMA_DATA_DETACHED, null);
        p.mSST.registerForRoamingOn(this, EVENT_ROAMING_ON, null);
        p.mSST.registerForRoamingOff(this, EVENT_ROAMING_OFF, null);
        p.mCM.registerForCdmaOtaProvision(this, EVENT_CDMA_OTA_PROVISION, null);

        this.netstat = INetStatService.Stub.asInterface(ServiceManager.getService("netstat"));

@@ -210,6 +208,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
        mCdmaPhone.mSST.unregisterForCdmaDataConnectionDetached(this);
        mCdmaPhone.mSST.unregisterForRoamingOn(this);
        mCdmaPhone.mSST.unregisterForRoamingOff(this);
        phone.mCM.unregisterForCdmaOtaProvision(this);

        phone.getContext().unregisterReceiver(this.mIntentReceiver);
        destroyAllDataConnectionList();
@@ -849,6 +848,22 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
        }
    }

    private void onCdmaOtaProvision(AsyncResult ar) {
        if (ar.exception != null) {
            int [] otaPrivision = (int [])ar.result;
            if ((otaPrivision != null) && (otaPrivision.length > 1)) {
                switch (otaPrivision[0]) {
                case Phone.CDMA_OTA_PROVISION_STATUS_COMMITTED:
                case Phone.CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED:
                    mRetryMgr.resetRetryCount();
                    break;
                default:
                    break;
                }
            }
        }
    }

    private void writeEventLogCdmaDataDrop() {
        CdmaCellLocation loc = (CdmaCellLocation)(phone.getCellLocation());
        int bsid = (loc != null) ? loc.getBaseStationId() : -1;
@@ -957,6 +972,10 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
                onDataStateChanged((AsyncResult) msg.obj);
                break;

            case EVENT_CDMA_OTA_PROVISION:
                onCdmaOtaProvision((AsyncResult) msg.obj);
                break;

            default:
                // handle the message in the super class DataConnectionTracker
                super.handleMessage(msg);
+0 −2
Original line number Diff line number Diff line
@@ -96,8 +96,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
    private int mPdpResetCount = 0;
    private boolean mIsScreenOn = true;

    private final RetryManager mRetryMgr = new RetryManager();

    /** Delay between APN attempts */
    protected static final int APN_DELAY_MILLIS = 5000;