summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorKazuhiro Ondo <kazuhiro.ondo@motorola.com>2011-06-02 21:41:16 -0500
committerWink Saville <wink@google.com>2011-06-03 11:42:48 -0700
commit77c9411306b6b3d210d22214d596272c9728cf5e (patch)
tree4b2fd058050919b2e1277aa4bca99c632d0efaf7 /telephony
parentf5699b82adef34b0b6bd88554c6a017f8662985e (diff)
downloadframeworks_base-77c9411306b6b3d210d22214d596272c9728cf5e.zip
frameworks_base-77c9411306b6b3d210d22214d596272c9728cf5e.tar.gz
frameworks_base-77c9411306b6b3d210d22214d596272c9728cf5e.tar.bz2
Data recovery failure due to apn/dc state stuck in "disconnecting"
If rild is reset while RIL_DEACTIVATE_DATA_CALL is pending response, the ApnContext is not force cleaned up since link to DCAC is cleared in the begining of release. This patch fixes: 1) Hold DCAC reference until the DC is disconnected. This is to ensure DC won't be stuck in DcDisconnectingState so force reset can kick in. 2) In "clearCleanUpConnection", make sure the status of ApnContext can be reset to IDLE even if no reference to DCAC. Change-Id: Ic69271da7c6bc9dcb2c38ec53a9bd2e8ce785adc
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java54
1 files changed, 15 insertions, 39 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index f6485a4..1fbc1c1 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -608,33 +608,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
return allowed;
}
- /**
- * Release the apnContext
- *
- * @param apnContext
- * @param tearDown
- * @return none
- */
- private void releaseApnContext(ApnContext apnContext, boolean tearDown) {
- if (apnContext == null) {
- if (DBG) loge("releaseApnContext: apnContext null should not happen, ignore");
- return;
- }
- DataConnection dc = apnContext.getDataConnection();
- if (dc == null) {
- if (DBG) loge("releaseApnContext: apnContext dc == null should not happen, ignore");
- return;
- }
- if (tearDown) {
- if (DBG) log("releaseApnContext: tearing down");
- Message msg = obtainMessage(EVENT_DISCONNECT_DONE, apnContext);
- apnContext.getDataConnection().tearDown(apnContext.getReason(), msg);
- }
- apnContext.setDataConnection(null);
- apnContext.setDataConnectionAc(null);
- return;
- }
-
private void setupDataOnReadyApns(String reason) {
// Only check for default APN state
for (ApnContext apnContext : mApnContexts.values()) {
@@ -803,17 +776,17 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
}
DataConnectionAc dcac = apnContext.getDataConnectionAc();
- if (dcac != null) {
- if (tearDown) {
- apnContext.setState(State.DISCONNECTING);
- releaseApnContext(apnContext, tearDown);
- } else {
- dcac.resetSync();
- apnContext.setState(State.IDLE);
- mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());
- apnContext.setDataConnection(null);
- apnContext.setDataConnectionAc(null);
- }
+ if (tearDown && (dcac != null)) {
+ if (DBG) log("cleanUpConnection: tearing down");
+ Message msg = obtainMessage(EVENT_DISCONNECT_DONE, apnContext);
+ apnContext.getDataConnection().tearDown(apnContext.getReason(), msg);
+ apnContext.setState(State.DISCONNECTING);
+ } else {
+ if (dcac != null) dcac.resetSync();
+ apnContext.setState(State.IDLE);
+ mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());
+ apnContext.setDataConnection(null);
+ apnContext.setDataConnectionAc(null);
}
}
@@ -1704,7 +1677,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
apnContext.setState(State.FAILED);
mPhone.notifyDataConnection(Phone.REASON_APN_FAILED, apnContext.getApnType());
- releaseApnContext(apnContext, false);
+ apnContext.setDataConnection(null);
+ apnContext.setDataConnectionAc(null);
if (DBG) {
log("onDataSetupComplete: permanent error apn=%s" + apnString );
}
@@ -1739,6 +1713,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
apnContext.setState(State.IDLE);
apnContext.setApnSetting(null);
+ apnContext.setDataConnection(null);
+ apnContext.setDataConnectionAc(null);
mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());