From da0db0bd997c327b1279ba03cf1cea8cfd501044 Mon Sep 17 00:00:00 2001 From: Ethan Chen Date: Fri, 16 Aug 2013 17:42:44 -0700 Subject: 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 --- .../android/internal/telephony/HTCQualcommRIL.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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; -- cgit v1.1