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

Commit d11600e9 authored by David Ferguson's avatar David Ferguson
Browse files

telephony: fix Network Operators list on Samsung Qualcomm devices

setNetworkSelectionModeManual() and responseOperatorInfos() are overridden
in QualcommSharedRIL with code that breaks Samsung Qualcomm RIL's.
Override them, again, to put back the original functionality found in
RIL.java.

Change-Id: I7ac663a60edf62c80cdac831443ca6cddbe3702c
parent a22d8b29
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ import android.text.TextUtils;
import android.util.Log;
import com.android.internal.telephony.RILConstants;

import java.util.ArrayList;

/**
 * Custom RIL to handle unique behavior of Hercules/Skyrocket/Note radio
 *
@@ -105,6 +107,47 @@ public class SamsungQualcommUiccRIL extends QualcommSharedRIL implements Command
        }
    }

    @Override
    public void
    setNetworkSelectionModeManual(String operatorNumeric, Message response) {
        RILRequest rr
                = RILRequest.obtain(RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL,
                                    response);

        if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
                    + " " + operatorNumeric);

        rr.mp.writeString(operatorNumeric);

        send(rr);
    }

    @Override
    protected Object
    responseOperatorInfos(Parcel p) {
        String strings[] = (String [])responseStrings(p);
        ArrayList<OperatorInfo> ret;

        if (strings.length % 4 != 0) {
            throw new RuntimeException(
                "RIL_REQUEST_QUERY_AVAILABLE_NETWORKS: invalid response. Got "
                + strings.length + " strings, expected multible of 4");
        }

        ret = new ArrayList<OperatorInfo>(strings.length / 4);

        for (int i = 0 ; i < strings.length ; i += 4) {
            ret.add (
                new OperatorInfo(
                    strings[i+0],
                    strings[i+1],
                    strings[i+2],
                    strings[i+3]));
        }

        return ret;
    }

    @Override
    protected Object
    responseIccCardStatus(Parcel p) {