Fix output switch will show empty slice

Use MediaDevice in the list to add row instead of use connectedDevice.
Becauae connectedDevice that got from getCurrentConnectedMediaDevice()
could be null.

Bug: 157611605
Test: make -j42 RunSettingsRoboTests
Change-Id: Ib51e3e436e65a9aaa5a35488191b8b2ad9cb6a4b
This commit is contained in:
Hugh Chen
2020-06-01 14:57:09 +08:00
parent 73b6bfc1e8
commit bf1de21131

View File

@@ -106,7 +106,9 @@ public class MediaOutputSlice implements CustomSliceable {
final MediaDevice connectedDevice = worker.getCurrentConnectedMediaDevice();
if (devices.size() == 1) {
// Zero state
addRow(connectedDevice, connectedDevice, listBuilder);
for (MediaDevice device : devices) {
addRow(device, device, listBuilder);
}
listBuilder.addRow(getPairNewRow());
} else {
final boolean isTouched = worker.getIsTouched();