Shown toast when BT turned on

* Shown "Bluetooth turned on" toast only when BT turned on in "Pair new device"
* Add test to verify shown toast function can be called when BT turned on.

Bug: 79383997
Test: make -j42 RunSettingsRoboTests ROBOTEST_FILTER=BluetoothPairingDetailTest
Change-Id: I25f75aaa04063d9ef8a0df4bb06aeaa70d7ac146
This commit is contained in:
hughchen
2018-05-30 17:19:41 +08:00
parent 1c7ae169ac
commit 3051845840
3 changed files with 20 additions and 0 deletions

View File

@@ -192,4 +192,13 @@ public class BluetoothPairingDetailTest {
// Verify that clean up only happen once at initialization
verify(mAvailableDevicesCategory, times(1)).removeAll();
}
@Test
public void onBluetoothStateChanged_whenTurnedOnBTShowToast() {
doNothing().when(mFragment).updateContent(anyInt());
mFragment.onBluetoothStateChanged(BluetoothAdapter.STATE_ON);
verify(mFragment).showBluetoothTurnedOnToast();
}
}