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

Delay shutting down the TCP secondary transport when device app is backgrounded #1560

Closed
NicoleYarroch opened this issue Feb 20, 2020 · 0 comments
Assignees
Labels
best practice Not a defect but something that should be improved anyway transport-secondary Relating to the secondary transport
Projects

Comments

@NicoleYarroch
Copy link
Contributor

Bug Report

Due to the way iOS manages sockets, it is impossible to keep a socket alive when the app on the device is backgrounded or the device is locked with the app in the foreground. However, it is possible to create a background task when the app enters the background that will keep the socket alive for ~1 minute. This has two UX advantages:

  1. Improve user experience by avoiding a reconnect delay if the user backgrounds the app and then foregrounds the app within the time the background task is kept alive (~1 minute) (https://forums.developer.apple.com/thread/97824).
  2. Improve user experience by showing the videoStreamBackgroundString consistently when the app on the device is backgrounded. Currently, if the device locks while video is streaming, then the videoStreamBackgroundString is never shown due to the socket erroring right after the device locks. We can tell the developer to configure the app to not sleep while video is streaming but if the user locks the device then there is no indication why the SDL app closed.

We should try to close the socket when the background task expires, however the socket could still be reclaimed by the OS before then. This means we will need to make sure to handle all errors that might occur when the socket errors out.

Reproduction Steps
  1. Connect a video streaming app with secondary transports enabled to a head unit that supports secondary transports. Launch the SDL app if necessary and wait for video to start streaming.
  2. While the app on the device is foregrounded, lock the device screen.
Expected Behavior

The user should see the videoStreamBackgroundString before the socket is closed.

Observed Behavior

The video stream simply stops since the socket errors out.

OS & Version Information
  • iOS Version: 12 & 13
  • SDL iOS Version: 6.5
  • Testing Against: SYNC 4
@NicoleYarroch NicoleYarroch added best practice Not a defect but something that should be improved anyway transport-secondary Relating to the secondary transport labels Feb 20, 2020
@joeljfischer joeljfischer added this to To do in v6.6.0 Mar 18, 2020
@NicoleYarroch NicoleYarroch self-assigned this Apr 2, 2020
v6.6.0 automation moved this from To do to Done Apr 15, 2020
@joeljfischer joeljfischer mentioned this issue Apr 29, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
best practice Not a defect but something that should be improved anyway transport-secondary Relating to the secondary transport
Projects
No open projects
v6.6.0
  
Done
Development

No branches or pull requests

2 participants