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

@@ -16,9 +16,9 @@
package com.android.settings.connecteddevice;
import static com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment
.KEY_CONNECTED_DEVICES;
.KEY_AVAILABLE_DEVICES;
import static com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment
.KEY_SAVED_DEVICES;
.KEY_CONNECTED_DEVICES;
import static com.google.common.truth.Truth.assertThat;
@@ -78,7 +78,7 @@ public class ConnectedDeviceDashboardFragmentTest {
final List<String> niks = ConnectedDeviceDashboardFragment.SEARCH_INDEX_DATA_PROVIDER
.getNonIndexableKeys(mContext);
assertThat(niks).containsExactly(KEY_CONNECTED_DEVICES, KEY_SAVED_DEVICES,
assertThat(niks).containsExactly(KEY_CONNECTED_DEVICES, KEY_AVAILABLE_DEVICES,
NfcPreferenceController.KEY_TOGGLE_NFC);
}
}