Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect whether the system has restricted background work for the app #1211

Merged

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Mar 25, 2021

Goal

Collects whether the system has restricted background work for the app, as reported by isBackgroundRestricted(), which is available on Android 9+.

This is useful information as some users do enable battery optimizations that throttle the amount of work an app can do in the background. For example, scheduled services and alarms may not execute. It seems probable that this could lead to bugs in some apps so this would be useful information to collect.

Screenshot 2021-03-25 at 12 08 24

Changeset

  • Added backgroundWorkRestricted to the app metadata (only when restrictions are enabled, otherwise the field is not added)
  • Added unit tests to confirm the functionality works as expected

@fractalwrench fractalwrench changed the title feat: collect isBackgroundRestricted for error reports Collect whether the system has restricted background work for the app Mar 25, 2021
@fractalwrench fractalwrench force-pushed the PLAT-3496/work-restrictions branch 2 times, most recently from 5dd6fa4 to 88429c2 Compare March 25, 2021 12:38
@fractalwrench fractalwrench force-pushed the PLAT-3496/work-restrictions branch from 88429c2 to 81093e7 Compare March 25, 2021 12:59
@fractalwrench fractalwrench marked this pull request as ready for review March 25, 2021 13:48
Copy link
Contributor

@twometresteve twometresteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fractalwrench fractalwrench merged commit 2a26e1d into integration/road-1075-android-11 Mar 26, 2021
@fractalwrench fractalwrench deleted the PLAT-3496/work-restrictions branch March 26, 2021 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants