From 4f33e1f41c995b0cb2689716d0e8bf5324bb0bb7 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sat, 9 Jun 2012 11:45:55 +0200 Subject: ipconfig.txt: fix a possible error in parsing The format of /data/misc/wifi/ipconfig.txt is this one ... ... On the defy, i had an error on boot regarding a missing "id" in NetworkStats, so i compared on another device... It appears that defy one format was : ... I dont know exactly what caused this format error, maybe because the quota and usage stats are enabled on it. Change-Id: I4cf70fe88688341b8eea007a08910acb6f4fcff7 --- wifi/java/android/net/wifi/WifiConfigStore.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java index 54b760f..434d272 100644 --- a/wifi/java/android/net/wifi/WifiConfigStore.java +++ b/wifi/java/android/net/wifi/WifiConfigStore.java @@ -740,6 +740,7 @@ class WifiConfigStore { in = new DataInputStream(new BufferedInputStream(new FileInputStream( ipConfigFile))); + int pos = 0; int version = in.readInt(); if (version != 2 && version != 1) { loge("Bad version on IP configuration file, ignore read"); @@ -796,6 +797,8 @@ class WifiConfigStore { } else if (key.equals(EXCLUSION_LIST_KEY)) { exclusionList = in.readUTF(); } else if (key.equals(EOS)) { + // an eos can be present after the version header + if (pos == 0) continue; break; } else { loge("Ignore unknown key " + key + "while reading"); @@ -803,6 +806,7 @@ class WifiConfigStore { } catch (IllegalArgumentException e) { loge("Ignore invalid address while reading" + e); } + pos++; } while (true); if (id != -1) { -- cgit v1.1