When only one device is selected in dynamic group, the device should be disabled

-Check if device id is in selected group rather than comparing client package name
-Add test cases

Bug: 154916764
Test: make -j50 RunSettingsRoboTests
Change-Id: I7364a9e3d807bbfc6b26b8212ab2da67ea329582
This commit is contained in:
Tim Peng
2020-05-11 14:06:06 +08:00
committed by tim peng
parent 0c6037af5f
commit 550fd3ef9a
3 changed files with 15 additions and 11 deletions

View File

@@ -238,7 +238,7 @@ public class MediaOutputGroupSlice implements CustomSliceable {
+ ") is unavailable");
return;
}
if (TextUtils.equals(device.getClientPackageName(), getWorker().getPackageName())) {
if (getWorker().isSelectedMediaDevice(device)) {
getWorker().removeDeviceFromPlayMedia(device);
} else {
getWorker().addDeviceToPlayMedia(device);