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 #1911

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
Copy link
Contributor

@kmicha19-ford Is this a duplicate of #1906?

@kmicha19-ford
Copy link
Author

kmicha19-ford commented Feb 4, 2021 via email

@joeljfischer joeljfischer changed the title Issue 799 prevent incorrect background processing Prevent incorrect background processing Feb 8, 2021
@joeljfischer joeljfischer added bug A defect in the library manager-lifecycle Relating to the manager layer - lifecycle manager labels Feb 8, 2021
@joeljfischer joeljfischer added this to In progress in v7.1.0 via automation Feb 8, 2021
@NicoleYarroch
Copy link
Contributor

@kmicha19-ford I have reviewed this PR and I have not found any issues. I just wanted to hold off on making a review until I got a chance to test with the approved PR #1910 since you mentioned in the PR description that this PR is to be used in conjunction with PR #1910.

@kmicha19-ford
Copy link
Author

Great. Let me know how I can help. This is my highest priority now, now that my iMac is back up and running. Yes!

v7.1.0 automation moved this from In progress to Reviewer approved Feb 24, 2021
v7.1.0 automation moved this from Reviewer approved to Done Mar 15, 2021
@joeljfischer joeljfischer reopened this Mar 15, 2021
v7.1.0 automation moved this from Done to In progress Mar 15, 2021
@joeljfischer joeljfischer merged commit 9485388 into smartdevicelink:develop Mar 15, 2021
v7.1.0 automation moved this from In progress to Done Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library manager-lifecycle Relating to the manager layer - lifecycle manager
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants