diff options
author | Irfan Sheriff <isheriff@google.com> | 2010-08-12 20:26:23 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2010-08-17 15:27:54 -0700 |
commit | 8c11e952305327183db9f7be719e4c94fde15a7c (patch) | |
tree | 79f9c9fcd7c3e59f96de249dad6e47149a6de0ed /core/jni/android_net_wifi_Wifi.cpp | |
parent | e6bfceeb10a01c8e89f712c0ffddc9e5e3ad1842 (diff) | |
download | frameworks_base-8c11e952305327183db9f7be719e4c94fde15a7c.zip frameworks_base-8c11e952305327183db9f7be719e4c94fde15a7c.tar.gz frameworks_base-8c11e952305327183db9f7be719e4c94fde15a7c.tar.bz2 |
DO NOT MERGE WifiLock extensions for high performance mode
Add extension to WifiLock to allow apps to operate
in high performance mode (high power & disable suspend
optimizations for battery consumption).
Bug: 2834260
Change-Id: I8b33d307f3d569bc92ba2139b9ed224ffc147547
Diffstat (limited to 'core/jni/android_net_wifi_Wifi.cpp')
-rw-r--r-- | core/jni/android_net_wifi_Wifi.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp index 7392442..903283e 100644 --- a/core/jni/android_net_wifi_Wifi.cpp +++ b/core/jni/android_net_wifi_Wifi.cpp @@ -493,6 +493,15 @@ static jboolean android_net_wifi_clearBlacklistCommand(JNIEnv* env, jobject claz return doBooleanCommand("BLACKLIST clear", "OK"); } +static jboolean android_net_wifi_setSuspendOptimizationsCommand(JNIEnv* env, jobject clazz, jboolean enabled) +{ + char cmdstr[25]; + + snprintf(cmdstr, sizeof(cmdstr), "DRIVER SETSUSPEND %d", enabled ? 0 : 1); + return doBooleanCommand(cmdstr, "OK"); +} + + static jboolean android_net_wifi_doDhcpRequest(JNIEnv* env, jobject clazz, jobject info) { jint ipaddr, gateway, mask, dns1, dns2, server, lease; @@ -571,6 +580,7 @@ static JNINativeMethod gWifiMethods[] = { { "setScanResultHandlingCommand", "(I)Z", (void*) android_net_wifi_setScanResultHandlingCommand }, { "addToBlacklistCommand", "(Ljava/lang/String;)Z", (void*) android_net_wifi_addToBlacklistCommand }, { "clearBlacklistCommand", "()Z", (void*) android_net_wifi_clearBlacklistCommand }, + { "setSuspendOptimizationsCommand", "(Z)Z", (void*) android_net_wifi_setSuspendOptimizationsCommand}, { "doDhcpRequest", "(Landroid/net/DhcpInfo;)Z", (void*) android_net_wifi_doDhcpRequest }, { "getDhcpError", "()Ljava/lang/String;", (void*) android_net_wifi_getDhcpError }, |