Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6db6ae33 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Giulio Cervera
Browse files

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: I1b28dfc9a7a3f09e1461506de8d556513cee41ed
parent d9939f4d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
                        }
+14 −0
Original line number Diff line number Diff line
@@ -579,6 +579,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();