From 0ec199bf3868e91b0aad67414d9a659a1f5efd15 Mon Sep 17 00:00:00 2001 From: "K. Shankari" Date: Sun, 5 May 2024 11:55:52 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A9=20=F0=9F=94=A7=20Disable=20only=20?= =?UTF-8?q?the=20unused=20apps=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the previous commit, we had disabled all android background checks. This means that the optimization check would also be disabled, and we would not be able to start the foreground service from the background. Let's change this to only disable to unused apps check --- www/js/usePermissionStatus.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/www/js/usePermissionStatus.ts b/www/js/usePermissionStatus.ts index 5e136655f..8e81c8f5e 100644 --- a/www/js/usePermissionStatus.ts +++ b/www/js/usePermissionStatus.ts @@ -407,7 +407,11 @@ const usePermissionStatus = () => { refresh: checkBatteryOpt, }; let tempChecks = checkList; - tempChecks.push(unusedAppsUnrestrictedCheck, ignoreBatteryOptCheck); + if (appConfig.tracking?.bluetooth_only) { + tempChecks.push(ignoreBatteryOptCheck); + } else { + tempChecks.push(unusedAppsUnrestrictedCheck, ignoreBatteryOptCheck); + } setCheckList(tempChecks); } @@ -446,10 +450,9 @@ const usePermissionStatus = () => { setupAndroidFitnessChecks(); if (appConfig.tracking?.bluetooth_only) { setupAndroidBluetoothChecks(); - } else { - setupAndroidBackgroundRestrictionChecks(); } setupAndroidNotificationChecks(); + setupAndroidBackgroundRestrictionChecks(); } else if (window['device'].platform.toLowerCase() == 'ios') { setupIOSLocChecks(); setupIOSFitnessChecks();