SdlRouterService
change PendingIntents getForegroundService to getService
#1855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1854
This PR is [ready] for review.
Risk
This PR makes [minor] API changes.
Testing Plan
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