diff options
author | Wink Saville <wink@google.com> | 2009-08-15 08:40:30 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2009-08-15 08:40:30 -0700 |
commit | ad4d9e5bebb5a9ba01c1459d941019887f4a7d6d (patch) | |
tree | 6fe3990ba6740a01f50158329df140644b74d2a7 /telephony | |
parent | 549db46cb31725a66cd32ad4e0abb0d60d893fca (diff) | |
download | frameworks_base-ad4d9e5bebb5a9ba01c1459d941019887f4a7d6d.zip frameworks_base-ad4d9e5bebb5a9ba01c1459d941019887f4a7d6d.tar.gz frameworks_base-ad4d9e5bebb5a9ba01c1459d941019887f4a7d6d.tar.bz2 |
Allow CdmaDataConnectionTracker to handle RIL_UNSOL_OTA_PROVISION_STATUS
and when data roaming is enabled reset the retry manager.
This change also refactors mRetryMgr to DataConnectionTracker
removing it from Cdma and Gsm data connection trackers child classes.
Diffstat (limited to 'telephony')
3 files changed, 35 insertions, 8 deletions
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java index a3f1ad8..fa0ffcd 100644 --- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java @@ -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; diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java index 38bc24d..33cbbd7 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java @@ -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); diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index bf60bfe..34d3039 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -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; |