Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Issue 1186293003: Implement HasInputDevices in CrasAudioManager (Closed)

Created:
5 years, 6 months ago by cychiang
Modified:
5 years, 5 months ago
CC:
chromium-reviews, sadrul, feature-media-reviews_chromium.org, oshima+watch_chromium.org, kalyank, henrika (OOO until Aug 14)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement HasInputDevices in CrasAudioManager Currently in CrasAudioManager, HasInputDevices always returns True. We need to let HasInputDevices reflect the truth for device without internal microphone like ChromeBox. Let CrasAudioHandler updates the flag in CrasAudioManager whenever CrasAudioHandler gets the audio node info from Cras. Add a property is_for_simple_usage to AudioDeviceType to indicate that a device is for simple usage, not for special usage like loopback, always on keyword mic, or keyboard mic. This property can also replace the logic in audio_detailed_view.cc to filter out the devices that we do not want to display in UI. BUG=490851 TEST=Check audio devices in UI does not contain loopback devices. TEST=Check virtual keyboard does not show microphone for chromebox (Not tested yet). R=dalecurtis@chromium.org, derat@chromium.org, dgreid@chromium.org, jennyz@chromium.org Committed: https://crrev.com/3c3d910e31448a88e014b31334a57242ba5e8960 Cr-Commit-Position: refs/heads/master@{#337791}

Patch Set 1 #

Total comments: 13

Patch Set 2 : Address the comments and add unittest #

Total comments: 13

Patch Set 3 : Move audio_manager to be a regular member of CrasAudioManager. Fix InitializeForTesting #

Total comments: 14

Patch Set 4 : Fix unittest. Pass AudioManagerWrapperImpl in production code. Address other nits. #

Patch Set 5 : Fix usage of CrasAudioHandler::Initialize in extensions/shell/browser/shell_browser_main_parts.cc #

Patch Set 6 : Add AudioManagerWrapperForTesting and fix CrasAudioHandler::InitializeForTesting for unittests #

Patch Set 7 : Rebase #

Patch Set 8 : Add SetHasInputDevice in FakeAudioManager #

Total comments: 1

Patch Set 9 : Get audio devices from chromeos::CrasAudioHandler in media::AudioManagerCras #

Patch Set 10 : Add a comment in cras_audio_handler.h for GetAudioDevices #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -31 lines) Patch
M ash/system/chromeos/audio/audio_detailed_view.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -4 lines 0 comments Download
M chromeos/audio/audio_device.h View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
M chromeos/audio/cras_audio_handler.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M media/DEPS View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M media/audio/audio_manager_base.h View 1 2 3 4 5 6 7 8 2 chunks +18 lines, -26 lines 0 comments Download
M media/audio/cras/audio_manager_cras.cc View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -1 line 0 comments Download

Messages

Total messages: 52 (18 generated)
cychiang
5 years, 6 months ago (2015-06-16 09:19:39 UTC) #1
DaleCurtis
lgtm % comment fix. https://codereview.chromium.org/1186293003/diff/1/chromeos/audio/audio_device.h File chromeos/audio/audio_device.h (right): https://codereview.chromium.org/1186293003/diff/1/chromeos/audio/audio_device.h#newcode45 chromeos/audio/audio_device.h:45: bool is_for_simple_usage; Needs a comment ...
5 years, 6 months ago (2015-06-16 16:40:52 UTC) #3
jennyz
https://codereview.chromium.org/1186293003/diff/1/chromeos/audio/audio_device.cc File chromeos/audio/audio_device.cc (right): https://codereview.chromium.org/1186293003/diff/1/chromeos/audio/audio_device.cc#newcode43 chromeos/audio/audio_device.cc:43: return (type == AUDIO_TYPE_HEADPHONE || type == AUDIO_TYPE_INTERNAL_MIC || ...
5 years, 6 months ago (2015-06-16 21:51:35 UTC) #4
Daniel Erat
is there any way to add a unit test for this change, or is it ...
5 years, 6 months ago (2015-06-18 14:53:20 UTC) #5
cychiang
Also added unittests. Thanks a lot! https://codereview.chromium.org/1186293003/diff/1/chromeos/audio/audio_device.cc File chromeos/audio/audio_device.cc (right): https://codereview.chromium.org/1186293003/diff/1/chromeos/audio/audio_device.cc#newcode43 chromeos/audio/audio_device.cc:43: return (type == ...
5 years, 6 months ago (2015-06-23 06:05:40 UTC) #6
cychiang
A new class AudioManagerWrapper is added to CrasAudioHandler to provide the interface to call SetHasInputDevice ...
5 years, 6 months ago (2015-06-23 06:22:29 UTC) #7
Daniel Erat
thanks for the tests! https://codereview.chromium.org/1186293003/diff/20001/chromeos/audio/audio_device.h File chromeos/audio/audio_device.h (right): https://codereview.chromium.org/1186293003/diff/20001/chromeos/audio/audio_device.h#newcode48 chromeos/audio/audio_device.h:48: inline bool IsForSimpleUsage() { you ...
5 years, 6 months ago (2015-06-23 14:15:49 UTC) #8
cychiang
Thanks for the pointer to the guides! I moved audio_manager to be a regular member ...
5 years, 6 months ago (2015-06-24 08:11:30 UTC) #9
Daniel Erat
i'm out for the rest of the week so i'll be slow in responding, but ...
5 years, 6 months ago (2015-06-24 13:37:46 UTC) #10
cychiang
Thanks a lot! https://codereview.chromium.org/1186293003/diff/40001/chromeos/audio/cras_audio_handler.cc File chromeos/audio/cras_audio_handler.cc (right): https://codereview.chromium.org/1186293003/diff/40001/chromeos/audio/cras_audio_handler.cc#newcode475 chromeos/audio/cras_audio_handler.cc:475: if (!audio_pref_handler.get()) On 2015/06/24 13:37:45, Daniel ...
5 years, 6 months ago (2015-06-25 05:45:25 UTC) #11
Daniel Erat
thanks! lgtm
5 years, 6 months ago (2015-06-25 13:05:04 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186293003/60001
5 years, 6 months ago (2015-06-26 07:10:53 UTC) #20
commit-bot: I haz the power
Exceeded global retry quota
5 years, 6 months ago (2015-06-26 07:35:14 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186293003/100001
5 years, 5 months ago (2015-06-30 05:10:52 UTC) #25
commit-bot: I haz the power
Exceeded global retry quota
5 years, 5 months ago (2015-06-30 05:12:29 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186293003/80002
5 years, 5 months ago (2015-06-30 09:41:49 UTC) #30
commit-bot: I haz the power
Exceeded global retry quota
5 years, 5 months ago (2015-06-30 10:06:42 UTC) #32
cychiang
It seems there are two issues in this CL. 1. either compile error or cycle ...
5 years, 5 months ago (2015-07-01 06:35:54 UTC) #33
cychiang
On 2015/07/01 06:35:54, cychiang wrote: > It seems there are two issues in this CL. ...
5 years, 5 months ago (2015-07-01 06:37:55 UTC) #34
Daniel Erat
[cc-ing stevenjb@ for thoughts] maybe chromeos/audio/ should live somewhere else. media/audio/ already has a bunch ...
5 years, 5 months ago (2015-07-01 14:04:51 UTC) #35
stevenjb
On 2015/07/01 14:04:51, Daniel Erat wrote: > [cc-ing stevenjb@ for thoughts] > > maybe chromeos/audio/ ...
5 years, 5 months ago (2015-07-01 15:43:37 UTC) #36
cychiang
On 2015/07/01 15:43:37, stevenjb wrote: > On 2015/07/01 14:04:51, Daniel Erat wrote: > > [cc-ing ...
5 years, 5 months ago (2015-07-01 17:57:47 UTC) #37
DaleCurtis
If possible moving to media/audio/cras is fine with me. I thought some parts of the ...
5 years, 5 months ago (2015-07-01 17:59:22 UTC) #38
stevenjb
https://codereview.chromium.org/1186293003/diff/130001/chromeos/audio/cras_audio_handler.h File chromeos/audio/cras_audio_handler.h (right): https://codereview.chromium.org/1186293003/diff/130001/chromeos/audio/cras_audio_handler.h#newcode26 chromeos/audio/cras_audio_handler.h:26: class AudioManager; Is this needed? I don't see any ...
5 years, 5 months ago (2015-07-01 21:11:54 UTC) #40
stevenjb
On 2015/07/01 17:59:22, DaleCurtis wrote: > If possible moving to media/audio/cras is fine with me. ...
5 years, 5 months ago (2015-07-01 21:18:10 UTC) #41
cychiang
On 2015/07/01 21:18:10, stevenjb wrote: > On 2015/07/01 17:59:22, DaleCurtis wrote: > > If possible ...
5 years, 5 months ago (2015-07-02 05:11:46 UTC) #42
cychiang
On 2015/07/02 05:11:46, cychiang wrote: > On 2015/07/01 21:18:10, stevenjb wrote: > > On 2015/07/01 ...
5 years, 5 months ago (2015-07-02 08:05:21 UTC) #43
cychiang
Now I move the logic to media::AudioManagerCras. However, Dale was right about calling methods of ...
5 years, 5 months ago (2015-07-02 10:59:32 UTC) #44
stevenjb
On 2015/07/02 10:59:32, cychiang wrote: > Now I move the logic to media::AudioManagerCras. > However, ...
5 years, 5 months ago (2015-07-02 16:08:52 UTC) #45
cychiang
On 2015/07/02 16:08:52, stevenjb wrote: > On 2015/07/02 10:59:32, cychiang wrote: > > Now I ...
5 years, 5 months ago (2015-07-06 07:25:38 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186293003/170001
5 years, 5 months ago (2015-07-08 08:52:43 UTC) #49
commit-bot: I haz the power
Committed patchset #10 (id:170001)
5 years, 5 months ago (2015-07-08 09:59:08 UTC) #50
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/3c3d910e31448a88e014b31334a57242ba5e8960 Cr-Commit-Position: refs/heads/master@{#337791}
5 years, 5 months ago (2015-07-08 10:00:09 UTC) #51
Mattias Nissler (ping if slow)
5 years, 5 months ago (2015-07-08 10:44:09 UTC) #52
Message was sent while issue was closed.
A revert of this CL (patchset #10 id:170001) has been created in
https://codereview.chromium.org/1220873010/ by mnissler@chromium.org.

The reason for reverting is: Looks like this broke the build:
http://build.chromium.org/p/chromium.chromiumos/buildstatus?builder=ChromiumO....

Powered by Google App Engine
This is Rietveld 408576698