From ca208b592ebb63301152cf172148b3d9fd86617a Mon Sep 17 00:00:00 2001 From: Shankari Date: Mon, 7 Oct 2024 13:20:27 -0700 Subject: [PATCH] Single-line changes to remove notification checks in the background checker As part of https://github.com/e-mission/e-mission-docs/issues/1094, we made the notification permission optional. Since it is not required for silent push notifications, notifications are nice-to-have. They are still helpful to ensure that people know if there are issues, and hopefully help them label their trips, but the app will still work if the permission is turned off. Since this is no longer required for normal operation, we don't need to check it in the background every hour, and nag the user to fix it if it is turned off. This is a super-easy change (two lines), so rolling this in while fixing https://github.com/e-mission/e-mission-docs/issues/1094 instead of coming in as a future fix. Testing done: - Replaced the data collection plugin with the most recent version - Code compiles - Wasn't able to test in the emulator since with the permission turned off, without https://github.com/e-mission/e-mission-phone/pull/1182 in place, we got a prompt to fix the notification, so we couldn't simulate a remote push Pushing this and testing all the changes together --- src/android/verification/SensorControlBackgroundChecker.java | 1 - src/ios/Verification/SensorControlBackgroundChecker.m | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/android/verification/SensorControlBackgroundChecker.java b/src/android/verification/SensorControlBackgroundChecker.java index 22007fe..b2f841a 100644 --- a/src/android/verification/SensorControlBackgroundChecker.java +++ b/src/android/verification/SensorControlBackgroundChecker.java @@ -107,7 +107,6 @@ public static void checkAppState(final Context ctxt) { SensorControlChecks.checkLocationPermissions(ctxt), SensorControlChecks.checkIgnoreBatteryOptimizations(ctxt), SensorControlChecks.checkMotionActivityPermissions(ctxt), - SensorControlChecks.checkNotificationsEnabled(ctxt), }; boolean allOtherChecksPass = true; for (boolean check: allOtherChecks) { diff --git a/src/ios/Verification/SensorControlBackgroundChecker.m b/src/ios/Verification/SensorControlBackgroundChecker.m index 8c36e50..c3761af 100644 --- a/src/ios/Verification/SensorControlBackgroundChecker.m +++ b/src/ios/Verification/SensorControlBackgroundChecker.m @@ -47,8 +47,7 @@ +(void)checkAppState @([TripDiarySensorControlChecks checkLocationSettings]), @([TripDiarySensorControlChecks checkLocationPermissions]), @([TripDiarySensorControlChecks checkMotionActivitySettings]), - @([TripDiarySensorControlChecks checkMotionActivityPermissions]), - @([TripDiarySensorControlChecks checkNotificationsEnabled]) + @([TripDiarySensorControlChecks checkMotionActivityPermissions]) ]; BOOL allChecksPass = TRUE; for (NSNumber* check in allChecks) {