Skip to content

Commit

Permalink
Refactoring - removed empty spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ViggoChavine committed Jun 12, 2020
1 parent ac1efbf commit f0fa119
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/android/wifiwizard2/WifiWizard2.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,11 @@ private boolean add(CallbackContext callbackContext, JSONArray data) {
}

// Set network to highest priority (deprecated in API >= 26)
if(API_VERSION < 26){
if(API_VERSION < 26) {
wifi.priority = getMaxWifiPriority(wifiManager) + 1;
}

if(API_VERSION >= 29){
if(API_VERSION >= 29) {
networkCallback = new ConnectivityManager.NetworkCallback() {
@Override
public void onAvailable(Network network) {
Expand All @@ -487,7 +487,7 @@ public void onAvailable(Network network) {
cm.requestNetwork(nr, this.networkCallback);
} else {
// After processing authentication types, add or update network
if (wifi.networkId == -1) { // -1 means SSID configuration does not exist yet
if(wifi.networkId == -1) { // -1 means SSID configuration does not exist yet

int newNetId = wifiManager.addNetwork(wifi);
if( newNetId > -1 ){
Expand All @@ -500,7 +500,7 @@ public void onAvailable(Network network) {

int updatedNetID = wifiManager.updateNetwork(wifi);

if(updatedNetID > -1){
if(updatedNetID > -1) {
callbackContext.success( updatedNetID );
} else {
callbackContext.error( "ERROR_UPDATING_NETWORK" );
Expand All @@ -510,7 +510,7 @@ public void onAvailable(Network network) {
}

// WifiManager configurations are presistent for API 26+
if (API_VERSION < 26) {
if(API_VERSION < 26) {
wifiManager.saveConfiguration(); // Call saveConfiguration for older < 26 API
}

Expand Down Expand Up @@ -557,16 +557,16 @@ private void enable(CallbackContext callbackContext, JSONArray data) {

try {

if (networkIdToEnable > -1) {
if(networkIdToEnable > -1) {

Log.d(TAG, "Valid networkIdToEnable: attempting connection");

// Bind all requests to WiFi network (only necessary for Lollipop+ - API 21+)
if( bindAll.equals("true") ){
if(bindAll.equals("true")) {
registerBindALL(networkIdToEnable);
}

if( wifiManager.enableNetwork(networkIdToEnable, true) ){
if(wifiManager.enableNetwork(networkIdToEnable, true)) {

if( waitForConnection.equals("true") ){
callbackContext.success("NETWORK_ENABLED");
Expand Down Expand Up @@ -848,12 +848,12 @@ private boolean disconnectNetwork(CallbackContext callbackContext, JSONArray dat
return false;
}

if( API_VERSION < 29){
if(API_VERSION < 29){
int networkIdToDisconnect = ssidToNetworkId(ssidToDisconnect);

if (networkIdToDisconnect > 0) {
if(networkIdToDisconnect > 0) {

if(wifiManager.disableNetwork(networkIdToDisconnect)){
if(wifiManager.disableNetwork(networkIdToDisconnect)) {

maybeResetBindALL();

Expand Down

0 comments on commit f0fa119

Please sign in to comment.