Merge "Plumb through enableVerboseLogging() to WificondControl"
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
index 6a454d9..32b1768 100644
--- a/service/java/com/android/server/wifi/WifiNative.java
+++ b/service/java/com/android/server/wifi/WifiNative.java
@@ -244,6 +244,9 @@
         } else {
             DBG = false;
         }
+        if (mWificondControl != null) {
+            mWificondControl.enableVerboseLogging(verbose > 0 ? true : false);
+        }
     }
 
     private void localLog(String s) {
diff --git a/service/java/com/android/server/wifi/WificondControl.java b/service/java/com/android/server/wifi/WificondControl.java
index bb6bbb4..99f6f3a 100644
--- a/service/java/com/android/server/wifi/WificondControl.java
+++ b/service/java/com/android/server/wifi/WificondControl.java
@@ -38,6 +38,7 @@
  * NOTE: This class should only be used from WifiNative.
  */
 public class WificondControl {
+    private boolean mVerboseLoggingEnabled = false;
 
     private static final String TAG = "WificondControl";
     private static final int MAC_ADDR_LEN = 6;
@@ -51,6 +52,13 @@
         mWifiInjector = wifiInjector;
     }
 
+    /** Enable or disable verbose logging of WificondControl.
+     *  @param enable True to enable verbose logging. False to disable verbose logging.
+     */
+    public void enableVerboseLogging(boolean enable) {
+        mVerboseLoggingEnabled = enable;
+    }
+
     /**
     * Setup driver for client mode via wificond.
     * @return An IClientInterface as wificond client interface binder handler.
@@ -197,7 +205,7 @@
                 return null;
             }
         } catch (RemoteException e) {
-            Log.e(TAG, "Failed to do signal polling  due to remote exception");
+            Log.e(TAG, "Failed to do signal polling due to remote exception");
             return null;
         }
         WifiNative.SignalPollResult pollResult = new WifiNative.SignalPollResult();
@@ -226,7 +234,7 @@
                 return null;
             }
         } catch (RemoteException e) {
-            Log.e(TAG, "Failed to do signal polling  due to remote exception");
+            Log.e(TAG, "Failed to do signal polling due to remote exception");
             return null;
         }
         WifiNative.TxPacketCounters counters = new WifiNative.TxPacketCounters();
@@ -271,6 +279,10 @@
         } catch (RemoteException e1) {
             Log.e(TAG, "Failed to create ScanDetail ArrayList");
         }
+        if (mVerboseLoggingEnabled) {
+            Log.d(TAG, "get " + results.size() + " scan results from wificond");
+        }
+
         return results;
     }
 }