diff options
author | Irfan Sheriff <isheriff@google.com> | 2010-06-11 15:11:54 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2010-06-11 15:14:29 -0700 |
commit | 0631c608b0997efe5c0bd8e8955e65f1a7b3f32c (patch) | |
tree | ecae35e88e882af70d5101abe79dd3f1b7fbf32c /core | |
parent | 07d814075583230e92f79d52845ecc3fa36df0fd (diff) | |
parent | fdedc522993ccbde6ba95b519ac81e32449959c8 (diff) | |
download | frameworks_base-0631c608b0997efe5c0bd8e8955e65f1a7b3f32c.zip frameworks_base-0631c608b0997efe5c0bd8e8955e65f1a7b3f32c.tar.gz frameworks_base-0631c608b0997efe5c0bd8e8955e65f1a7b3f32c.tar.bz2 |
merge from open-source master
Change-Id: I8a950276787e9439420db396d0e32f88bd6e04cc
Diffstat (limited to 'core')
-rw-r--r-- | core/jni/android_net_wifi_Wifi.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp index 46000c9..7392442 100644 --- a/core/jni/android_net_wifi_Wifi.cpp +++ b/core/jni/android_net_wifi_Wifi.cpp @@ -392,6 +392,20 @@ static jboolean android_net_wifi_setPowerModeCommand(JNIEnv* env, jobject clazz, return (jboolean)!cmdTooLong && doBooleanCommand(cmdstr, "OK"); } +static jint android_net_wifi_getPowerModeCommand(JNIEnv* env, jobject clazz) +{ + char reply[256]; + int power; + + if (doCommand("DRIVER GETPOWER", reply, sizeof(reply)) != 0) { + return (jint)-1; + } + // reply comes back in the form "powermode = XX" where XX is the + // number we're interested in. + sscanf(reply, "%*s = %u", &power); + return (jint)power; +} + static jboolean android_net_wifi_setNumAllowedChannelsCommand(JNIEnv* env, jobject clazz, jint numChannels) { char cmdstr[256]; @@ -540,6 +554,7 @@ static JNINativeMethod gWifiMethods[] = { { "startPacketFiltering", "()Z", (void*) android_net_wifi_startPacketFiltering }, { "stopPacketFiltering", "()Z", (void*) android_net_wifi_stopPacketFiltering }, { "setPowerModeCommand", "(I)Z", (void*) android_net_wifi_setPowerModeCommand }, + { "getPowerModeCommand", "()I", (void*) android_net_wifi_getPowerModeCommand }, { "setNumAllowedChannelsCommand", "(I)Z", (void*) android_net_wifi_setNumAllowedChannelsCommand }, { "getNumAllowedChannelsCommand", "()I", (void*) android_net_wifi_getNumAllowedChannelsCommand }, { "setBluetoothCoexistenceModeCommand", "(I)Z", |