- Do not use streamType to decide which active device should return. Base on b/80453878 comment#6, the steamType intent will only be sent if an action is made on stream volume or a media route is changed: For instance when a call to setStreamVolume() or getDeviceForStream() is made. It is not broadcast on actual routing changes. It should not be used as an indicator that the route changed during a call. There is no callback API and the only option is polling with getDeviceForStream(). - Use corresponding profile to get active bluetooth device instead of streamType - Add test to verify the result of findActiveDevice() eg: 1. A2dp device active, hearing aid device not active : return a2dp device 2. A2dp device not active, hearing aid device not active : return null 3. hfp device active, hearing aid device not active : return hfp device 4. hfp device not active, hearing aid device not active : return null Bug: 80453878 Test: make -j42 RunSettingsRoboTests Change-Id: I5bd94899a5d508e60ce911da9689b727ad1fc20c
Running Settings Robolectric tests
The full suite
$ croot
$ make RunSettingsRoboTests
Running a single test class
$ croot
$ make RunSettingsRoboTests ROBOTEST_FILTER=<ClassName>
For example:
make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
You can also use partial class name in ROBOTEST_FILTER. If the partial class name matches multiple file names, all of them will be executed.