From e942dd55c772b20ac205b14fb20e6a841e8e502c Mon Sep 17 00:00:00 2001 From: Mike Kasick Date: Sat, 3 Mar 2012 13:16:42 -0500 Subject: SamsungRIL: Fixes for CDMA data reconnection failures due to stale pppd Occasionally the CDMA data connection fails to reconnect after various radio events, which is fixed neither by toggling mobile data nor airplane mode, but only by a reboot. One known cause of this problem is that the pppd_cdma service is occasionally left running after the radio event, which causes all subsequent "setup data call" operations to fail. These two fixes address the stale pppd_cdma service issue: - Move the pppd_cdma service shutdown (set ril.cdma.data_state=0) from the "deactivate data call" response to its request. This avoids the issue where the response never comes (radio crash?), and thus, the service is never stopped. - Force pppd_cdma service shutdown on a "setup data call" failure. This allows subsequent setup attempts to succeed in the event that the "deactivate" request was never made (unexpected radio poweroff). --- .../java/com/android/internal/telephony/SamsungRIL.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/telephony/java/com/android/internal/telephony/SamsungRIL.java b/telephony/java/com/android/internal/telephony/SamsungRIL.java index ebe8909..38ae600 100644 --- a/telephony/java/com/android/internal/telephony/SamsungRIL.java +++ b/telephony/java/com/android/internal/telephony/SamsungRIL.java @@ -147,7 +147,7 @@ public class SamsungRIL extends RIL implements CommandsInterface { case RIL_REQUEST_GET_IMEI: ret = responseString(p); break; case RIL_REQUEST_GET_IMEISV: ret = responseString(p); break; case RIL_REQUEST_ANSWER: ret = responseVoid(p); break; - case RIL_REQUEST_DEACTIVATE_DATA_CALL: ret = responseDeactivateDataCall(p); break; + case RIL_REQUEST_DEACTIVATE_DATA_CALL: ret = responseVoid(p); break; case RIL_REQUEST_QUERY_FACILITY_LOCK: ret = responseInts(p); break; case RIL_REQUEST_SET_FACILITY_LOCK: ret = responseInts(p); break; case RIL_REQUEST_CHANGE_BARRING_PASSWORD: ret = responseVoid(p); break; @@ -897,6 +897,14 @@ public class SamsungRIL extends RIL implements CommandsInterface { } } } else { + if (mIsSamsungCdma) { + // On rare occasion the pppd_cdma service is left active from a stale + // session, causing the data call setup to fail. Make sure that pppd_cdma + // is stopped now, so that the next setup attempt may succeed. + Log.d(LOG_TAG, "Set ril.cdma.data_state=0 to make sure pppd_cdma is stopped."); + SystemProperties.set("ril.cdma.data_state", "0"); + } + dataCall.status = FailCause.ERROR_UNSPECIFIED.getErrorCode(); // Who knows? } @@ -938,15 +946,16 @@ public class SamsungRIL extends RIL implements CommandsInterface { return false; } - protected Object - responseDeactivateDataCall(Parcel p) { + @Override + public void + deactivateDataCall(int cid, int reason, Message result) { if (mIsSamsungCdma) { // Disconnect: Set ril.cdma.data_state=0 to stop pppd_cdma service. Log.d(LOG_TAG, "Set ril.cdma.data_state=0."); SystemProperties.set("ril.cdma.data_state", "0"); } - return null; + super.deactivateDataCall(cid, reason, result); } protected Object -- cgit v1.1