Skip to content

Commit

Permalink
fix wifi connectivity for newer devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull committed Nov 16, 2022
1 parent c0099ed commit d0a239f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "espero.jiofibatterynotifier"
minSdkVersion 17
targetSdkVersion 29
versionCode 8
versionName "1.8"
versionCode 9
versionName "1.9"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"properties": [],
"versionCode": 8,
"versionName": "1.8",
"versionCode": 9,
"versionName": "1.9",
"enabled": true,
"outputFile": "app-release.apk"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,16 @@ private boolean checkWifiOnAndConnected() {

if (wifiMgr.isWifiEnabled()) { // Wi-Fi adapter is ON

WifiInfo wifiInfo = wifiMgr.getConnectionInfo();

if (wifiInfo.getNetworkId() == -1) {
return false; // Not connected to an access point
}
// Disabling extra check of wifi connectivity because,
// newer version of devices always showing not connected,
// without location permission
// Bug: https://issuetracker.google.com/issues/136021574

// WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
//
// if (wifiInfo.getNetworkId() == -1) {
// return false; // Not connected to an access point
// }
return true; // Connected to an access point
} else {
return false; // Wi-Fi adapter is OFF
Expand Down

0 comments on commit d0a239f

Please sign in to comment.