Skip to content

Commit

Permalink
RIL: Add compatibility with qcom's DSDS
Browse files Browse the repository at this point in the history
Devices with radio libraries built against a DSDS-enabled qualcomm
BSP (anything in the last 4 or 5 months, apparently) have a slight
incompatibility in the RIL protocol: it expects the first 4 bytes
of the datastream to be the slot's identification (even if the
device isn't dual-SIM). Absence of those 4 bytes will make the
connection hang.

Change-Id: I9f5821add02e7e5b5286c3b0818cb4a94edcc13c
  • Loading branch information
rmcc committed Nov 5, 2013
1 parent 5db768c commit 468a15a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/java/com/android/internal/telephony/RIL.java
Expand Up @@ -521,6 +521,20 @@ class RILReceiver implements Runnable {
mSocket = s;
Rlog.i(RILJ_LOG_TAG, "Connected to '" + SOCKET_NAME_RIL + "' socket");

/* Compatibility with qcom's DSDS (Dual SIM) stack */
if (needsOldRilFeature("qcomdsds")) {
String str = "SUB1";
byte[] data = str.getBytes();
try {
mSocket.getOutputStream().write(data);
Log.i(LOG_TAG, "Data sent!!");
} catch (IOException ex) {
Log.e(LOG_TAG, "IOException", ex);
} catch (RuntimeException exc) {
Log.e(LOG_TAG, "Uncaught exception ", exc);
}
}

int length = 0;
try {
InputStream is = mSocket.getInputStream();
Expand Down
Expand Up @@ -133,7 +133,7 @@ public SetupResult setLinkProperties(LinkProperties linkProperties,
String [] ap = addr.split("/");
if (ap.length == 2) {
addr = ap[0];
addrPrefixLen = Integer.parseInt(ap[1]);
addrPrefixLen = Integer.parseInt(ap[1].replaceAll("[\\D]",""));
} else {
addrPrefixLen = 0;
}
Expand Down

0 comments on commit 468a15a

Please sign in to comment.