Merge "Hide the audio switcher if it is not relevant" into pi-dev am: 3f5444b9e4

am: 67d44d9d61

Change-Id: I36b249159ef8d0a6d099ba776c5d682ea596e5e3
This commit is contained in:
caxtonchan
2018-04-24 21:04:45 -07:00
committed by android-build-merger
6 changed files with 31 additions and 30 deletions

View File

@@ -159,7 +159,7 @@ public class HandsFreeProfileOutputPreferenceControllerTest {
/**
* One Headset Bluetooth device is available and activated
* Preference should be enabled
* Preference should be visible
* Preference summary should be activate device name
*/
@Test
@@ -170,13 +170,13 @@ public class HandsFreeProfileOutputPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.isEnabled()).isTrue();
assertThat(mPreference.isVisible()).isTrue();
assertThat(mPreference.getSummary()).isEqualTo(mBluetoothDevice.getName());
}
/**
* More than one Headset Bluetooth devices are available, and second device is active.
* Preference should be enabled
* Preference should be visible
* Preference summary should be activate device name
*/
@Test
@@ -196,14 +196,14 @@ public class HandsFreeProfileOutputPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.isEnabled()).isTrue();
assertThat(mPreference.isVisible()).isTrue();
assertThat(mPreference.getSummary()).isEqualTo(secondBluetoothDevice.getName());
}
/**
* Hands Free Profile Bluetooth device(s) are available, but wired headset is plugged in
* and activated.
* Preference should be enabled
* Preference should be visible
* Preference summary should be "This device"
*/
@Test
@@ -216,14 +216,14 @@ public class HandsFreeProfileOutputPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.isEnabled()).isTrue();
assertThat(mPreference.isVisible()).isTrue();
assertThat(mPreference.getSummary()).isEqualTo(
mContext.getText(R.string.media_output_default_summary));
}
/**
* No available Headset BT devices
* Preference should be disabled
* Preference should be invisible
* Preference summary should be "This device"
*/
@Test
@@ -234,7 +234,7 @@ public class HandsFreeProfileOutputPreferenceControllerTest {
mController.updateState(mPreference);
assertThat(mPreference.isEnabled()).isFalse();
assertThat(mPreference.isVisible()).isFalse();
assertThat(mPreference.getSummary()).isEqualTo(
mContext.getText(R.string.media_output_default_summary));
}