OSDN Git Service

Wificond: Provide a way to enable Offload scans
authorSohani Rao <sohanirao@google.com>
Tue, 22 Aug 2017 20:45:43 +0000 (13:45 -0700)
committerSohani Rao <sohanirao@google.com>
Fri, 1 Sep 2017 19:10:12 +0000 (12:10 -0700)
Enable use of adb shell setprop <property_string> <value> command
to enable using offload HAL for disconnected mode PNO scans.

Bug: 64944391
Test: Unit test and on device to test to ensure the command works
Change-Id: I911a15177f98be6040d161093bf4c97089973b9c

Android.mk
scanning/offload/offload_service_utils.cpp

index 163e3d1..5a5a078 100644 (file)
@@ -200,6 +200,7 @@ LOCAL_SHARED_LIBRARIES := \
     android.hardware.wifi.offload@1.0 \
     libbase \
     libbinder \
+    libcutils \
     libhidltransport \
     libhidlbase \
     libhwbinder \
index ce25d85..d91f069 100644 (file)
@@ -16,6 +16,7 @@
 #include "wificond/scanning/offload/offload_service_utils.h"
 
 #include <android-base/logging.h>
+#include <cutils/properties.h>
 
 #include "wificond/scanning/offload/offload_scan_manager.h"
 #include "wificond/scanning/scanner_impl.h"
@@ -40,6 +41,11 @@ OffloadDeathRecipient* OffloadServiceUtils::GetOffloadDeathRecipient(
 }
 
 bool OffloadServiceUtils::IsOffloadScanSupported() const {
+  if (property_get_bool("persist.wifi.offload.enable", false)) {
+    LOG(INFO) << "Offload HAL supported";
+    return true;
+  }
+  LOG(INFO) << "Offload HAL not supported ";
   return false;
 }