Click left side of list in "previously connected devices" should connect to the device

* For fix the TreeHugger error in pi-dev, cherry pick the ag/3943978 in
  master and fix TreeHugger error. Change android.support.v7.* to androidx.*
* In "previously connected devices", to connect device
* In "Available media devices", to activate device

Bug: 77607104
Test: make -j50 RunSettingsRoboTests
Change-Id: If5005031bd3f5dc4950abf2c77575785cd6f67b1
This commit is contained in:
timhypeng
2018-04-24 21:45:23 +08:00
committed by hughchen
parent c571701331
commit 1ae09fe2bf
5 changed files with 47 additions and 18 deletions

View File

@@ -73,6 +73,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
private AvailableMediaBluetoothDeviceUpdater mBluetoothDeviceUpdater;
private Collection<CachedBluetoothDevice> cachedDevices;
private ShadowAudioManager mShadowAudioManager;
private BluetoothDevicePreference mPreference;
@Before
public void setUp() {
@@ -93,6 +94,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
mBluetoothDeviceUpdater = spy(new AvailableMediaBluetoothDeviceUpdater(mDashboardFragment,
mDevicePreferenceCallback, mLocalManager));
mBluetoothDeviceUpdater.setPrefContext(mContext);
mPreference = new BluetoothDevicePreference(mContext, mCachedBluetoothDevice, false);
doNothing().when(mBluetoothDeviceUpdater).addPreference(any());
doNothing().when(mBluetoothDeviceUpdater).removePreference(any());
}
@@ -208,5 +210,12 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
verify(mBluetoothDeviceUpdater).removePreference(mCachedBluetoothDevice);
}
@Test
public void onClick_Preference_setActive() {
mBluetoothDeviceUpdater.onPreferenceClick(mPreference);
verify(mCachedBluetoothDevice).setActive();
}
}