summaryrefslogtreecommitdiffstats
path: root/src/java/com/android
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-04-01 17:38:02 +0100
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-04-01 17:38:02 +0100
commite243626e34bcf7383cfcdc4e80d1a9d6176b0ede (patch)
tree5eb37658b1384c70ac524e18377575c871460c45 /src/java/com/android
parentaeacbb9eebd087e6eaf921a1cb6a12c43033548a (diff)
downloadframeworks_opt_telephony-e243626e34bcf7383cfcdc4e80d1a9d6176b0ede.zip
frameworks_opt_telephony-e243626e34bcf7383cfcdc4e80d1a9d6176b0ede.tar.gz
frameworks_opt_telephony-e243626e34bcf7383cfcdc4e80d1a9d6176b0ede.tar.bz2
RIL: Add compatibility with qcom's DSDS
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
Diffstat (limited to 'src/java/com/android')
-rw-r--r--src/java/com/android/internal/telephony/DataCallState.java2
-rw-r--r--src/java/com/android/internal/telephony/RIL.java14
2 files changed, 15 insertions, 1 deletions
diff --git a/src/java/com/android/internal/telephony/DataCallState.java b/src/java/com/android/internal/telephony/DataCallState.java
index efbf608..eba3e4d 100644
--- a/src/java/com/android/internal/telephony/DataCallState.java
+++ b/src/java/com/android/internal/telephony/DataCallState.java
@@ -134,7 +134,7 @@ public class DataCallState {
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;
}
diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java
index 9d3314f..e36999e 100644
--- a/src/java/com/android/internal/telephony/RIL.java
+++ b/src/java/com/android/internal/telephony/RIL.java
@@ -559,6 +559,20 @@ public class RIL extends BaseCommands implements CommandsInterface {
mSocket = s;
Log.i(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();