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

SdlRouterService change PendingIntents getForegroundService to getService #1855

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

JulianKast
Copy link
Contributor

@JulianKast JulianKast commented Jun 23, 2023

Fixes #1854

This PR is [ready] for review.

Risk

This PR makes [minor] API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR (or explain why below)
  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified behavior (if applicable, if not applicable, explain why below).
  • I have tested Android

Core Tests

Test with Android 13:
Test 2 apps Hello SDL and BTA from the PlayStore
Force kill both apps after accepting permissions
Both apps connect just fine.
wait 10 minutes.
Observe
Apps stay connected via Hello SDL's RouterService

Tested via Sync 3 and 4

Test with Android 14 with all Android 14 PR's on an integration branch
Install App A
Put app A in Foreground
Connect to TDK via Bluetooth
Observe: App A connects
Install App B
Observe App B connects to App A RouterService
Disconnect Bluetooth
Restart Phone
Connect Bluetooth
Observe:
Both apps connect.

Tested via Sync 3

Summary

This PR changes how SdlService is started from the RS via a Pending Intent from getForegroundService to getService.

We can make this change because the RS is already in the Foreground at this point, we still need SdlService to enter the foreground as Android will still shut down the service after a time if the app is not in the Foreground. |

This will help with the issue of the RemoteServiceException$ForegroundServiceDidNotStartInTimeException that has been seen in SDL apps that are not able to enter the foreground in the 5-second time allotment by Android if a phone is to slow or bogged down.

CLA

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