`SdlRouterService` change PendingIntents getForegroundService to getService
Fixes #1854
This PR is [ready] for review.
Risk
This PR makes [minor] API changes.
Testing Plan
- [x] I have verified that I have not introduced new warnings in this PR (or explain why below)
- [x] I have run the unit tests with this PR
- [x] I have tested this PR against Core and verified behavior (if applicable, if not applicable, explain why below).
- [x] 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
- [x] I have signed the CLA