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

Issue 799 prevent incorrect background processing #2

Closed

Conversation

kmicha19-ford
Copy link
Owner

@kmicha19-ford kmicha19-ford commented Jan 29, 2021

Fixes smartdevicelink#1799 (when used in conjunction with EASession left open PR ##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

@kmicha19-ford
Copy link
Owner Author

Will recreate

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.

High CPU usage in Energy Organizer, iOS 14+
2 participants