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

Commit 3f730cc1 authored by Koushik Dutta's avatar Koushik Dutta Committed by Ricardo Cerqueira
Browse files

Break the legacy ril shims into specific features. The ICC feature breaks...

Break the legacy ril shims into specific features. The ICC feature breaks crespo, but crepso needs the signal strength feature.
parent 6b09342a
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -2983,11 +2983,20 @@ public class RIL extends BaseCommands implements CommandsInterface {
        return new IccIoResult(sw1, sw2, s);
    }

    private boolean needsOldRilFeature(String feature) {
        String[] features = SystemProperties.get("ro.telephony.ril.v3", "").split(",");
        for (String found: features) {
            if (found.equals(feature))
                return true;
        }
        return false;
    }

    protected Object
    responseIccCardStatus(Parcel p) {
        IccCardApplication ca;

        int oldRil = SystemProperties.getInt("ro.telephony.ril.v3", 0);
        boolean oldRil = needsOldRilFeature("icccardstatus");

        IccCardStatus status = new IccCardStatus();
        status.setCardState(p.readInt());
@@ -2995,7 +3004,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        status.setGsmUmtsSubscriptionAppIndex(p.readInt());
        status.setCdmaSubscriptionAppIndex(p.readInt());

        if(oldRil == 0)
        if (!oldRil)
            status.setImsSubscriptionAppIndex(p.readInt());

        int numApplications = p.readInt();
@@ -3150,8 +3159,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
    protected Object
    responseDataCallList(Parcel p) {
        ArrayList<DataCallState> response;
        int oldRil = SystemProperties.getInt("ro.telephony.ril.v3", 0);
        int ver = (oldRil!=0 ? 3 : p.readInt());
        boolean oldRil = needsOldRilFeature("datacall");
        int ver = (oldRil ? 3 : p.readInt());
        int num = p.readInt();
        riljLog("responseDataCallList ver=" + ver + " num=" + num);

@@ -3165,8 +3174,8 @@ public class RIL extends BaseCommands implements CommandsInterface {

    protected Object
    responseSetupDataCall(Parcel p) {
        int oldRil = SystemProperties.getInt("ro.telephony.ril.v3", 0);
        int ver = (oldRil!=0 ? 3 : p.readInt());
        boolean oldRil = needsOldRilFeature("datacall");
        int ver = (oldRil ? 3 : p.readInt());
        int num = p.readInt();
        if (RILJ_LOGV) riljLog("responseSetupDataCall ver=" + ver + " num=" + num);

@@ -3356,13 +3365,12 @@ public class RIL extends BaseCommands implements CommandsInterface {
        int numInts = 12;
        int response[];

        int oldRil = SystemProperties.getInt("ro.telephony.ril.v3",
                0);
        boolean oldRil = needsOldRilFeature("signalstrength");

        /* TODO: Add SignalStrength class to match RIL_SignalStrength */
        response = new int[numInts];
        for (int i = 0 ; i < numInts ; i++) {
            if (oldRil!=0 && i>6 && i<12) {
            if (oldRil && i > 6 && i < 12) {
                response[i] = -1;
            } else {
                response[i] = p.readInt();