diff options
| author | 2011-09-08 15:13:26 -0700 | |
|---|---|---|
| committer | 2011-09-08 16:16:02 -0700 | |
| commit | 6acf39b3c6b67c2d302b6a01a213bd40a8192909 (patch) | |
| tree | a10bab5226d326107e5616a9a89931387bc478b5 | |
| parent | 3adb1809098998851b2486e5abad1ec612f9f85e (diff) | |
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
| -rw-r--r-- | services/java/com/android/server/NetworkManagementService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java index f774dea8b505..349b4d2ae998 100644 --- a/services/java/com/android/server/NetworkManagementService.java +++ b/services/java/com/android/server/NetworkManagementService.java @@ -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); } |