Skip to content

Commit d0a239f

Browse files
committed
fix wifi connectivity for newer devices
https://issuetracker.google.com/issues/136021574
1 parent c0099ed commit d0a239f

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "espero.jiofibatterynotifier"
99
minSdkVersion 17
1010
targetSdkVersion 29
11-
versionCode 8
12-
versionName "1.8"
11+
versionCode 9
12+
versionName "1.9"
1313

1414
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1515
}

app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"properties": [],
14-
"versionCode": 8,
15-
"versionName": "1.8",
14+
"versionCode": 9,
15+
"versionName": "1.9",
1616
"enabled": true,
1717
"outputFile": "app-release.apk"
1818
}

app/src/main/java/espero/jiofibatterynotifier/Services/JioFiService.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,16 @@ private boolean checkWifiOnAndConnected() {
158158

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

161-
WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
162-
163-
if (wifiInfo.getNetworkId() == -1) {
164-
return false; // Not connected to an access point
165-
}
161+
// Disabling extra check of wifi connectivity because,
162+
// newer version of devices always showing not connected,
163+
// without location permission
164+
// Bug: https://issuetracker.google.com/issues/136021574
165+
166+
// WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
167+
//
168+
// if (wifiInfo.getNetworkId() == -1) {
169+
// return false; // Not connected to an access point
170+
// }
166171
return true; // Connected to an access point
167172
} else {
168173
return false; // Wi-Fi adapter is OFF

0 commit comments

Comments
 (0)