summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--service/Android.mk8
-rw-r--r--service/java/com/android/server/wifi/WifiNative.java12
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java3
-rw-r--r--service/jni/com_android_server_wifi_WifiNative.cpp27
4 files changed, 46 insertions, 4 deletions
diff --git a/service/Android.mk b/service/Android.mk
index 779b5c2f1..b20d099d9 100644
--- a/service/Android.mk
+++ b/service/Android.mk
@@ -45,9 +45,13 @@ LIB_WIFI_HAL := libwifi-hal
ifeq ($(BOARD_WLAN_DEVICE), bcmdhd)
LIB_WIFI_HAL := libwifi-hal-bcm
else ifeq ($(BOARD_WLAN_DEVICE), qcwcn)
- LIB_WIFI_HAL := libwifi-hal-qcom
+ # this is commented because none of the nexus devices
+ # that sport Qualcomm's wifi have support for HAL
+ # LIB_WIFI_HAL := libwifi-hal-qcom
else ifeq ($(BOARD_WLAN_DEVICE), mrvl)
- LIB_WIFI_HAL := libwifi-hal-mrvl
+ # this is commented because none of the nexus devices
+ # that sport Marvell's wifi have support for HAL
+ # LIB_WIFI_HAL := libwifi-hal-mrvl
endif
# Build the HalUtil
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
index 668f2a20e..f52ccd5ef 100644
--- a/service/java/com/android/server/wifi/WifiNative.java
+++ b/service/java/com/android/server/wifi/WifiNative.java
@@ -1551,4 +1551,16 @@ public class WifiNative {
}
}
}
+
+ private static native boolean setScanningMacOuiNative(int iface, byte[] oui);
+
+ synchronized public static boolean setScanningMacOui(byte[] oui) {
+ synchronized (mLock) {
+ if (startHal()) {
+ return setScanningMacOuiNative(sWlan0Index, oui);
+ } else {
+ return false;
+ }
+ }
+ }
}
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 30b42af21..73a236305 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -128,6 +128,8 @@ public class WifiStateMachine extends StateMachine {
private static final int ONE_HOUR_MILLI = 1000 * 60 * 60;
+ private static final byte[] GOOGLE_OUI = new byte[] { 0x00, 0x1A, 0x11};
+
/* temporary debug flag - best network selection development */
private static boolean PDBG = false;
@@ -4251,6 +4253,7 @@ public class WifiStateMachine extends StateMachine {
mWifiNative.setScanInterval((int)mSupplicantScanIntervalMs / 1000);
mWifiNative.setExternalSim(true);
+ mWifiNative.setScanningMacOui(GOOGLE_OUI);
if (mFrameworkAutoJoin.get()) {
mWifiNative.enableAutoConnect(false);
diff --git a/service/jni/com_android_server_wifi_WifiNative.cpp b/service/jni/com_android_server_wifi_WifiNative.cpp
index 50b7273a1..7073e9e15 100644
--- a/service/jni/com_android_server_wifi_WifiNative.cpp
+++ b/service/jni/com_android_server_wifi_WifiNative.cpp
@@ -958,7 +958,7 @@ static jboolean android_net_wifi_requestRange(
}
static jboolean android_net_wifi_cancelRange(
- JNIEnv *env, jclass cls, jint iface, int id, jobject params) {
+ JNIEnv *env, jclass cls, jint iface, jint id, jobject params) {
wifi_interface_handle handle = getIfaceHandle(env, cls, iface);
ALOGD("cancelling rtt request [%d] = %p", id, handle);
@@ -985,6 +985,28 @@ static jboolean android_net_wifi_cancelRange(
return wifi_rtt_range_cancel(id, handle, len, addrs) == WIFI_SUCCESS;
}
+static jboolean android_net_wifi_setScanningMacOui(JNIEnv *env, jclass cls,
+ jint iface, jbyteArray param) {
+
+ wifi_interface_handle handle = getIfaceHandle(env, cls, iface);
+ ALOGD("setting scan oui %p", handle);
+
+ static const unsigned oui_len = 3; /* OUI is upper 3 bytes of mac_address */
+ int len = env->GetArrayLength(param);
+ if (len != oui_len) {
+ ALOGE("invalid oui length %d", len);
+ return false;
+ }
+
+ jbyte* bytes = env->GetByteArrayElements(param, NULL);
+ if (bytes == NULL) {
+ ALOGE("failed to get array");
+ return false;
+ }
+
+ return wifi_set_scanning_mac_oui(handle, (byte *)bytes) == WIFI_SUCCESS;
+}
+
// ----------------------------------------------------------------------------
/*
@@ -1032,7 +1054,8 @@ static JNINativeMethod gWifiMethods[] = {
{ "requestRangeNative", "(II[Landroid/net/wifi/RttManager$RttParams;)Z",
(void*) android_net_wifi_requestRange},
{ "cancelRangeRequestNative", "(II[Landroid/net/wifi/RttManager$RttParams;)Z",
- (void*) android_net_wifi_cancelRange}
+ (void*) android_net_wifi_cancelRange},
+ { "setScanningMacOuiNative", "(I[B)Z", (void*) android_net_wifi_setScanningMacOui}
};
int register_android_net_wifi_WifiNative(JNIEnv* env) {