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

Commit 6acf39b3 authored by JP Abgrall's avatar JP Abgrall
Browse files

NetworkManagementService: adjust the qtaguid idx to new kernel

https://partner.source.android.com/g/#/c/8968/ introduced

  idx iface acct_tag_hex uid_tag_int cnt_set ...
  2 wlan0 0x0 10022 0 ...
  3 wlan0 0x0 10022 1 ...
  4 wlan0 0x3010000000000000 10022 0 ...
  5 wlan0 0x3010000000000000 10022 1 ...

so treat it as monotonic starting a idx 1 for header line.

Change-Id: Ie1d0ec9a0b7103620a93b0ef0b01c13fe4162616
parent 3adb1809
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1325,7 +1325,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        // TODO: remove knownLines check once 5087722 verified
        final HashSet<String> knownLines = Sets.newHashSet();
        // TODO: remove lastIdx check once 5270106 verified
        int lastIdx = 0;
        int lastIdx;

        final ArrayList<String> keys = Lists.newArrayList();
        final ArrayList<String> values = Lists.newArrayList();
@@ -1339,6 +1339,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub
            // parse first line as header
            line = reader.readLine();
            splitLine(line, keys);
            lastIdx = 1;

            // parse remaining lines
            while ((line = reader.readLine()) != null) {
@@ -1350,7 +1351,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub
                }

                final int idx = getParsedInt(parsed, KEY_IDX);
                if (idx > lastIdx + 1) {
                if (idx != lastIdx + 1) {
                    throw new IllegalStateException(
                            "inconsistent idx=" + idx + " after lastIdx=" + lastIdx);
                }