ril: Fix telephony under emulation.
This patch fixes several regressions that were introduced in
a recent rewrite of the native RIL support code, and which
prevent networking from working under emulation.
- 'apn' and 'type' were incorrectly swapped in the
AT+CGDCONT= command string, so the command was
never executed properly by the emulated modem.
- The PDP context type was not properly written to the
parcel in responseDataCallList() in libril/ril.cpp.
Due to this the Java RIL code ignored the response.
- The dns list returned by requestOrSendDataCallList()
was an empty string, which caused the Java RIL code to
fail with a "unknown host" exception when trying to setup
net.dns1
Change-Id: I7f4e6f6f45d197960ecb20e7e8592272921fe694
Note: You also need to apply this emulator patch to verify
this one: http://review.source.android.com//#change,20965
The code in requestOrSendDataCallList() assumes that
AT+CGACT? and AT+CGDCONT? will have answers with exactly
the same number of lines (this wasn't the case before
the emulator fix).
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 8216dcb..714ffa7 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -1540,6 +1540,7 @@
p.writeInt32((int)p_cur[i].status);
p.writeInt32(p_cur[i].cid);
p.writeInt32(p_cur[i].active);
+ writeStringToParcel(p, p_cur[i].type);
writeStringToParcel(p, p_cur[i].ifname);
writeStringToParcel(p, p_cur[i].addresses);
writeStringToParcel(p, p_cur[i].dnses);