Notify scan-only mode to driver for power saving

If Wi-Fi driver knows it's in scan-only mode, it can save more power
than connect mode.

This change adds setScanMode in IWifiStaIface to allow Wi-Fi framework
to notify scan-only mode change to Wi-Fi driver.

Bug: 177811719
Test: atest VtsHalWifiV1_5TargetTest

Change-Id: I1dfbc24a0a3272c1341223aff36656be4a6fd21b
diff --git a/wifi/1.5/default/wifi_sta_iface.cpp b/wifi/1.5/default/wifi_sta_iface.cpp
index 82bfcf1..92c9fe4 100644
--- a/wifi/1.5/default/wifi_sta_iface.cpp
+++ b/wifi/1.5/default/wifi_sta_iface.cpp
@@ -273,6 +273,13 @@
                            hidl_status_cb);
 }
 
+Return<void> WifiStaIface::setScanMode(bool enable,
+                                       setScanMode_cb hidl_status_cb) {
+    return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                           &WifiStaIface::setScanModeInternal, hidl_status_cb,
+                           enable);
+}
+
 std::pair<WifiStatus, std::string> WifiStaIface::getNameInternal() {
     return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_};
 }
@@ -655,6 +662,12 @@
     return {createWifiStatus(WifiStatusCode::SUCCESS), mac};
 }
 
+WifiStatus WifiStaIface::setScanModeInternal(bool enable) {
+    // OEM's need to implement this on their devices if needed.
+    LOG(WARNING) << "setScanModeInternal(" << enable << ") not supported";
+    return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+}
+
 }  // namespace implementation
 }  // namespace V1_5
 }  // namespace wifi