Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f42c39b3 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Use seperate config file for p2p

Keep p2p and sta config seperate to avoid conflicts.

Bug: 5002384
Change-Id: I8f8fc5f984f4f91f9ece4012bf536daa5cc00bba
parent 859e7de2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -124,6 +124,11 @@ static jboolean android_net_wifi_startSupplicant(JNIEnv* env, jobject)
    return (jboolean)(::wifi_start_supplicant() == 0);
}

static jboolean android_net_wifi_startP2pSupplicant(JNIEnv* env, jobject)
{
    return (jboolean)(::wifi_start_p2p_supplicant() == 0);
}

static jboolean android_net_wifi_stopSupplicant(JNIEnv* env, jobject)
{
    return doBooleanCommand("OK", "TERMINATE");
@@ -581,6 +586,7 @@ static JNINativeMethod gWifiMethods[] = {
    { "isDriverLoaded", "()Z",  (void *)android_net_wifi_isDriverLoaded},
    { "unloadDriver", "()Z",  (void *)android_net_wifi_unloadDriver },
    { "startSupplicant", "()Z",  (void *)android_net_wifi_startSupplicant },
    { "startP2pSupplicant", "()Z",  (void *)android_net_wifi_startP2pSupplicant },
    { "stopSupplicant", "()Z", (void*) android_net_wifi_stopSupplicant },
    { "killSupplicant", "()Z",  (void *)android_net_wifi_killSupplicant },
    { "connectToSupplicant", "()Z",  (void *)android_net_wifi_connectToSupplicant },
+3 −1
Original line number Diff line number Diff line
@@ -60,7 +60,9 @@ public class WifiNative {

    public native static boolean startSupplicant();

    /* Does a graceful shutdown of supplicant.
    public native static boolean startP2pSupplicant();

    /* Does a graceful shutdown of supplicant. Is a common stop function for both p2p and sta.
     *
     * Note that underneath we use a harsh-sounding "terminate" supplicant command
     * for a graceful stop and a mild-sounding "stop" interface
+1 −1
Original line number Diff line number Diff line
@@ -514,7 +514,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
                        if (DBG) Slog.w(TAG, "Unable to bring down wlan interface: " + e);
                    }

                    if (WifiNative.startSupplicant()) {
                    if (WifiNative.startP2pSupplicant()) {
                        mWifiMonitor.startMonitoring();
                        transitionTo(mP2pEnablingState);
                    } else {