From d0a239fb16f4d6157c8ac024e9359e5a9acd9017 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Thu, 17 Nov 2022 01:32:18 +0530 Subject: [PATCH] fix wifi connectivity for newer devices https://issuetracker.google.com/issues/136021574 --- app/build.gradle | 4 ++-- app/release/output-metadata.json | 4 ++-- .../Services/JioFiService.java | 15 ++++++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 82d191b..54e0a66 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" } diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index b48255c..d425362 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "properties": [], - "versionCode": 8, - "versionName": "1.8", + "versionCode": 9, + "versionName": "1.9", "enabled": true, "outputFile": "app-release.apk" } diff --git a/app/src/main/java/espero/jiofibatterynotifier/Services/JioFiService.java b/app/src/main/java/espero/jiofibatterynotifier/Services/JioFiService.java index bc0c87f..84f22e6 100644 --- a/app/src/main/java/espero/jiofibatterynotifier/Services/JioFiService.java +++ b/app/src/main/java/espero/jiofibatterynotifier/Services/JioFiService.java @@ -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