New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 680361 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 673392



Sign in to add a comment

audio API: Simplify semantics of setActiveDevices method

Project Member Reported by tbarzic@chromium.org, Jan 12 2017

Issue description

Currently, chrome.audio.setActiveDevices has overly-complex semantics, which makes it harder to use than it should be.

Main problem is that the method takes single list that contains both input and output devices. Additionally, the method does not change set of active devices of a device type if the list passed as the argument contains no devices of that device type.
This makes it impossible to disable all input or output devices.

Simpler solution would be for setActiveDevices to take two lists - one for input devices and the other for output devices. Not affecting set of active devices of a particular  type could be achieved by not setting the list for that type - passing empty list would deactivate all active devices of the associated type.

Note that to preserve backward compatibility with current, whitelisted users of the API, new method for setting active devices should be named differently.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cae06e2aab96be77610c27f4a1469f9570df1c3c

commit cae06e2aab96be77610c27f4a1469f9570df1c3c
Author: tbarzic <tbarzic@chromium.org>
Date: Tue Jan 17 23:14:47 2017

Simplify logic behind chrome.audio.setActiveDevices

Main updates:
* Explicitly separates input and output device lists,
which makes setting only one set of devices more intuitive.
This is achieved by introducing DeviceIdLists object that
can be used as method argument.
* Provides a way to clear active devices - by setting
active device lists to an empty list. Old setActiveDevices
method would not change set of active input/output devices if no
input/output devices were added to the list of active device IDs.

Note that the old logic is preserved not to break current clients
but will eventually be removed. Old logic can be triggered by passing
list of device IDs as array of strings rather than a newly introduced
|DeviceIdLists| object.

The CL adds new public methods to CrasAudioHandler to support new way
of setting active devices: SetActiveInputNodes and
SetActiveOutputNodes. These methods are tested by replicating test
cases for ChangeActiveNodes - replacing calls To ChangeActiveNodes with
new methods.

BUG= 680361 

Review-Url: https://codereview.chromium.org/2605983002
Cr-Commit-Position: refs/heads/master@{#444178}

[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/chromeos/audio/cras_audio_handler.cc
[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/chromeos/audio/cras_audio_handler.h
[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/chromeos/audio/cras_audio_handler_unittest.cc
[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/extensions/browser/api/audio/audio_api.cc
[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/extensions/browser/api/audio/audio_service.cc
[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/extensions/browser/api/audio/audio_service.h
[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/extensions/browser/api/audio/audio_service_chromeos.cc
[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/extensions/common/api/audio.idl
[modify] https://crrev.com/cae06e2aab96be77610c27f4a1469f9570df1c3c/extensions/test/data/api_test/audio/test.js

Status: Fixed (was: Started)

Comment 3 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 4 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment