Implement audio switch UI

* Implement available media devices group
* Add AvailableMediaDeviceGroupController to realize UI, the user can see the all device that can be activated in this group.
* ConnectedDeviceGroupController change to show the device that cannot be activated but is connected.
* Refactoring the below class, implement the controller in connected_devices.xml.
  ConnectedDeviceGroupController.java
  SavedDeviceGroupController.java
  ConnectedDeviceDashboardFragment.java
  connected_devices.xml
* Add AvailableMediaBluetoothDeviceUpdaterTest to verify the add/remove preference behavior when connectedStateChanged or profileAudioStateChanged
* Add test that used to verify device is connected or not in BluetoothDeviceUpdaterTest.
* Add test that used to verify the add/remove preference behavior when connectedStateChanged or profileAudioStateChanged in ConnectedBluetoothDeviceUpdaterTest.
* Add AvailableMediaDeviceGroupControllerTest to verify bluetooth feature is supported or not and test register callback.
* Add test that used to verify bluetooth feature is supported or not and test register callback in ConnectedDeviceGroupControllerTest.
* Add test that used to verify bluetooth feature is supported or not and test register callback in SavedDeviceGroupControllerTest

Bug: 74134939
Test: make -j40 RunSettingsRoboTests
Change-Id: I54d03c2ddadc6a4be7519dd74cdbcb5055d44083
This commit is contained in:
hughchen
2018-03-23 16:14:13 +08:00
committed by Hugh Chen
parent 28041fb8cd
commit bd3e5de207
18 changed files with 949 additions and 85 deletions

View File

@@ -50,13 +50,6 @@ public class SavedDeviceGroupController extends BasePreferenceController
super(context, KEY);
}
@VisibleForTesting
SavedDeviceGroupController(DashboardFragment fragment,
BluetoothDeviceUpdater bluetoothDeviceUpdater) {
super(fragment.getContext(), KEY);
mBluetoothDeviceUpdater = bluetoothDeviceUpdater;
}
@Override
public void onStart() {
mBluetoothDeviceUpdater.registerCallback();
@@ -109,4 +102,9 @@ public class SavedDeviceGroupController extends BasePreferenceController
mBluetoothDeviceUpdater = new SavedBluetoothDeviceUpdater(fragment.getContext(),
fragment, SavedDeviceGroupController.this);
}
@VisibleForTesting
public void setBluetoothDeviceUpdater(BluetoothDeviceUpdater bluetoothDeviceUpdater) {
mBluetoothDeviceUpdater = bluetoothDeviceUpdater;
}
}