Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RMET-3191 H&F Plugin - Use sensors for background jobs (Activity Reco…
…gnition Transition API) (#111) * feat: include necessary permissions for API 28 and below Context: To use the Activity Recognition Transition API, we need to include this permission for API 28 (Android 9), and below. More info here: https://developer.android.com/codelabs/activity-recognition-transition#2 References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * feat: declare SCHEDULE_EXACT_ALARM permission in manifest Context: We're using exact alarms to schedule background jobs to run, so we need to declare this permission in the AndroidManifest.xml file of the app. References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * feat: request SCHEDULE_EXACT_ALARM permission when setting background job References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * feat: handle SCHEDULE_EXACT_ALARM permission not being given when setting a background job Context: As for the time being the only way we have to set background jobs to run is using exact alarms, if the permission is not given, then we should return an error. References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * feat: ask for SCHEDULE_EXACT_ALARM permission before other ones References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * feat: get foreground notification info from strings.xml file References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * feat: replace workManager with alarmManager Context: We're now using exact alarms for background jobs, so we need to use the AlarmManager. References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * feat: pass context parameter to AdvancedQuery, as it is needed References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * chore: update dependency to H&F Android library References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * chore: update dependency to H&F Android lib References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * chore: add explanatory comment References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * chore: update changelog References: https://outsystemsrd.atlassian.net/browse/RMET-3190 * feat: only request SCHEDULE_EXACT_ALARM permission if variable requires it Context: We only need the SCHEDULE_EXACT_ALARM permission if we want to use an exact alarm to setup the background job, and we only want to do that for variables that are not activity related (e.g. STEPS), since for those we can use the Activity Recognition Transition API instead, avoiding requesting a somewhat odd permission. References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * fix: properly check if SCHEDULE_EXACT_ALARM permission is necessary References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * refactor: remove unnecessary semicolon References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * feat: use ActivityTransitionHelper from Android library References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * chore: update dependency to H&F Android library References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * feat: include play-services-services-location dependency through Gralde References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * chore: remove unnecessary gradle dependency References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * chore: update changelog References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * chore: update dependency to H&F Android lib References: https://outsystemsrd.atlassian.net/browse/RMET-3191 * chore: update dependency to H&F Android library References: https://outsystemsrd.atlassian.net/browse/RMET-3191
- Loading branch information