From 59f36e92c8f694c1215dd6e4ddcf95782a8783b9 Mon Sep 17 00:00:00 2001 From: Christopher Wiley Date: Fri, 17 Jun 2016 13:08:47 -0700 Subject: Make wifi.c code a little more C++ Compile functionality as C++. Put everything in namespaces. Remove string #defines from the header. Reorder public function definitions to match the header. Bug: 29418225 Test: Compiles Change-Id: I5461f5cfe0db24e338c24489df511eea2257dc39 --- service/jni/com_android_server_wifi_WifiNative.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'service/jni') diff --git a/service/jni/com_android_server_wifi_WifiNative.cpp b/service/jni/com_android_server_wifi_WifiNative.cpp index 9489d9429..f75fd9948 100644 --- a/service/jni/com_android_server_wifi_WifiNative.cpp +++ b/service/jni/com_android_server_wifi_WifiNative.cpp @@ -65,7 +65,7 @@ static bool doCommand(JNIEnv* env, jstring javaCommand, } --reply_len; // Ensure we have room to add NUL termination. - if (::wifi_command(command.c_str(), reply, &reply_len) != 0) { + if (wifi_system::wifi_command(command.c_str(), reply, &reply_len) != 0) { return false; } @@ -125,28 +125,28 @@ static jboolean android_net_wifi_unloadDriver(JNIEnv* env, jclass) static jboolean android_net_wifi_startSupplicant(JNIEnv* env, jclass, jboolean p2pSupported) { - return (::wifi_start_supplicant(p2pSupported) == 0); + return (wifi_system::wifi_start_supplicant(p2pSupported) == 0); } static jboolean android_net_wifi_killSupplicant(JNIEnv* env, jclass, jboolean p2pSupported) { - return (::wifi_stop_supplicant(p2pSupported) == 0); + return (wifi_system::wifi_stop_supplicant(p2pSupported) == 0); } static jboolean android_net_wifi_connectToSupplicant(JNIEnv* env, jclass) { - return (::wifi_connect_to_supplicant() == 0); + return (wifi_system::wifi_connect_to_supplicant() == 0); } static void android_net_wifi_closeSupplicantConnection(JNIEnv* env, jclass) { - ::wifi_close_supplicant_connection(); + wifi_system::wifi_close_supplicant_connection(); } static jstring android_net_wifi_waitForEvent(JNIEnv* env, jclass) { char buf[EVENT_BUF_SIZE]; - int nread = ::wifi_wait_for_event(buf, sizeof buf); + int nread = wifi_system::wifi_wait_for_event(buf, sizeof buf); if (nread > 0) { return env->NewStringUTF(buf); } else { -- cgit v1.2.3