diff options
author | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2012-06-09 11:45:55 +0200 |
---|---|---|
committer | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2012-06-09 23:02:07 +0200 |
commit | 4f33e1f41c995b0cb2689716d0e8bf5324bb0bb7 (patch) | |
tree | 324a836749932b4b042bcbdb922bd1347926a73c | |
parent | 4818c3ac8638f170f23a393c8dd51a519a637948 (diff) | |
download | frameworks_base-4f33e1f41c995b0cb2689716d0e8bf5324bb0bb7.zip frameworks_base-4f33e1f41c995b0cb2689716d0e8bf5324bb0bb7.tar.gz frameworks_base-4f33e1f41c995b0cb2689716d0e8bf5324bb0bb7.tar.bz2 |
ipconfig.txt: fix a possible error in parsing
The format of /data/misc/wifi/ipconfig.txt is this one
<version>
<netA_key1><netA_value1><netA_key2><netA_value2>...<EOS>
<netB_key1><netB_value1><netB_key2><netB_value2>...<EOS>
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 :
<version><EOS>
<netA_key1><netA_value1><netA_key2><netA_value2>...<EOS>
I dont know exactly what caused this format error,
maybe because the quota and usage stats are enabled on it.
Change-Id: I4cf70fe88688341b8eea007a08910acb6f4fcff7
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfigStore.java | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |