summaryrefslogtreecommitdiffstats
path: root/chromeos/audio/cras_audio_handler_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix the issue where the active output device is lost after the device ↵jennyz2015-04-291-0/+64
| | | | | | | | | | suspend/resume without any active stream. BUG=478968 Review URL: https://codereview.chromium.org/1109793005 Cr-Commit-Position: refs/heads/master@{#327399}
* Add a new audio extension event OnMuteChanged.jennyz2015-03-301-2/+6
| | | | | | | | | | | | | | This is the part of audio extension redesign efforts. The original audio extension only has one OnDeviceChanged event without any input arguments to notify all sorts of audio events, which is not efficient. The hotrod app has to query getInfo to get all sets of the devices with properties, comparing the old data to decide what change really happens and handles the change. Therefore, in the new design, we will add new events to accurately report what exact audio change occurs. Eventually, we will migrate to use the new events and retire the old OnDeviceChanged event. See details in design doc: https://docs.google.com/a/google.com/document/d/1YFFLwX4mcKJyuAsZB13GhDid0MEt0QguKX0AxgvBoko/edit?usp=sharing BUG=429312 TBR=mnissler Review URL: https://codereview.chromium.org/1033603006 Cr-Commit-Position: refs/heads/master@{#322907}
* Redesign audio extension apis. This adds the following P1 requests api features:jennyz2015-03-211-43/+40
| | | | | | | | | | OnLevelChanged event: This is fired when the level of an active audio device changes(volume for output, gain for inout), node id and new value of level are passed as arguments of the event. BUG=429312 Review URL: https://codereview.chromium.org/945103002 Cr-Commit-Position: refs/heads/master@{#321679}
* Do not re-select active device if a lower priority device is hotplugged in ↵jennyz2015-02-051-0/+51
| | | | | | | | | | and user has already selected active device previously. BUG=447826 Review URL: https://codereview.chromium.org/872303003 Cr-Commit-Position: refs/heads/master@{#314844}
* Update {virtual,override,final} to follow C++11 style in chromeos.dcheng2015-01-211-22/+11
| | | | | | | | | | | | | | | | The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override. This patch was automatically generated with a ChromeOS build using a variation of https://codereview.chromium.org/598073004. BUG=417463 R=zelidrag@chromium.org Review URL: https://codereview.chromium.org/856563004 Cr-Commit-Position: refs/heads/master@{#312426}
* Fix an edge case in CrasAudioHandler caused by two consecutive NodesChanged ↵jennyz2015-01-151-1/+81
| | | | | | | | | | | | signals be triggered for unplugging an audio device with two nodes on it. The edge case is triggered by two NodesChanged signal being sent out by cras to chrome with one audio device being unplugged with both an input and output node on it. The first NodesChanged signal only removed output node, and the second NodesChanged signal is sent with the input node removed too, but this signal is sent out before cras receives the SetActiveOutputNode call from the CrasAudioHanlder handling of the first NodesChanged signal, therefore, the output node which supposed to be active is inactive in the nodes list sent out in the second NodesChanged signal. This exposes a bug in CrasAudioHandler::UpdateDevicesAndSwitchActive code. BUG=448924 Review URL: https://codereview.chromium.org/851933005 Cr-Commit-Position: refs/heads/master@{#311698}
* Reset the active audio node id once all of the devices are gone.mukai2014-11-241-1/+25
| | | | | | | | | | BUG=383624 R=jennyz@chromium.org TEST=the new test case covers Review URL: https://codereview.chromium.org/751773002 Cr-Commit-Position: refs/heads/master@{#305479}
* Fix the hotrod active audio node selection issue caused by the change in ↵jennyz2014-11-051-75/+422
| | | | | | | | | | extension api SetActiveDevices for supporting multiple active nodes. BUG=428393 Review URL: https://codereview.chromium.org/701713002 Cr-Commit-Position: refs/heads/master@{#302847}
* Rename CrasAudioClientStubImpl to FakeCrasAudioClientsatorux2014-10-271-9/+9
| | | | | | | | | | | | | CrasAudioClientStubImpl has some fake-ish behavors (ex. SetAudioNodesForTesting). Besides other similar classes in the directory are named FakeWhateverClient. BUG=309506 TEST=none Review URL: https://codereview.chromium.org/675403002 Cr-Commit-Position: refs/heads/master@{#301377}
* replace OVERRIDE and FINAL with override and final in chromeos/mostynb2014-10-061-9/+9
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/628883002 Cr-Commit-Position: refs/heads/master@{#298229}
* Supports multiple active input/output audio nodes in CrasAudioHandler.jennyz2014-09-251-113/+332
| | | | | | | | | BUG=402072 TBR=xiyuan,jamescook Review URL: https://codereview.chromium.org/596603002 Cr-Commit-Position: refs/heads/master@{#296593}
* app_shell: Do simple audio initialization.derat2014-08-291-2/+3
| | | | | | | | | | | | | | | Add a ShellAudioController class that activates audio devices for input and output and requests max volume. Also move chromeos::NetworkHandler initialization into ShellBrowserMainParts so that ShellNetworkController can get tests at some point. BUG=405968 Review URL: https://codereview.chromium.org/515573003 Cr-Commit-Position: refs/heads/master@{#292643}
* Part 3: Merged FakedDBusThreadManager with DBusThreadManager.zelidrag2014-08-271-1/+1
| | | | | | | | | | BUG=401192 TEST=existing tests TBR=sky,stevenjb,keybuk Review URL: https://codereview.chromium.org/477663004 Cr-Commit-Position: refs/heads/master@{#292072}
* Add keyboard mic APIshychao@chromium.org2014-07-291-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds the necessary APIs for APM to check and configure the keyboard mic on platform. A new device type 'KEYBOARD_MIC' is introduced to expose this auxiliary mic to CrasAudioHandler which will be used for keyboard noise reduction. Note that user should not be aware of the presence of keyboard mic at all, it's of priority '0' and filtered out from audio device list UI. The main logic to open and use keyboard mic is implemented in CRAS. When the keyboard mic is in 'active' mode, it automatically captures audio iff the keyboard mic channel is specified in stream's channel layout, otherwise it stays closed. New APIs: 1. HasKeyboardMic: used to check the keyboard mic capability on platform. 2. SetKeyboardMicActive: used as a switch to turn on/off the logic to auto-open keyboard mic. This change depends on https://codereview.chromium.org/414523006 to bring in the new dbus method names. BUG=393908 Review URL: https://codereview.chromium.org/397503004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286342 0039d316-1c4b-4281-b951-d872f2087c98
* Do not persist audio input device's mute state in prefs.jennyz@chromium.org2014-04-221-17/+7
| | | | | | | | BUG=365050 Review URL: https://codereview.chromium.org/242443010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265171 0039d316-1c4b-4281-b951-d872f2087c98
* Modify logic of CrasAudioHandler::NonActiveDeviceUnpluggedhychao@chromium.org2014-01-231-0/+174
| | | | | | | | | | | | | | | | | There is a work around on CRAS for some platform to auto-unplug internal nodes when external headphone/mic is plugged, causing 'two' devices changed at once. Handle this corner case in CrasAudioHandler. R=jennyz@chromium.org BUG=334099 TEST=unitest. Build and deploy chrome to Stumpy, plug USB headset and then plug 3.5mm headphone jack, verify the active node switches to headphone. Review URL: https://codereview.chromium.org/143903015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246511 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the inconsitent active audio node issue caused by multiple NodesChanged ↵jennyz@chromium.org2013-09-181-0/+176
| | | | | | | | | | signal. When multiple NodesChanged signal are fired for a single node change, GetNodes returns stale nodes data from the later NodesChanged signal, which could overwrite the latest active audio node. BUG=292741 Review URL: https://chromiumcodereview.appspot.com/23736008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223931 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the bluetooth audio device id changing on the fly issue and the active ↵jennyz@chromium.org2013-09-171-0/+49
| | | | | | | | | | device inconsistent issue caused by multiple NodesChanged signal received for the same node change. BUG=290485 Review URL: https://chromiumcodereview.appspot.com/23620055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223507 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the wrong output device switching caused by an input device being ↵jennyz@chromium.org2013-09-091-1/+60
| | | | | | | | | | plugged in. BUG=286029 Review URL: https://chromiumcodereview.appspot.com/23819034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222133 0039d316-1c4b-4281-b951-d872f2087c98
* Set up hdmi output device default volume to 100.jennyz@chromium.org2013-09-091-6/+6
| | | | | | | | | BUG=268438 TEST=hdmi output device should have maximum volume(100) be default. Review URL: https://chromiumcodereview.appspot.com/23536034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222066 0039d316-1c4b-4281-b951-d872f2087c98
* Clear all other input/output audio devices' active status before switching ↵jennyz@chromium.org2013-08-161-0/+39
| | | | | | | | | | | | | to a new active device. Fix a racing issue caused by 2 NodesChanged signals triggered by cras for unplugging headhpne, which caused audio_devices_ got override by stale audio nodes data from 2nd NodesChanged signal. BUG=273271, 274641 R=rkc@chromium.org Review URL: https://codereview.chromium.org/23190009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218115 0039d316-1c4b-4281-b951-d872f2087c98
* Don't switch to the high priority audio device if user has set a lower ↵jennyz@chromium.org2013-08-151-0/+82
| | | | | | | | | | | | priority device to be the active device and unplugged some other audio devices. Add a test case to cover this case. BUG=272479 Review URL: https://chromiumcodereview.appspot.com/23166004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217790 0039d316-1c4b-4281-b951-d872f2087c98
* Add test coverage for CrasAudioHandler.jennyz@chromium.org2013-07-291-0/+1114
Separate CrasAudioClientStubImpl out of cras_audio_client.cc into its own files. Remove MockCrasAudioHandler. BUG=233266 R=stevenjb@chromium.org Review URL: https://codereview.chromium.org/19861002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214224 0039d316-1c4b-4281-b951-d872f2087c98