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

Issue 1131793004: Migrate AudioFocusChangeListener to browser and always send GAIN (Closed)

Created:
5 years, 7 months ago by demarem
Modified:
5 years, 6 months ago
CC:
android-webview-reviews_chromium.org, avayvod+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, posciak+watch_chromium.org, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Migrate AudioFocusChangeListener to browser and always send GAIN When each player has its own AudioFocusChangeListener, they must all request AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK and not react to AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK so that they don't affect each other. However, DUCK is intended to be used for temporary audio focus and can result in overlapping audio between the player and an external application. In order to signal external applications to stop playing, GAIN must be sent. By migrating the AudioFocusChangeListener to the browser level, GAIN can be sent on behalf of all players and any type of AUDIOFOCUS_LOSS can interrupt all players. BUG=429192 TEST=Run ContentShell instrumentation test: ./build/android/test_runner.py instrumentation \ --test-apk=ContentShellTest --isolate-file-path \ content/content_shell_test_apk.isolate -f "AudioFocusManagerTest*"

Patch Set 1 #

Total comments: 4

Patch Set 2 : webview suggestions from boliu #

Unified diffs Side-by-side diffs Delta from patch set Stats (+422 lines, -46 lines) Patch
M android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java View 1 4 chunks +12 lines, -4 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/MultipleVideosTest.java View 1 2 chunks +6 lines, -2 lines 0 comments Download
M content/browser/android/browser_jni_registrar.cc View 2 chunks +3 lines, -0 lines 0 comments Download
A content/browser/media/android/audio_focus_manager.h View 1 chunk +49 lines, -0 lines 0 comments Download
A content/browser/media/android/audio_focus_manager.cc View 1 chunk +70 lines, -0 lines 0 comments Download
M content/browser/media/android/browser_media_player_manager.h View 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/media/android/browser_media_player_manager.cc View 5 chunks +6 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_jni.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/AudioFocusManager.java View 1 1 chunk +99 lines, -0 lines 0 comments Download
A content/public/android/javatests/src/org/chromium/content/browser/AudioFocusManagerTest.java View 1 1 chunk +99 lines, -0 lines 0 comments Download
M content/public/test/android/javatests/src/org/chromium/content/browser/test/util/DOMUtils.java View 1 2 chunks +23 lines, -4 lines 0 comments Download
A + content/test/data/android/audio.ogg View Binary file 0 comments Download
A content/test/data/android/multiple_audio_test.html View 1 chunk +49 lines, -0 lines 0 comments Download
M media/base/android/java/src/org/chromium/media/MediaPlayerListener.java View 4 chunks +1 line, -29 lines 0 comments Download
M media/base/android/media_player_listener.cc View 1 chunk +0 lines, -7 lines 0 comments Download

Messages

Total messages: 14 (3 generated)
demarem
tedchoc, please review as owner of: - content/browser/android/* - content/public/android/* - content/public/test/android/* qinmin, we communicated ...
5 years, 7 months ago (2015-05-07 21:13:55 UTC) #3
boliu
glanced at some bits I thought might be important for webview https://codereview.chromium.org/1131793004/diff/1/content/public/android/java/src/org/chromium/content/browser/AudioFocusManager.java File content/public/android/java/src/org/chromium/content/browser/AudioFocusManager.java (right): ...
5 years, 7 months ago (2015-05-07 21:19:47 UTC) #4
demarem
Thanks boliu, I made those changes. https://codereview.chromium.org/1131793004/diff/1/content/public/android/java/src/org/chromium/content/browser/AudioFocusManager.java File content/public/android/java/src/org/chromium/content/browser/AudioFocusManager.java (right): https://codereview.chromium.org/1131793004/diff/1/content/public/android/java/src/org/chromium/content/browser/AudioFocusManager.java#newcode33 content/public/android/java/src/org/chromium/content/browser/AudioFocusManager.java:33: mContext = context; ...
5 years, 7 months ago (2015-05-08 00:00:40 UTC) #5
boliu
android_webview rubberstamp lgtm
5 years, 7 months ago (2015-05-08 01:16:37 UTC) #6
qinmin
Adding a couple folks that are working on MediaFocus
5 years, 7 months ago (2015-05-08 19:05:20 UTC) #8
whywhat
Thanks for your patch! Mounir has just sent an Intent to Implement [1] to chromium-dev ...
5 years, 7 months ago (2015-05-12 20:18:04 UTC) #9
philipj_slow
Any progress on this? Needless to say I'm supportive, but I'm not an owner here.
5 years, 7 months ago (2015-05-26 09:41:28 UTC) #10
mlamouri (slow - plz ping)
On 2015/05/26 at 09:41:28, philipj wrote: > Any progress on this? Needless to say I'm ...
5 years, 7 months ago (2015-05-26 09:48:09 UTC) #11
philipj_slow
On 2015/05/26 09:48:09, Mounir Lamouri wrote: > On 2015/05/26 at 09:41:28, philipj wrote: > > ...
5 years, 7 months ago (2015-05-26 10:51:27 UTC) #12
mlamouri (slow - plz ping)
On 2015/05/26 at 10:51:27, philipj wrote: > On 2015/05/26 09:48:09, Mounir Lamouri wrote: > > ...
5 years, 6 months ago (2015-06-01 11:43:42 UTC) #13
demarem
5 years, 6 months ago (2015-06-01 13:07:19 UTC) #14
Message was sent while issue was closed.
On 2015/06/01 at 11:43:42, mlamouri wrote:
> On 2015/05/26 at 10:51:27, philipj wrote:
> > On 2015/05/26 09:48:09, Mounir Lamouri wrote:
> > > On 2015/05/26 at 09:41:28, philipj wrote:
> > > > Any progress on this? Needless to say I'm supportive, but I'm not an
owner
> > > here.
> > > 
> > > I believe that https://codereview.chromium.org/1110833004 will fix the
issue
> > > this CL tries to fix. Is there any reason we should try to land this
instead/in
> > > addition of https://codereview.chromium.org/1110833004
> > 
> > Oops, I found the wrong CL by searching for your username, didn't pay
attention to which one.
> 
> I think this CL has been deprecated by 
https://codereview.chromium.org/1110833004

I agree, now that that one has landed I have closed this one.

Powered by Google App Engine
This is Rietveld 408576698