Display "pair new" only when local output device is available.
-If media app does not support cast->phone transferring, local output audio device is unavailable. "pair new" is for Bluetooth which should be also unavilable. -These types are local output audio devices: TYPE_BUILTIN_SPEAKER TYPE_WIRED_HEADSET TYPE_WIRED_HEADPHONES TYPE_USB_DEVICE TYPE_USB_HEADSET TYPE_USB_ACCESSORY TYPE_DOCK TYPE_HDMI Bug: 163095048 Test: make -j50 RunSettingsRoboTests Change-Id: Ib844c7546e1946cb87fac04cb8b2b8f4acf06451
This commit is contained in:
@@ -106,10 +106,15 @@ public class MediaOutputSlice implements CustomSliceable {
|
|||||||
final MediaDevice connectedDevice = worker.getCurrentConnectedMediaDevice();
|
final MediaDevice connectedDevice = worker.getCurrentConnectedMediaDevice();
|
||||||
if (devices.size() == 1) {
|
if (devices.size() == 1) {
|
||||||
// Zero state
|
// Zero state
|
||||||
for (MediaDevice device : devices) {
|
final MediaDevice device = devices.iterator().next();
|
||||||
addRow(device, device, listBuilder);
|
addRow(device, device, listBuilder);
|
||||||
|
// Add "pair new" only when local output device exists
|
||||||
|
final int type = device.getDeviceType();
|
||||||
|
if (type == MediaDevice.MediaDeviceType.TYPE_PHONE_DEVICE
|
||||||
|
|| type == MediaDevice.MediaDeviceType.TYPE_3POINT5_MM_AUDIO_DEVICE
|
||||||
|
|| type == MediaDevice.MediaDeviceType.TYPE_USB_C_AUDIO_DEVICE) {
|
||||||
|
listBuilder.addRow(getPairNewRow());
|
||||||
}
|
}
|
||||||
listBuilder.addRow(getPairNewRow());
|
|
||||||
} else {
|
} else {
|
||||||
final boolean isTouched = worker.getIsTouched();
|
final boolean isTouched = worker.getIsTouched();
|
||||||
// Fix the last top device when user press device to transfer.
|
// Fix the last top device when user press device to transfer.
|
||||||
|
Reference in New Issue
Block a user