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

Commit 058ad75a authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

Telephony: Make the compat-flag verification method available everywhere

Export needsOldRilFeature() through the commands interface to make it
available to other parts of the telephony stack

Change-Id: I0e6fec083f5208795bf5067f8c73e35660e942ed
parent bd707d39
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1641,4 +1641,9 @@ public interface CommandsInterface {
     * @param response a callback message with the String response in the obj field
     */
    public void requestIsimAuthentication(String nonce, Message response);
    /**
     * @hide
     * CM-specific: Ask the RIL about the presence of back-compat flags
     */
    public boolean needsOldRilFeature(String feature);
}
+2 −1
Original line number Diff line number Diff line
@@ -2966,7 +2966,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
        return new IccIoResult(sw1, sw2, s);
    }

    protected boolean needsOldRilFeature(String feature) {
    @Override
    public boolean needsOldRilFeature(String feature) {
        String[] features = SystemProperties.get("ro.telephony.ril.v3", "").split(",");
        for (String found: features) {
            if (found.equals(feature))
+2 −12
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
            if (DBG) log("enableApnType: return APN_ALREADY_ACTIVE");
            return Phone.APN_ALREADY_ACTIVE;
        }
        if (needsOldRilFeature("singlepdp") && !Phone.APN_TYPE_DEFAULT.equals(apnType)) {
        if (mPhone.mCM.needsOldRilFeature("singlepdp") && !Phone.APN_TYPE_DEFAULT.equals(apnType)) {
            ApnContext defContext = mApnContexts.get(Phone.APN_TYPE_DEFAULT);
            if (defContext.isEnabled()) {
                setEnabled(apnTypeToId(Phone.APN_TYPE_DEFAULT), false);
@@ -515,7 +515,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {

        if (apnContext != null) {
            setEnabled(apnTypeToId(type), false);
            if (needsOldRilFeature("singlepdp") && !Phone.APN_TYPE_DEFAULT.equals(type)) {
            if (mPhone.mCM.needsOldRilFeature("singlepdp") && !Phone.APN_TYPE_DEFAULT.equals(type)) {
                setEnabled(apnTypeToId(Phone.APN_TYPE_DEFAULT), true);
            }
            if (apnContext.getState() != State.IDLE && apnContext.getState() != State.FAILED) {
@@ -2468,14 +2468,4 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
        Log.e(LOG_TAG, "[GsmDCT] " + s);
    }

    /** Maybe we should share this from RIL */
    protected 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;
    }

}
+2 −0
Original line number Diff line number Diff line
@@ -412,4 +412,6 @@ class SipCommandInterface extends BaseCommands implements CommandsInterface {

    public void requestIsimAuthentication(String nonce, Message response) {
    }

    public boolean needsOldRilFeature(String feature) { return false; }
}
+2 −0
Original line number Diff line number Diff line
@@ -1517,4 +1517,6 @@ public final class SimulatedCommands extends BaseCommands
    public void requestIsimAuthentication(String nonce, Message response) {
        unimplemented(response);
    }

    public boolean needsOldRilFeature(String feature) { return false; }
}