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

Commit 4f2fa524 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "telephony: fix Network Operators list on Samsung Qualcomm devices" into ics

parents 5043585e d11600e9
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) {