Root Cause: Only setMicrophonePreferredForCalls and show UI to current device, but audioManager might hold other device in the same set Solution: setMicrophonePreferredForCalls to whole device set and also check if any address in device set contain in audioManager GET_DEVICES_INPUTS list Bug: 392902067 Test: atest BluetoothDetailsHearingDeviceInputRoutingControllerTest Flag: EXEMPT bugfix Change-Id: Ic5846de26df4a8db67fa8efcf474fa4509f7918a
Running Settings Robolectric tests
The full suite
$ croot
$ atest SettingsRoboTests
Running a single test class
With a filter
$ croot
$ atest SettingsRoboTests:com.android.settings.display.AdaptiveSleepPreferenceControllerTest
You can also run any single test class with atest (it will try to find the correct path)
$ atest AdaptiveSleepPreferenceControllerTest