mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 811635 - Part 5: Start wpa_supplicant with proper 'p2pSupported' flag. r=vchang
This commit is contained in:
parent
aa847df586
commit
b0b3f0901f
@ -5,6 +5,7 @@
|
||||
#include "WifiUtils.h"
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <cutils/properties.h>
|
||||
#include "prinit.h"
|
||||
#include "js/CharacterEncoding.h"
|
||||
#include "NetUtils.h"
|
||||
@ -34,6 +35,14 @@ GetSharedLibrary()
|
||||
return sWifiLib;
|
||||
}
|
||||
|
||||
static bool
|
||||
GetWifiP2pSupported()
|
||||
{
|
||||
char propP2pSupported[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.moz.wifi.p2p_supported", propP2pSupported, "0");
|
||||
return (0 == strcmp(propP2pSupported, "1"));
|
||||
}
|
||||
|
||||
// This is the same algorithm as in InflateUTF8StringToBuffer with Copy and
|
||||
// while ignoring invalids.
|
||||
// https://mxr.mozilla.org/mozilla-central/source/js/src/vm/CharacterEncoding.cpp#231
|
||||
@ -276,7 +285,7 @@ bool WpaSupplicant::ExecuteCommand(CommandOptions aOptions,
|
||||
} else if (aOptions.mCmd.EqualsLiteral("unload_driver")) {
|
||||
aResult.mStatus = mImpl->do_wifi_unload_driver();
|
||||
} else if (aOptions.mCmd.EqualsLiteral("start_supplicant")) {
|
||||
aResult.mStatus = mImpl->do_wifi_start_supplicant(0);
|
||||
aResult.mStatus = mImpl->do_wifi_start_supplicant(GetWifiP2pSupported() ? 1 : 0);
|
||||
} else if (aOptions.mCmd.EqualsLiteral("stop_supplicant")) {
|
||||
aResult.mStatus = mImpl->do_wifi_stop_supplicant();
|
||||
} else if (aOptions.mCmd.EqualsLiteral("connect_to_supplicant")) {
|
||||
|
Loading…
Reference in New Issue
Block a user