tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+

Home Page:https://www.npmjs.com/package/cordova-plugin-wifiwizard2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wifi is enabled after call isWifiEnable

seanyang1984 opened this issue · comments

Issue type

Select all that apply

  • Bug
  • Enhancement
  • Task
  • Question
  • Other

Description

I call isWifiEnabled to check whether wifi is enable, but after call it the wifi will be enabled.

public boolean execute(String action, JSONArray data, CallbackContext callbackContext)
throws JSONException {

boolean wifiIsEnabled = verifyWifiEnabled();

The function verifyWifiEnabled enable wifi.

I think this may be not suitable, because I just want check wifi status, but not change it

Steps to Reproduce

call isWifiEnabled when wifi is disable

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

Reproduces how often: [What percentage of the time does it reproduce?]

Versions

Please include the plugin version that you are using and also include the OS, version and device you are using.

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

boolean wifiIsEnabled = verifyWifiEnabled();     // move to here, is right?
if (!wifiIsEnabled) {
  callbackContext.error("WIFI_NOT_ENABLED");
  return true; // Even though enable wifi failed, we still return true and handle error in callback
}

@seanyang1984 yup you are correct! This should be moved below the android methods that do not require wifi to be enabled, will work on updating it soon

boolean wifiIsEnabled = verifyWifiEnabled();     // move to here, is right?
if (!wifiIsEnabled) {
  callbackContext.error("WIFI_NOT_ENABLED");
  return true; // Even though enable wifi failed, we still return true and handle error in callback
}

thx... is work
WifiWizard2.java line 148 move to line 198