OSDN Git Service

Add audio switch UI in sound settings
authorryanywlin <ryanywlin@google.com>
Fri, 23 Mar 2018 08:57:51 +0000 (16:57 +0800)
committerryanywlin <ryanywlin@google.com>
Mon, 16 Apr 2018 03:52:44 +0000 (11:52 +0800)
commit63bdfa8998791eb08fb70c21ea37d23c910e5057
tree7ad437d75d9ba0ce3e0e675dfd83181f30407ded
parent751a3953dac1dc6a86ccf607342c763fef9bc273
Add audio switch UI in sound settings

- Build two controller to control list preferences.

- MediaOutputPreferenceController which allows switching
the media output between current device and connected
BT device supporting A2DP. It also controls disabling
media output switching during a call or cast mode.

- HandsFreeProfilePreferenceController which allows
switching between HFP-connected BT devices while in
on-call state.

- Add test cases for controllers.

Bug: 74130772
Test: make RunSettingsRoboTests ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j56
Test: make RunSettingsRoboTests ROBOTEST_FILTER="HandsFreeProfileOutputPreferenceControllerTest" -j56
Test: make RunSettingsRoboTests ROBOTEST_FILTER="AudioOutputSwitchPreferenceControllerTest" -j56

Change-Id: I37f5418442ce77e72cdff07f071ea519ab1047f3
res/xml/sound_settings.xml
src/com/android/settings/core/FeatureFlags.java
src/com/android/settings/sound/AudioSwitchPreferenceController.java [new file with mode: 0644]
src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java [new file with mode: 0644]
src/com/android/settings/sound/MediaOutputPreferenceController.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/testutils/shadow/ShadowAudioManager.java
tests/robotests/src/com/android/settings/testutils/shadow/ShadowBluetoothUtils.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/testutils/shadow/ShadowMediaRouter.java [new file with mode: 0644]