From 00a4d95e6105a1ffaf6da9426bb0c143cf6f8d9f Mon Sep 17 00:00:00 2001 From: "K. Shankari" Date: Sun, 5 May 2024 10:34:42 -0700 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=92=A9=20Turn=20off=20the=20backgroun?= =?UTF-8?q?d=20checks=20for=20fleet=20deployments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the fleet deployments are installed on work phones, and the background restriction is apparently grayed out on android work phones. https://github.com/e-mission/e-mission-docs/issues/1070 This is a hack (hence the 💩 emoji) but it will allow us to make progress through the onboarding, get the logs and then resolve the issue the right way. Or if we can't figure out how to access it the right way, this can become a config option for deployments that plan to use work phones. This should unblock https://github.com/e-mission/e-mission-docs/issues/1070#issuecomment-2094354832 --- www/js/usePermissionStatus.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/js/usePermissionStatus.ts b/www/js/usePermissionStatus.ts index f8fef085b..5e136655f 100644 --- a/www/js/usePermissionStatus.ts +++ b/www/js/usePermissionStatus.ts @@ -446,9 +446,10 @@ const usePermissionStatus = () => { setupAndroidFitnessChecks(); if (appConfig.tracking?.bluetooth_only) { setupAndroidBluetoothChecks(); + } else { + setupAndroidBackgroundRestrictionChecks(); } setupAndroidNotificationChecks(); - setupAndroidBackgroundRestrictionChecks(); } else if (window['device'].platform.toLowerCase() == 'ios') { setupIOSLocChecks(); setupIOSFitnessChecks(); From 9921c52b7c8ccd6848cc9072bbc210ff3b876764 Mon Sep 17 00:00:00 2001 From: "K. Shankari" Date: Sun, 5 May 2024 11:55:52 -0700 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=92=A9=20=F0=9F=94=A7=20Disable=20onl?= =?UTF-8?q?y=20the=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..81c4abf54 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();