Skip to content

Commit

Permalink
clean up for release
Browse files Browse the repository at this point in the history
  • Loading branch information
finleyChen committed Jul 5, 2017
1 parent 833b1f5 commit 9045b71
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public static boolean isWifiConnected(UQI uqi) {
WifiManager wifiManager = (WifiManager) uqi.getContext().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (wifiManager == null || !wifiManager.isWifiEnabled()) return false;
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
if (wifiInfo == null || wifiInfo.getNetworkId() == -1) return false;
return wifiInfo.getSupplicantState() == SupplicantState.ASSOCIATED;
return !(wifiInfo == null || wifiInfo.getNetworkId() == -1) && wifiInfo.getSupplicantState() == SupplicantState.ASSOCIATED;
}

/* Checks whether the device currently has a network connection.
Expand Down

0 comments on commit 9045b71

Please sign in to comment.