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

@@ -57,7 +57,8 @@ public class SavedBluetoothDeviceUpdaterTest {
private LocalBluetoothProfileManager mLocalBluetoothProfileManager;
private Context mContext;
private BluetoothDeviceUpdater mBluetoothDeviceUpdater;
private SavedBluetoothDeviceUpdater mBluetoothDeviceUpdater;
private BluetoothDevicePreference mPreference;
@Before
public void setUp() {
@@ -71,6 +72,7 @@ public class SavedBluetoothDeviceUpdaterTest {
mBluetoothDeviceUpdater = spy(new SavedBluetoothDeviceUpdater(mDashboardFragment,
mDevicePreferenceCallback, mLocalManager));
mBluetoothDeviceUpdater.setPrefContext(mContext);
mPreference = new BluetoothDevicePreference(mContext, mCachedBluetoothDevice, false);
doNothing().when(mBluetoothDeviceUpdater).addPreference(any());
doNothing().when(mBluetoothDeviceUpdater).removePreference(any());
}
@@ -110,4 +112,11 @@ public class SavedBluetoothDeviceUpdaterTest {
verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice);
}
@Test
public void onClick_Preference_setConnect() {
mBluetoothDeviceUpdater.onPreferenceClick(mPreference);
verify(mCachedBluetoothDevice).connect(true);
}
}