Merge "AudioDeviceInventory: better error handling in clearDevicesRole" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7c20a56b77
@@ -1100,7 +1100,8 @@ public class AudioDeviceInventory {
|
|||||||
synchronized (rolesMap) {
|
synchronized (rolesMap) {
|
||||||
Pair<Integer, Integer> key = new Pair<>(useCase, role);
|
Pair<Integer, Integer> key = new Pair<>(useCase, role);
|
||||||
if (!rolesMap.containsKey(key)) {
|
if (!rolesMap.containsKey(key)) {
|
||||||
return AudioSystem.SUCCESS;
|
// trying to clear a role for a device that wasn't set
|
||||||
|
return AudioSystem.BAD_VALUE;
|
||||||
}
|
}
|
||||||
final int status = asi.deviceRoleAction(useCase, role, null);
|
final int status = asi.deviceRoleAction(useCase, role, null);
|
||||||
if (status == AudioSystem.SUCCESS) {
|
if (status == AudioSystem.SUCCESS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user