Update to gradle version 8.2.2
Fixes #1883
This PR is [ready] for review.
Risk
This PR makes [no] 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
Unit Tests
Unit test were updated to work with API level 34 and new gradle version
Core Tests
Tested connecting Hello_SDL app to Sync 3
Core version / branch / commit hash / module tested against: Sync 3 HMI name / version / branch / commit hash / module tested against: Sync 3
Summary
This PR updates gradle version to 8.2.2 to work with API level 34, as well as updates Unit test and ci checks. I also updated som imports for unit testing.
android.yml:
Runs-on - changed from macOS-latest to macos-13. macOS-latest uses version 12 currently, version 13 gets one more core to work with which is helpful to run the new android emulator. They also have a beta of version 14 but only for m1 chips. So to prevent the possibility of macOS-latest of one day pointing at an m1 image, this will give us more longevity and help our checks run smoother on a more demanding android emulator.
arch: - arch defaults to x86, there are no android emulators above api level 30 that are just x86, so specifying x86_64 is now a requirement for them to work.
AudioStreamManagerTest:
We had test failing randomly when broadcast receiver were registered through some test specifying that the exported flag needed to be set, I discovered that some test in AudioStreamManagerTest were overwriting the Build.VERSION.SDK_INT to a lower api level for all test ran after, causing the exported flag to not get set.
Upon fixing this we had other issues with test for the IntegrationValidator, I had to add TestSdlReceiver to pass checks for the BroadcastRecevier.
WiFiSocketFactoryTest:
Some test were failing due to the fact that starting in API level 30 we can no longer use reflection to fake NetworkCapabilities. I added an api level check to bypass them. There is no good way to mock them as the class is final, I tried looking into mockito inline and Roboelectric but could not use them as they are unavailable in androidTestImplementation. There is dexmaker-mockito-inline that could be a possibility, but that would change how mockito is imported into the project and could affect other test.
MultiplexBluetoothTransportTest:
testStateTransitions had to be modified due to the new emulator actually starting the MultiplexBluetoothTransport, so to prevent incompatibility with older emulators I modified it to only check on actual devices
Other unit test issues: I had to add permissions to the manifest for our unit test as well as the queries section for the router service that is required in newer android versions
CLA
- [x] I have signed the CLA