Fix bad logs and a crash while reading configs

Some users have seen NumberFormatExeptions; while this is not
fully explained, it results in a crash. This change fixes that
by handling the exception.

There is also a misleading log (complains about error writing
file) and there's a spammy log about RSSI.

Bug: 21338785

Change-Id: Ifc7c04785ac6cccced2896ccccbedfbb3470fb01
diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java
index 238c248..6c2f9d3 100644
--- a/service/java/com/android/server/wifi/WifiConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiConfigStore.java
@@ -87,6 +87,7 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
+import java.io.EOFException;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.nio.charset.StandardCharsets;
@@ -2409,7 +2410,6 @@
                             break;
                         case RSSI_KEY:
                             rssi = Integer.parseInt(value);
-                            Log.d("ZXZ", "rssi set to " + rssi);
                             break;
                         case BSSID_STATUS_KEY:
                             status = Integer.parseInt(value);
@@ -2460,8 +2460,12 @@
                     }
                 }
             }
+        } catch (NumberFormatException e) {
+            Log.e(TAG, "readNetworkHistory: failed to read, revert to default, " + e, e);
+        } catch (EOFException e) {
+            // do nothing
         } catch (IOException e) {
-            loge("readNetworkHistory: No config file, revert to default" + e);
+            Log.e(TAG, "readNetworkHistory: No config file, revert to default, " + e, e);
         }
     }