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

Prevent incorrect background processing #1909

Conversation

kmicha19-ford
Copy link

Fixes #1799 (when used in conjunction with EASession left open PR #kmicha19-ford#1)

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR (or explain why below)
  • I have tested this PR against Core and verified behavior.

Unit Tests

  • Does not affect any unit tests.

Core Tests

  • Built the Obj-C example app and verified that all interactions work
    • iAP disconnect / reconnect
    • LockScreen on/off rapidly
  • Built the Swift example app and verified that all interactions work
    • iAP disconnect / reconnect
    • LockScreen on/off rapidly

Summary

This fixes the bug where an app could run on and on unnecessarily even when backgrounded and disconnected.

Changelog

Breaking Changes
  • None
Enhancements
  • SDLifeCycleManager no longer uses the SDLBackgroundTaskManager.
  • SDLBackgroundTaskManager uses the iOS instance method beginBackgroundTask(withName taskName: String?,
    expirationHandler handler: (() -> Void)? = nil) -> UIBackgroundTaskIdentifier
  • beginBackgroundTask is for requesting additional processing time when an app is backgrounded and before being suspended so an app can finish tasks, such as saving data, before being suspended. This method is not meant to keep an app running in the background. After 30 seconds iOS may or may not terminate the app
  • Using beginBackgroundTask in this manner may conflict with EAAccessory Connect / Disconnect app management and keep the app running in the background when it should be suspended. This may cause undo battery drain.
  • It should be noted that SDLSecondaryTransportManager correctly uses SDLBackgroundTaskManager.

Tasks Remaining:

  • None

CLA

@joeljfischer joeljfischer changed the title Issue 799 prevent incorrect background processing Prevent incorrect background processing Feb 3, 2021
@joeljfischer
Copy link
Contributor

@makinney I apologize for not noticing earlier, but is this a duplicate of #1906? Is an additional PR intended to be submitted sometime soon as well?

@kmicha19-ford
Copy link
Author

will recreate

@kmicha19-ford
Copy link
Author

kmicha19-ford commented Feb 4, 2021 via email

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.

None yet

3 participants