commit | 062a14e86083c394211ca6e03ce0453d40b31c59 | [log] [tgz] |
---|---|---|
author | Andrew Cheng <chengandrew@google.com> | Fri Feb 03 16:21:53 2023 -0800 |
committer | Andrew Cheng <chengandrew@google.com> | Tue Feb 07 11:29:52 2023 -0800 |
tree | f032a57996a62ec9fa282e7406541905bea21810 | |
parent | bc612574e2df976dcc9ad22d988c55a01111c39e [diff] |
Clear inline mocks at the end of individual Bluetooth tests When using inline mock maker, clean up inline mocks to prevent OutOfMemory errors. See https://github.com/mockito/mockito/issues/1614. See also b/259280359. Ideally, inline mocks are cleared after each individual test instead of the test class, but Bluetooth unit tests crashed when attempting to clear inline mocks in the @After method, so ag/20652385 resorted to clearing them in an @AfterClass method. This CL uses Rules instead to clear inline mocks after each individual test. It takes inspiration from https://github.com/mockito/mockito/issues/1902, in particular: "JUnit runs @Before after each rule, and @After before each rule. In this particular case clearInlineMocks() removed internal handlers of all inline mocks, but MockitoJUnit rule still needs to use them... The solution is to wrap clearInlineMocks() in a TestRule as well, and..." and enforce the ordering. Test: atest CarServiceUnitTest -- --exclude-filter \ '"CarServiceUnitTest com.android.car.bluetooth.FastPairProviderTest"' Bug: 261644033 Bug: 261724684 Bug: 261727445 Change-Id: I6f8257fb9aac3c802c0b08b563165860e54f1a4a
Source code for Android Automotive OS.
car_product/ - AAOS product car-builtin-lib/ - A helper library for CarService to access hidden framework APIs car-lib/ - Car API car-lib-module/ - Car API module cpp/ - Native services experimental/ - Experimental Car API and services packages/ - Apps and services for cars service/ - Car service module service-builint - Platform builtin component that runs CarService module tests/ - Tests and sample apps tools/ - Helper scripts
Native (C++) code format is required to be compatible with .clang-format file. The formatter is already integrated to repo
tool. To run manually, use:
git clang-format --style=file --extension='h,cpp,cc' HEAD~
Note that clang-format is not desirable for Android java files. Therefore the command line above is limited to specific extensions.
Dumpsys and car shell can be useful when debugging CarService integration issues.
adb shell dumpsys car_service # to dump all car service information adb shell dumpsys car_service --services [service name] # to dump a specific service information adb shell dumpsys car_service --list # get list of available services
Dumpsys for CarService includes the following (more information is availble in dumpsys, below are just highlights):
adb shell cmd car_service
CarService supports commands via car shell:
(list is not complete, run adb shell cmd car_service -h for more details)
Start Garage mode
adb shell cmd car_service garage-mode on
Finish Garage mode
adb shell cmd car_service garage-mode on
Get Garage mode status
adb shell cmd car_service garage-mode query
Change Garage mode max duration (only eng and debug builds)
adb shell setprop android.car.garagemodeduration <seconds>