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

Fix inForeground value for reports which launch and crash without coming to the foreground #415

Merged
merged 3 commits into from
Oct 3, 2019

Conversation

kattrali
Copy link
Contributor

@kattrali kattrali commented Oct 1, 2019

When an app launches due to a background event but then crashes without ever coming to the foreground, the inForeground value is presumed to be true, a default which made sense back before background launches were possible or common. This change refactors the foreground state logic in the OutOfMemoryWatchdog to be available to the initialization process, capturing the correct initial value.

Tests

I couldn't find a way to force a background launch via an event anymore in the simulator (though there is a "Simulate Background Fetch" debug option that doesn't seem to launch an app if it isn't already running). So manual testing covered it by using media controls to launch a player app which then crashed and showed the correct foreground state

@kattrali kattrali merged commit 19f135d into master Oct 3, 2019
@kattrali kattrali deleted the kattrali/fix-fg-detection-after-bg-launch branch October 3, 2019 12:33
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.

1 participant