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

Commit bb37f34d authored by Simon Shields's avatar Simon Shields Committed by Danny Baumann
Browse files

RIL: Squash support for mQANElements

commit d76a3247a3547e7c7a95a13db7cfa1ec2a061f3d
Author: Mike Kasick <mike@kasick.org>
Date:   Thu Aug 30 13:42:27 2012 -0400

 RILs: Eliminate repeated overrides of responseOperatorInfos.

 - Add mQANElements field, default to 4 in RIL, use in responseOperatorInfos.
   This may be set to 5 in subclassed RIL constructors.

 - Remove repeated overrides of responseOperatorInfos by subclassed RILs, as
   there's no logic change, just a disagreement as to whether the
   QUERY_AVAILABLE_NETWORKS response is an array with 4 or 5 per-network
   elements.

 - Size OperatorInfo ArrayList appropriately in SemcRIL and SonyQualcommRIL.

 Change-Id: I1254a670d8611f76aad13a6f197c67012c7d4c47

commit 0bac442311e73cdbd4582babdc4e95d51dc0c5b7
Author: koxxx <stefan.panko@gmail.com>
Date:   Thu Jul 9 22:27:13 2015 +0200

    RIL: Make mQANElements configurable by property

    Change-Id: I21a3641d54ffd9e1b7d9f291c16bb9c6ca5f4542

Change-Id: I3657a41787ba2dc6549702bf6a2f549cf1aa6a7b
parent ede56996
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -303,6 +303,11 @@ public final class RIL extends BaseCommands implements CommandsInterface {

    private TelephonyEventLog mEventLog;

    // Number of per-network elements expected in QUERY_AVAILABLE_NETWORKS's response.
    // 4 elements is default, but many RILs actually return 5, making it impossible to
    // divide the response array without prior knowledge of the number of elements.
    protected int mQANElements = SystemProperties.getInt("ro.ril.telephony.mqanelements", 4);

    //***** Events

    static final int EVENT_SEND                 = 1;
@@ -3969,15 +3974,15 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        String strings[] = (String [])responseStrings(p);
        ArrayList<OperatorInfo> ret;

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

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

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