diff options
author | Ethan Chen <intervigil@gmail.com> | 2013-08-16 17:42:44 -0700 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2013-08-16 17:42:44 -0700 |
commit | da0db0bd997c327b1279ba03cf1cea8cfd501044 (patch) | |
tree | 24591d532485bfd11fa53e858889d4384cf4339a | |
parent | f0e75f849a47a9df97373b3c819b8f859ced0a38 (diff) | |
download | frameworks_opt_telephony-da0db0bd997c327b1279ba03cf1cea8cfd501044.zip frameworks_opt_telephony-da0db0bd997c327b1279ba03cf1cea8cfd501044.tar.gz frameworks_opt_telephony-da0db0bd997c327b1279ba03cf1cea8cfd501044.tar.bz2 |
HTCQualcommRIL: fix data drops when switching state
* HTC RIL always throws this exception after the initial data call
setup, so only switch ifname if the call goes from active to inactive.
* Prevents data drop due to empty address/DNS/gateway when radio tech
switches to/from LTE/3G/2G.
Change-Id: I29107f549029d467ed01c0eba46561d65ca4d5d7
-rw-r--r-- | src/java/com/android/internal/telephony/HTCQualcommRIL.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/java/com/android/internal/telephony/HTCQualcommRIL.java b/src/java/com/android/internal/telephony/HTCQualcommRIL.java index 5aa0416..dd29bec 100644 --- a/src/java/com/android/internal/telephony/HTCQualcommRIL.java +++ b/src/java/com/android/internal/telephony/HTCQualcommRIL.java @@ -48,6 +48,39 @@ public class HTCQualcommRIL extends RIL implements CommandsInterface { } @Override + protected DataCallState getDataCallState(Parcel p, int version) { + DataCallState dataCall = new DataCallState(); + + dataCall.version = version; + dataCall.status = p.readInt(); + dataCall.suggestedRetryTime = p.readInt(); + dataCall.cid = p.readInt(); + dataCall.active = p.readInt(); + dataCall.type = p.readString(); + dataCall.ifname = p.readString(); + /* Check dataCall.active != 0 so address, dns, gateways are provided + * when switching LTE<->3G<->2G */ + if ((dataCall.status == DataConnection.FailCause.NONE.getErrorCode()) && + TextUtils.isEmpty(dataCall.ifname) && dataCall.active != 0) { + throw new RuntimeException("getDataCallState, no ifname"); + } + String addresses = p.readString(); + if (!TextUtils.isEmpty(addresses)) { + dataCall.addresses = addresses.split(" "); + } + String dnses = p.readString(); + if (!TextUtils.isEmpty(dnses)) { + dataCall.dnses = dnses.split(" "); + } + String gateways = p.readString(); + if (!TextUtils.isEmpty(gateways)) { + dataCall.gateways = gateways.split(" "); + } + + return dataCall; + } + + @Override protected void processUnsolicited (Parcel p) { Object ret; |