summaryrefslogtreecommitdiffstats
path: root/core/jni/android_net_wifi_Wifi.cpp
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-02-17 16:44:54 -0800
committerIrfan Sheriff <isheriff@google.com>2011-02-21 14:02:44 -0800
commitfcc0845cf9990470d498dcaa036f0ae6487ddf34 (patch)
tree9b174a0ae63fcf2d01ee72ec077d79367bade1b7 /core/jni/android_net_wifi_Wifi.cpp
parent25474a2230152700e5f7eb7e1495be40c6bd26a8 (diff)
downloadframeworks_base-fcc0845cf9990470d498dcaa036f0ae6487ddf34.zip
frameworks_base-fcc0845cf9990470d498dcaa036f0ae6487ddf34.tar.gz
frameworks_base-fcc0845cf9990470d498dcaa036f0ae6487ddf34.tar.bz2
Add support for background scanning
Background scanning (preferred network offload) allows us the host to sleep while the dongle monitors the presence of any preferred networks. This allows us for significant power savings since the system does not have to wake up often to initiate a scan Bug: 3453021 Change-Id: I7c1dbfd0c3f717df81e4da6091c4c5657c9ec9ca
Diffstat (limited to 'core/jni/android_net_wifi_Wifi.cpp')
-rw-r--r--core/jni/android_net_wifi_Wifi.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp
index fc806a5..667ba75 100644
--- a/core/jni/android_net_wifi_Wifi.cpp
+++ b/core/jni/android_net_wifi_Wifi.cpp
@@ -556,6 +556,18 @@ static jboolean android_net_wifi_setSuspendOptimizationsCommand(JNIEnv* env, job
return doBooleanCommand(cmdstr, "OK");
}
+static void android_net_wifi_enableBackgroundScan(JNIEnv* env, jobject clazz, jboolean enable)
+{
+ //Note: BGSCAN-START and BGSCAN-STOP are documented in core/res/res/values/config.xml
+ //and will need an update if the names are changed
+ if (enable) {
+ doBooleanCommand("DRIVER BGSCAN-START", "OK");
+ }
+ else {
+ doBooleanCommand("DRIVER BGSCAN-STOP", "OK");
+ }
+}
+
// ----------------------------------------------------------------------------
/*
@@ -623,6 +635,7 @@ static JNINativeMethod gWifiMethods[] = {
(void*) android_net_wifi_setSuspendOptimizationsCommand},
{ "setCountryCodeCommand", "(Ljava/lang/String;)Z",
(void*) android_net_wifi_setCountryCodeCommand},
+ { "enableBackgroundScan", "(Z)V", (void*) android_net_wifi_enableBackgroundScan},
};
int register_android_net_wifi_WifiManager(JNIEnv* env)