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

Issue metadata

Status: Started
Owner:
Android MediaRouter only (left Chro...
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug

Blocked on:
issue 822826



Sign in to add a comment
link

Issue 711860: Chrome on Android must switch from using Cast SDK v2 to Cast SDK v3 by end of the year.

Reported by avayvod@chromium.org, Apr 15 2017 Project Member

Issue description

The deprecation of v2 was just announced in the Cast Dev Google+ community: https://plus.google.com/+LeonNicholls/posts/bgR15tDibTn

I imagine if not fixed, the effects might range from features not working to Chrome crashing when using the removed SDK methods to not compiling whenever the client library is updated.
 

Comment 1 by mfo...@chromium.org, Apr 15 2017

It looks like the v3 SDK is available in Google Play Services 10.2 (the current release) so we can start migration work in Chrome.

Comment 2 by mlamouri@chromium.org, Apr 17 2017

Given the timeline, we should do this in Q3. Based on the set milestone, I assume that's what you had in mind avayvod@?

Comment 3 by avayvod@chromium.org, Apr 17 2017

I tried to estimate the first milestone that might break because of the deprecation. Q3 sounds good to me.

Comment 4 by sko...@chromium.org, Sep 25 2017

Owner: mfo...@chromium.org
Status: Assigned (was: Available)
Mark, as part of our chat w/ Cast team we need to find an owner here.

Comment 5 by mfo...@chromium.org, Sep 29 2017

Cc: opg@chromium.org mkehm@google.com
Owner: zqzh...@chromium.org

Comment 6 by mfo...@chromium.org, Sep 29 2017

Labels: -M-63
Next step is to scope the amount of work involved by the EOY.

Code location:

https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/media/router/

Comment 7 by mfo...@chromium.org, Oct 26 2017

Labels: M-66
Tentatively targeting M66 to close this out (branches end of Q1).

Comment 8 by mfo...@chromium.org, Mar 15 2018

Labels: -M-66 M-69
M-69 is a more likely target for launching this (it will be available behind a flag, initially).

Comment 9 by zqzh...@chromium.org, Mar 23 2018

Blockedon: 822826

Comment 10 by bugdroid1@chromium.org, Mar 27 2018

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

commit fb7c65c3569eed2502e5cc09c0d4c4e8543b8f68
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Tue Mar 27 18:19:42 2018

[Android MR] Initial directory layout for CAF migration

This CL lies out the directory layout for CAF migration. The
migrated code will reside in caf/, in parallel of cast/. The
migrated code is guarded behind a feature flag.

Bug: 711860
Change-Id: Iddfe9e3ce3103fae876c9c151c96aba2ef99354f
Reviewed-on: https://chromium-review.googlesource.com/977232
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546175}
[modify] https://crrev.com/fb7c65c3569eed2502e5cc09c0d4c4e8543b8f68/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
[modify] https://crrev.com/fb7c65c3569eed2502e5cc09c0d4c4e8543b8f68/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
[add] https://crrev.com/fb7c65c3569eed2502e5cc09c0d4c4e8543b8f68/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/fb7c65c3569eed2502e5cc09c0d4c4e8543b8f68/chrome/android/java_sources.gni
[modify] https://crrev.com/fb7c65c3569eed2502e5cc09c0d4c4e8543b8f68/chrome/browser/android/chrome_feature_list.cc
[modify] https://crrev.com/fb7c65c3569eed2502e5cc09c0d4c4e8543b8f68/media/base/media_switches.cc
[modify] https://crrev.com/fb7c65c3569eed2502e5cc09c0d4c4e8543b8f68/media/base/media_switches.h

Comment 11 by zqzh...@chromium.org, Mar 27 2018

Status: Started (was: Assigned)

Comment 12 by bugdroid1@chromium.org, Mar 27 2018

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb

commit 695d5391cfc31d389ed36d7cab9081fa3ce3e8fb
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Tue Mar 27 21:35:27 2018

[Android MR] CAF discovery migration

This CL implements/migrates the discovery code to CAF. Also
MediaSource and MediaSink will be shared by caf/ and cast/ so
they are moved to the parent directory.

Bug: 711860
Change-Id: I52bb4d6e4c01bbac60c8361e798af7ee9691429c
Reviewed-on: https://chromium-review.googlesource.com/977564
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546268}
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java
[rename] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/DiscoveryCallback.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/DiscoveryDelegate.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteChooserDialogManager.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteDialogDelegate.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteManager.java
[rename] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaSink.java
[rename] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaSource.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/BaseMediaRouteProvider.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaSource.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionImpl.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingCastSession.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaRouteProvider.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaSource.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/java_sources.gni
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/javatests/src/org/chromium/chrome/browser/media/router/MockMediaRouteProvider.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/junit/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterSinkObservationTest.java
[rename] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/junit/src/org/chromium/chrome/browser/media/router/DiscoveryCallbackTest.java
[rename] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/junit/src/org/chromium/chrome/browser/media/router/TestUtils.java
[modify] https://crrev.com/695d5391cfc31d389ed36d7cab9081fa3ce3e8fb/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProviderTest.java

Comment 13 by bugdroid1@chromium.org, Jul 11 2018

Project Member
The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/89de7ef0b20e6b071861125c377347942439436b

commit 89de7ef0b20e6b071861125c377347942439436b
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Wed Jul 11 09:07:10 2018

Comment 14 by bugdroid1@chromium.org, Jul 11 2018

Project Member
The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/02a120cc488e8fb4671d8055952d6af14e29e887

commit 02a120cc488e8fb4671d8055952d6af14e29e887
Author: Peter Kotwicz <pkotwicz@google.com>
Date: Wed Jul 11 14:52:39 2018

Comment 15 by bugdroid1@chromium.org, Jul 12 2018

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b866113743ca04361daf9e63c30ae190ca60da4

commit 9b866113743ca04361daf9e63c30ae190ca60da4
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Thu Jul 12 21:13:24 2018

[Android MR] Check Google Play services APK version before enabling CAF

This CL checks GMS APK version before enabling CAF. The reason is that
the current SDK version is 12.0.1, while we require the APK version to
be 12.6.0 or above to make it fully functional (this is to avoid
intializing the SDK in Activity#onCreate()).

Currently we are using a fallback implementation to check GMS APK
version. Ideally this should be done via the versioned
GoogleApiAvailability.isGooglePlayServiceAvailable() API. However this
versioned API is only added in a later version. The downstream
implementation is calling the versioned API directly.

After the upstream SDK version gets updated, we can just call the
versioned API directly.

Bug: 711860
Change-Id: Iec5f84cffcc5c55fd303255b91a7f187c79b15cb
Reviewed-on: https://chromium-review.googlesource.com/1132474
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574722}
[modify] https://crrev.com/9b866113743ca04361daf9e63c30ae190ca60da4/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
[modify] https://crrev.com/9b866113743ca04361daf9e63c30ae190ca60da4/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java

Comment 16 by bugdroid1@chromium.org, Jul 13 2018

Project Member
The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/bddc95f08925412a66a6ea256ceaba338fe7aa94

commit bddc95f08925412a66a6ea256ceaba338fe7aa94
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Jul 13 02:17:23 2018

Comment 17 by bugdroid1@chromium.org, Jul 16 2018

Project Member
The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/c6b53a6222ff6c143835e031939e480ebf5778a0

commit c6b53a6222ff6c143835e031939e480ebf5778a0
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Mon Jul 16 18:56:03 2018

Comment 18 by mfo...@chromium.org, Aug 2

Cc: powerb@chromium.org

Comment 19 by bugdroid1@chromium.org, Aug 3

Project Member
The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/36b41887894ff8f06cc44bb9c2b81fdfce95cb93

commit 36b41887894ff8f06cc44bb9c2b81fdfce95cb93
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Aug 03 19:05:10 2018

Comment 20 by bugdroid1@chromium.org, Aug 13

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

commit e018d228563d2b1f080e369aa466f8f905345aaf
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Mon Aug 13 18:48:23 2018

[CAF MR] Disable reconnection service

CAF reconnection service is enabled by default. However the reconnection
service is used for recovering sessions when the app crashes and
relaunches. MediaRouter won't need this feature so it should be
disabled.

Bug: 711860
Change-Id: Ib7b3e13af56c4be4286be7d50dc2b0e7868a3722
Reviewed-on: https://chromium-review.googlesource.com/1171795
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582652}
[modify] https://crrev.com/e018d228563d2b1f080e369aa466f8f905345aaf/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastOptionsProvider.java

Comment 21 by bugdroid1@chromium.org, Aug 13

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9f7cd31fea6fabe02e631793e9434080ebd31598

commit 9f7cd31fea6fabe02e631793e9434080ebd31598
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Mon Aug 13 20:20:21 2018

[CAF MR] Implement CafBaseMediaRouteProvider

This CL adds CafBaseMediaRouteProvider, which corresponds to
BaseMediaRouteProvider. The new provider is the base class
containing the common logic for CAF MediaRouteProviders.

Bug: 711860
Change-Id: I0783854b990730ebf6a5bbf5bcaa10ba090ee7c1
Reviewed-on: https://chromium-review.googlesource.com/1168138
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582687}
[add] https://crrev.com/9f7cd31fea6fabe02e631793e9434080ebd31598/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/9f7cd31fea6fabe02e631793e9434080ebd31598/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/9f7cd31fea6fabe02e631793e9434080ebd31598/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java
[modify] https://crrev.com/9f7cd31fea6fabe02e631793e9434080ebd31598/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/BaseMediaRouteProvider.java
[modify] https://crrev.com/9f7cd31fea6fabe02e631793e9434080ebd31598/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java
[modify] https://crrev.com/9f7cd31fea6fabe02e631793e9434080ebd31598/chrome/android/java_sources.gni

Comment 22 by bugdroid1@chromium.org, Aug 14

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72

commit 28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Tue Aug 14 21:37:24 2018

[CAF MR] Implementing CafMessageHandler

This CL migrates the CastMessageHandler for CAF. There's not
much code change between CastMessageHandler and CafMessageHandler.

Bug: 711860
Change-Id: Id58454c51cd6ada50b507d750a979ffe4e248241
Reviewed-on: https://chromium-review.googlesource.com/1169920
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583043}
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerWrapper.java
[rename] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/CastRequestIdGenerator.java
[rename] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/CastSessionUtil.java
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[add] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
[delete] https://crrev.com/5991ad4170347d8a0562ae51a810febf87636e39/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastMessageHandler.java
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandler.java
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionImpl.java
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingCastSession.java
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/java_sources.gni
[modify] https://crrev.com/28ca7e1119a3d8c8b6c48f26c0b4fe138cd7cc72/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandlerTest.java

Comment 23 by bugdroid1@chromium.org, Aug 18

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

commit ac7ad272e838a91f2ecd5cce8f537a9c1ae078ec
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Sat Aug 18 08:09:20 2018

[CAF MR] Making several CAF MR classes sticky

Previously we made CastMessage & CastSessionImpl (now
CastSessionController) lifecycle bound to per connection, which
makes the session management over-complicated. This CL makes
those classes having the same lifecycle as CafBaseMRP/CafMRP, so
there's no need to create/set/unset instances any more. These
instances will only be active when there's currently an active
session.

Bug: 711860
Change-Id: I1736bb7085cd1ffbffed8ec40f3410ebe997e64e
Reviewed-on: https://chromium-review.googlesource.com/1171582
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584309}
[modify] https://crrev.com/ac7ad272e838a91f2ecd5cce8f537a9c1ae078ec/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/ac7ad272e838a91f2ecd5cce8f537a9c1ae078ec/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/ac7ad272e838a91f2ecd5cce8f537a9c1ae078ec/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java
[add] https://crrev.com/ac7ad272e838a91f2ecd5cce8f537a9c1ae078ec/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CreateRouteRequestInfo.java
[modify] https://crrev.com/ac7ad272e838a91f2ecd5cce8f537a9c1ae078ec/chrome/android/java_sources.gni

Comment 24 by bugdroid1@chromium.org, Aug 29

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/004db3c062c8745f1bcf84a7ff91acd056ad549c

commit 004db3c062c8745f1bcf84a7ff91acd056ad549c
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Wed Aug 29 00:08:52 2018

Refactoring ClientRecord handling

This CL unifies the handling of ClientRecord. Now ClientRecord
has 1-1 mapping with the routes. They are added and removed at
the same time.

BaseMRP now has a addRoute/removeRoute method to handle route
changes. CafMRP overrides these methods to handle ClientRecords
as well.

Bug: 711860
Change-Id: Ia7b8703ae45c36f36fdc3512ca33a1cc86477ab0
Reviewed-on: https://chromium-review.googlesource.com/1192333
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586946}
[modify] https://crrev.com/004db3c062c8745f1bcf84a7ff91acd056ad549c/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/004db3c062c8745f1bcf84a7ff91acd056ad549c/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/004db3c062c8745f1bcf84a7ff91acd056ad549c/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java

Comment 25 by bugdroid1@chromium.org, Aug 29

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9a27a36d1118085eefe04c90193603239897f771

commit 9a27a36d1118085eefe04c90193603239897f771
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Wed Aug 29 19:48:20 2018

[Android MR] Handle client connection messages

This CL migrates the logic of handling connection messages from
clients. The logic was moved from MRP to message handler to
separate all message handling from MRP.

Bug: 711860
Change-Id: I009deda26ee51a9be1d5ea0a31af6af9d3ea6605
Reviewed-on: https://chromium-review.googlesource.com/1194968
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587254}
[modify] https://crrev.com/9a27a36d1118085eefe04c90193603239897f771/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/9a27a36d1118085eefe04c90193603239897f771/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/9a27a36d1118085eefe04c90193603239897f771/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
[modify] https://crrev.com/9a27a36d1118085eefe04c90193603239897f771/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastUtils.java
[modify] https://crrev.com/9a27a36d1118085eefe04c90193603239897f771/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java

Comment 26 by bugdroid1@chromium.org, Aug 31

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

commit d9ca8389c8ab62f3826bb6f6e6a6a404c9a65371
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Aug 31 02:03:52 2018

[Android MR] Misc fixes for getting Cast to work

This CL includes the following changes:

* Register SessionManagerListener properly so CafMRP and the page can
  get the correct state.
* Store the pending request only in CafBaseMRP and CastSessionController
  will get it from the provider.
* When starting a session, only re-select a route after the route has
  been unselected. This is to avoid rapid selection/unselection to cause
  Android MediaRouter to work improperly.
* Several minor fixes to avoid crashing in the code flow.

Bug: 711860
Change-Id: I8e4e46abe9421908a5d6c7e221a68feb891bbfa3
Reviewed-on: https://chromium-review.googlesource.com/1196166
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587914}
[modify] https://crrev.com/d9ca8389c8ab62f3826bb6f6e6a6a404c9a65371/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/d9ca8389c8ab62f3826bb6f6e6a6a404c9a65371/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/d9ca8389c8ab62f3826bb6f6e6a6a404c9a65371/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
[modify] https://crrev.com/d9ca8389c8ab62f3826bb6f6e6a6a404c9a65371/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastOptionsProvider.java
[modify] https://crrev.com/d9ca8389c8ab62f3826bb6f6e6a6a404c9a65371/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java
[modify] https://crrev.com/d9ca8389c8ab62f3826bb6f6e6a6a404c9a65371/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CreateRouteRequestInfo.java

Comment 27 by mfo...@chromium.org, Sep 4

Labels: -M-69 Target-71

Comment 28 by bugdroid1@chromium.org, Sep 11

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3f1ee607314a03b0a56c2522384199243b895854

commit 3f1ee607314a03b0a56c2522384199243b895854
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Tue Sep 11 01:10:42 2018

[Android MR] Fix an issue on session relaunching

Previously, we remove the SessionManagerListener upon session
ending/ended. This is to stop listening to session changes after we are
no longer interested in casting, while not being affected by MediaFling.
However there's some tricky SDK behavior, such that session ending could
be notified during a session relaunch. Then we never get
onSessionStarted() signal.

This CL checks for pending launch request before removing the listener,
so that sessions can be relaunched.

Bug: 711860
Change-Id: I582ae8bb6f038956c256ea88ae6115ed289fdfff
Reviewed-on: https://chromium-review.googlesource.com/1217749
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590158}
[modify] https://crrev.com/3f1ee607314a03b0a56c2522384199243b895854/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java

Comment 30 by bugdroid1@chromium.org, Sep 12

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

commit c53cb56619821aea34686f572b76eaccbdd09280
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Wed Sep 12 01:36:10 2018

[Android MR] Migrate RemotingCastSession to CAF

This CL migrates RemotingCastSession into RemotingSessionController (CAF
version). Changes include:

* Abstract common logic from CastSessionController into BaseSessionController.
* Add onSessionStarted() and onSessionEnded() callback to BaseSessionController
  to handle session-specific logic regardless of session suspend.
* Return the correct namespaces in CastSessionController

Please diff BaseSessionController from Patchset 2 for easy review (other files
should be diff'ed against base)

Bug: 711860
Change-Id: I2bcb71b38758bb7f7b3a46f25cc4d55fe5c2956f
Reviewed-on: https://chromium-review.googlesource.com/1220300
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590566}
[add] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
[modify] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafNotificationController.java
[modify] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java
[add] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/FlingingControllerAdapter.java
[add] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java
[modify] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingCastSession.java
[modify] https://crrev.com/c53cb56619821aea34686f572b76eaccbdd09280/chrome/android/java_sources.gni

Comment 31 by bugdroid1@chromium.org, Sep 13

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/659e3f41819a8bfc0a9a15c12a1a835e10ffcae2

commit 659e3f41819a8bfc0a9a15c12a1a835e10ffcae2
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Thu Sep 13 18:20:24 2018

[Android MR] Migrate RemotingMediaRouteProvider to CAF

This CL migrates RemoteMRP to its CAF version. The CL mostly does the class
inheritance from CafBaseMRP. Most logic of CafMRP is reused. The
remoting-specific code include:

* Use RemotingMediaSource when getting MediaSource.
* Use different session controllers.
* Disallow some operations such as joining routes and sending messages

Bug: 711860
Change-Id: Ie00324e0e3066b08a291b35e534f2a4c48e0fb52
Reviewed-on: https://chromium-review.googlesource.com/1220809
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591075}
[modify] https://crrev.com/659e3f41819a8bfc0a9a15c12a1a835e10ffcae2/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
[modify] https://crrev.com/659e3f41819a8bfc0a9a15c12a1a835e10ffcae2/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/659e3f41819a8bfc0a9a15c12a1a835e10ffcae2/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[add] https://crrev.com/659e3f41819a8bfc0a9a15c12a1a835e10ffcae2/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/CafRemotingMediaRouteProvider.java
[modify] https://crrev.com/659e3f41819a8bfc0a9a15c12a1a835e10ffcae2/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaRouteProvider.java
[modify] https://crrev.com/659e3f41819a8bfc0a9a15c12a1a835e10ffcae2/chrome/android/java_sources.gni

Comment 32 by bugdroid1@chromium.org, Sep 13

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d393b04329d5417a078c463beceef78face1741

commit 7d393b04329d5417a078c463beceef78face1741
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Thu Sep 13 21:08:57 2018

[Android MR] Implement FlingingControllerAdapter

This CL implements the FlingingControllerAdapter backed by
RemoteMediaClient in RemoteSessionController. The adapter is used to
bridge calls between blink/content layer and the SDK.

Bug: 711860
Change-Id: I0ffda9f67e8f64a42f6e9dae9fabc08e62a6d71e
Reviewed-on: https://chromium-review.googlesource.com/1220675
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591153}
[modify] https://crrev.com/7d393b04329d5417a078c463beceef78face1741/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/7d393b04329d5417a078c463beceef78face1741/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/FlingingControllerAdapter.java
[modify] https://crrev.com/7d393b04329d5417a078c463beceef78face1741/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java

Comment 33 by bugdroid1@chromium.org, Sep 17

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

commit e8b906d98b9365ac30944cb3ccc13068e58a5f55
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Mon Sep 17 23:48:45 2018

[Android MR] Fix several issues in the CAF implementation

This CL includes misc fixes:

* Volume change: when the volume changed, broadcast `update_session`
  message before acking requests.
* Join session: fixes the join session flow. Pending AI is to handle
  `leave_session` properly.

Bug: 711860
Change-Id: I3f66121ffb188b5c3afd53bab5db7bce98089c89
Reviewed-on: https://chromium-review.googlesource.com/1228138
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591880}
[modify] https://crrev.com/e8b906d98b9365ac30944cb3ccc13068e58a5f55/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/e8b906d98b9365ac30944cb3ccc13068e58a5f55/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/e8b906d98b9365ac30944cb3ccc13068e58a5f55/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
[modify] https://crrev.com/e8b906d98b9365ac30944cb3ccc13068e58a5f55/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastOptionsProvider.java
[modify] https://crrev.com/e8b906d98b9365ac30944cb3ccc13068e58a5f55/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java

Comment 34 by bugdroid1@chromium.org, Sep 19

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

commit f7521461110ddf1ccda31beecdf43eda18391805
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Wed Sep 19 22:22:56 2018

[Android MR] Properly treat route close and termination

Previously we always notify route termination upon route close, and only
notify route close on error. This was because we rely on a separate
disconnect_session message to update state in the Web sender SDK.

Now as the Web sender SDK solely depend on the PresentationConnection
state, we just notify the route state change.

The method mapping of before -> after is:
* onRouteClosed() -> onRouteTerminated
* onRouteClosedWithError() -> onRouteClosed

Non-CAF code doesn't have behavioral change.

TBR=mlamouri@chromium.org

Bug: 711860
Change-Id: I501b9c3b94aba4d4a2f900bf8eba9d8b8179ccab
Reviewed-on: https://chromium-review.googlesource.com/1229194
Reviewed-by: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Derek Cheng <imcheng@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592576}
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteManager.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/BaseMediaRouteProvider.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaRouteProvider.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/javatests/src/org/chromium/chrome/browser/media/router/MockMediaRouteProvider.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/junit/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterRouteTest.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProviderTest.java
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/browser/media/android/router/media_router_android.cc
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/browser/media/android/router/media_router_android.h
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/browser/media/android/router/media_router_android_bridge.cc
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/browser/media/android/router/media_router_android_bridge.h
[modify] https://crrev.com/f7521461110ddf1ccda31beecdf43eda18391805/chrome/browser/media/android/router/media_router_android_unittest.cc

Comment 35 by bugdroid1@chromium.org, Sep 19

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/969aaef851b8b365c03d402332cbd84e8d7ea393

commit 969aaef851b8b365c03d402332cbd84e8d7ea393
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Wed Sep 19 23:48:31 2018

[Android MR] Properly handle multiple create route requests

Previously if a new create route request comes in, we didn't
consider the case where there is already a current session or
there is a pending request.

In this CL, when this happens, all active routes will be closed
and the pending request will be canceled, so that the new request
can be fulfilled without interacting with previous
session/requests.

Bug: 711860
Change-Id: I7cef7bf76743d2c122cf07dab0bc80db2871eca5
Reviewed-on: https://chromium-review.googlesource.com/1234794
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592611}
[modify] https://crrev.com/969aaef851b8b365c03d402332cbd84e8d7ea393/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java

Comment 36 by bugdroid1@chromium.org, Nov 10

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/76f7fc6fb8acb5198518f4108ff47308293482dd

commit 76f7fc6fb8acb5198518f4108ff47308293482dd
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Sat Nov 10 05:22:10 2018

Unit tests for BaseSessionController

This CL adds unit tests for BaseSessionController.

Also, when ending session, call SessionManager.endCurrentSession()
instead of selecting the default route. Also the app ID is set to null.

Bug: 711860
Change-Id: I002d69c16b72fd68d5ff9076624c74e63f0b0003
Reviewed-on: https://chromium-review.googlesource.com/c/1317337
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607104}
[modify] https://crrev.com/76f7fc6fb8acb5198518f4108ff47308293482dd/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/76f7fc6fb8acb5198518f4108ff47308293482dd/chrome/android/java_sources.gni
[add] https://crrev.com/76f7fc6fb8acb5198518f4108ff47308293482dd/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java
[add] https://crrev.com/76f7fc6fb8acb5198518f4108ff47308293482dd/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/MediaRouterTestHelper.java
[add] https://crrev.com/76f7fc6fb8acb5198518f4108ff47308293482dd/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/ShadowCastContext.java
[add] https://crrev.com/76f7fc6fb8acb5198518f4108ff47308293482dd/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/ShadowMediaRouter.java

Comment 37 by bugdroid1@chromium.org, Nov 13

Project Member

Comment 38 by bugdroid1@chromium.org, Nov 20

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8979a892a53c9dfe50429e34ad4973287c270bc0

commit 8979a892a53c9dfe50429e34ad4973287c270bc0
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Tue Nov 20 08:11:49 2018

Unit test for CafMediaRouteProvider

This CL adds unit test for CafMediaRouteProvider. Also to clean
up, the provider reads the sink directly from the session
controller when onSessionStarted().

Bug: 711860
Change-Id: I9c4001bc4d6a59f764b71bf90f9fd96761454963
Reviewed-on: https://chromium-review.googlesource.com/c/1339461
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609625}
[modify] https://crrev.com/8979a892a53c9dfe50429e34ad4973287c270bc0/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/8979a892a53c9dfe50429e34ad4973287c270bc0/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/8979a892a53c9dfe50429e34ad4973287c270bc0/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProvider.java
[modify] https://crrev.com/8979a892a53c9dfe50429e34ad4973287c270bc0/chrome/android/java_sources.gni
[modify] https://crrev.com/8979a892a53c9dfe50429e34ad4973287c270bc0/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProviderTest.java
[add] https://crrev.com/8979a892a53c9dfe50429e34ad4973287c270bc0/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/CafMediaRouteProviderTest.java
[add] https://crrev.com/8979a892a53c9dfe50429e34ad4973287c270bc0/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/ShadowCastMediaSource.java

Comment 39 by bugdroid1@chromium.org, Nov 20

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/38a06f637c42f6970d4efd359b9d91835ca001b7

commit 38a06f637c42f6970d4efd359b9d91835ca001b7
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Tue Nov 20 21:17:35 2018

Unit test for CafMessageHandler

Most of the tests are migrated from CastMessageHandlerTest. Some
new tests are added as CafMessageHandler has more methods than
CastMessageHandler:

* testHandleClientConnectMessage*
* testHandleClientDisconnectMessage*
* testHandleClientLeaveSessionMessage*
* testSendReceiverActionToClient
* testBuildSessionMessage*

Bug: 711860
Change-Id: I821bb91f0c685809c143b60cc4700c47ffec16b6
Reviewed-on: https://chromium-review.googlesource.com/c/1343292
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609805}
[modify] https://crrev.com/38a06f637c42f6970d4efd359b9d91835ca001b7/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
[modify] https://crrev.com/38a06f637c42f6970d4efd359b9d91835ca001b7/chrome/android/java_sources.gni
[rename] https://crrev.com/38a06f637c42f6970d4efd359b9d91835ca001b7/chrome/android/junit/src/org/chromium/chrome/browser/media/router/JSONTestUtils.java
[add] https://crrev.com/38a06f637c42f6970d4efd359b9d91835ca001b7/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandlerTest.java
[modify] https://crrev.com/38a06f637c42f6970d4efd359b9d91835ca001b7/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandlerTest.java

Comment 40 by bugdroid1@chromium.org, Nov 27

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2c6d1ac42dd77e95f5a0bd434121b84195d93462

commit 2c6d1ac42dd77e95f5a0bd434121b84195d93462
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Tue Nov 27 06:40:06 2018

[Android MR] Fix a crasher when registering/unregistering callback

The crasher happens when the session is connected/disconnected. The code
registers/unregisters RemoteMediaClient callback upon
connecting/disconnecting. However it should check the availability of
RemoteMediaClient of the current session.

Bug: 711860
Change-Id: Ie4b29f507a0044ac8649b52b37f1541e4dc9b4ee
Reviewed-on: https://chromium-review.googlesource.com/c/1350211
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611030}
[modify] https://crrev.com/2c6d1ac42dd77e95f5a0bd434121b84195d93462/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/2c6d1ac42dd77e95f5a0bd434121b84195d93462/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java

Comment 41 by mfo...@chromium.org, Nov 27

Labels: -Target-71 Target-72

Comment 42 by bugdroid1@chromium.org, Nov 28

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7c453583f0c622cf928bb5d628ae9def8f03279f

commit 7c453583f0c622cf928bb5d628ae9def8f03279f
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Wed Nov 28 00:06:21 2018

[Android MR] Postpone route selection until session launch

Previously, we unselect and re-select the route due to CAF limitation.
The reason is that we need to set the receiver app ID after the user
choose a device. However CAF won't be able to know a device was selected
after the receiver app ID gets changed.

In this CL, to solve the issue, we intercept the click event in
MediaRouteChooserDialog (which would select the route automatically).
The route selection is postponed right before session launch. Therefore
we are able to set the receiver app ID and select the route to get rid
of CAF limitation.

Bug: 711860
Change-Id: I5b1534d36d540b62199a6fb739c56ad5131c2711
Reviewed-on: https://chromium-review.googlesource.com/c/1351893
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611437}
[modify] https://crrev.com/7c453583f0c622cf928bb5d628ae9def8f03279f/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteChooserDialogManager.java
[modify] https://crrev.com/7c453583f0c622cf928bb5d628ae9def8f03279f/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/7c453583f0c622cf928bb5d628ae9def8f03279f/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/BaseMediaRouteProvider.java
[modify] https://crrev.com/7c453583f0c622cf928bb5d628ae9def8f03279f/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java

Comment 43 by bugdroid1@chromium.org, Nov 28

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74e258c6b0861b76fb8a60b6149f30dd50947648

commit 74e258c6b0861b76fb8a60b6149f30dd50947648
Author: Zhiqiang Zhang <zqzhang@chromium.org>
Date: Wed Nov 28 06:05:25 2018

Revert "[Android MR] Postpone route selection until session launch"

This reverts commit 7c453583f0c622cf928bb5d628ae9def8f03279f.

Reason for revert: This introduces some regression in some cases. The old logic works just fine so it is safe to revert.

Original change's description:
> [Android MR] Postpone route selection until session launch
> 
> Previously, we unselect and re-select the route due to CAF limitation.
> The reason is that we need to set the receiver app ID after the user
> choose a device. However CAF won't be able to know a device was selected
> after the receiver app ID gets changed.
> 
> In this CL, to solve the issue, we intercept the click event in
> MediaRouteChooserDialog (which would select the route automatically).
> The route selection is postponed right before session launch. Therefore
> we are able to set the receiver app ID and select the route to get rid
> of CAF limitation.
> 
> Bug: 711860
> Change-Id: I5b1534d36d540b62199a6fb739c56ad5131c2711
> Reviewed-on: https://chromium-review.googlesource.com/c/1351893
> Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
> Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#611437}

TBR=zqzhang@chromium.org,tguilbert@chromium.org

Change-Id: I30322daecf8c866fdda9e846d0cb37d9a319f033
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 711860
Reviewed-on: https://chromium-review.googlesource.com/c/1352973
Reviewed-by: Zhiqiang Zhang <zqzhang@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611572}
[modify] https://crrev.com/74e258c6b0861b76fb8a60b6149f30dd50947648/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteChooserDialogManager.java
[modify] https://crrev.com/74e258c6b0861b76fb8a60b6149f30dd50947648/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/74e258c6b0861b76fb8a60b6149f30dd50947648/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/BaseMediaRouteProvider.java
[modify] https://crrev.com/74e258c6b0861b76fb8a60b6149f30dd50947648/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java

Comment 44 by bugdroid1@chromium.org, Dec 4

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37f67ef488ec98c04f8d2a4c5d5ae78e317b8fca

commit 37f67ef488ec98c04f8d2a4c5d5ae78e317b8fca
Author: Zhiqiang Zhang <zqzhang@chromium.org>
Date: Tue Dec 04 02:37:33 2018

Reland "[Android MR] Postpone route selection until session launch"

This reverts commit 74e258c6b0861b76fb8a60b6149f30dd50947648.

Reason for revert: The previous revert was wrong.
This is still a necessary change

Original change's description:
> Revert "[Android MR] Postpone route selection until session launch"
> 
> This reverts commit 7c453583f0c622cf928bb5d628ae9def8f03279f.
> 
> Reason for revert: This introduces some regression in some cases. The old logic works just fine so it is safe to revert.
> 
> Original change's description:
> > [Android MR] Postpone route selection until session launch
> > 
> > Previously, we unselect and re-select the route due to CAF limitation.
> > The reason is that we need to set the receiver app ID after the user
> > choose a device. However CAF won't be able to know a device was selected
> > after the receiver app ID gets changed.
> > 
> > In this CL, to solve the issue, we intercept the click event in
> > MediaRouteChooserDialog (which would select the route automatically).
> > The route selection is postponed right before session launch. Therefore
> > we are able to set the receiver app ID and select the route to get rid
> > of CAF limitation.
> > 
> > Bug: 711860
> > Change-Id: I5b1534d36d540b62199a6fb739c56ad5131c2711
> > Reviewed-on: https://chromium-review.googlesource.com/c/1351893
> > Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
> > Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#611437}
> 
> TBR=zqzhang@chromium.org,tguilbert@chromium.org
> 
> Change-Id: I30322daecf8c866fdda9e846d0cb37d9a319f033
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 711860
> Reviewed-on: https://chromium-review.googlesource.com/c/1352973
> Reviewed-by: Zhiqiang Zhang <zqzhang@chromium.org>
> Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#611572}

TBR=zqzhang@chromium.org,tguilbert@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 711860
Change-Id: I8bbeeb9e6917e07163bb0fbfacd1fa1c3f762a49
Reviewed-on: https://chromium-review.googlesource.com/c/1359822
Reviewed-by: Zhiqiang Zhang <zqzhang@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613403}
[modify] https://crrev.com/37f67ef488ec98c04f8d2a4c5d5ae78e317b8fca/chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteChooserDialogManager.java
[modify] https://crrev.com/37f67ef488ec98c04f8d2a4c5d5ae78e317b8fca/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/37f67ef488ec98c04f8d2a4c5d5ae78e317b8fca/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/BaseMediaRouteProvider.java
[modify] https://crrev.com/37f67ef488ec98c04f8d2a4c5d5ae78e317b8fca/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java

Comment 45 by bugdroid1@chromium.org, Dec 4

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/451e72b92f8bca9c556edf3b5d5e48e2dd986a49

commit 451e72b92f8bca9c556edf3b5d5e48e2dd986a49
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Tue Dec 04 22:56:23 2018

Several fixes to CAF Remoting MRP

This CL does the following fixes:

* In CafRemoting MRP, return the proper FlingingController.
* When session started, CafRotingMRP should call super.onSessionStarted
  so the notification shows up.
* Cache the stream position when getting the media time. This is because
  when casting is stopped, the native side might have one call to
  GetMediaTime but the Java-side is already teared down.

Bug: 711860
Change-Id: I2295f2cec17d806659a704f248bac060f797bfc3
Reviewed-on: https://chromium-review.googlesource.com/c/1361834
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613738}
[modify] https://crrev.com/451e72b92f8bca9c556edf3b5d5e48e2dd986a49/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafBaseMediaRouteProvider.java
[modify] https://crrev.com/451e72b92f8bca9c556edf3b5d5e48e2dd986a49/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/CafRemotingMediaRouteProvider.java
[modify] https://crrev.com/451e72b92f8bca9c556edf3b5d5e48e2dd986a49/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/FlingingControllerAdapter.java
[modify] https://crrev.com/451e72b92f8bca9c556edf3b5d5e48e2dd986a49/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java

Comment 46 by bugdroid1@chromium.org, Dec 5

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/51ffd9dd31ec60fac22314bb15309e71d19a6726

commit 51ffd9dd31ec60fac22314bb15309e71d19a6726
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Wed Dec 05 23:19:38 2018

Start RemotePlayback from current time (CAF version)

This is the CAF-version of CL https://crrev.com/c/1263615

The original CL description is as follows:

Currently, the new RemotePlayback path always plays videos from the
beginning. It also disregard the current play/pause state and always
autoplays.

This CL fixes both issues by delaying the call to load, until we get our
first seek or play command, and by loading the video with the current
time.

The case when a video that has was never played is cast will be
re-examined in a follow up CL (the user intent when casting a video is
probably to watch it, so it is probably best to start playback, rather
than to force the user to cast and then press play).


Bug: 711860
Change-Id: I8f039f7607519a44712554e2907551d7177c425c
Reviewed-on: https://chromium-review.googlesource.com/c/1363974
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614166}
[modify] https://crrev.com/51ffd9dd31ec60fac22314bb15309e71d19a6726/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/FlingingControllerAdapter.java
[modify] https://crrev.com/51ffd9dd31ec60fac22314bb15309e71d19a6726/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java

Comment 47 by bugdroid1@chromium.org, Dec 7

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/118df4e7ec6d5ce91fd45bddde32c384b6f59c6c

commit 118df4e7ec6d5ce91fd45bddde32c384b6f59c6c
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Dec 07 01:09:55 2018

[Clank MR] Fix several issues in FlingingControllerAdapter

RemoteMediaClient.getApproximateStreamPosition() is expensive for
polling as it has an internal lock. This CL will calculate the
approximate stream position in Clank, so we only read from
RemoteMediaClient upon status update. A new class
(StreamPositionExtrapolator) is migrated from the non-CAF code,
which is used as a helper class for position calculation.

Also the loaded state is cleared if the player state is idle and
finished, which solves the "seek after finished" issue.

Bug: 711860
Change-Id: I95b1fe67f3ae12ef7012c6ce1f5e7fe7af2d13be
Reviewed-on: https://chromium-review.googlesource.com/c/1364065
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614527}
[modify] https://crrev.com/118df4e7ec6d5ce91fd45bddde32c384b6f59c6c/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/FlingingControllerAdapter.java
[add] https://crrev.com/118df4e7ec6d5ce91fd45bddde32c384b6f59c6c/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/StreamPositionExtrapolator.java
[modify] https://crrev.com/118df4e7ec6d5ce91fd45bddde32c384b6f59c6c/chrome/android/java_sources.gni

Comment 48 by bugdroid1@chromium.org, Dec 7

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3f353c8108d3c22e651c2deabc9a1597cbebcc5e

commit 3f353c8108d3c22e651c2deabc9a1597cbebcc5e
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Dec 07 09:43:45 2018

Use separate notification controllers

This CL makes Cast and Remoting have separate notification
controllers so they can behave differently.

Bug: 711860
Change-Id: I8fb5559b86d21678cd2d96c903a22085b08a3860
Reviewed-on: https://chromium-review.googlesource.com/c/1365230
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614650}
[add] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseNotificationController.java
[modify] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafNotificationController.java
[modify] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java
[add] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingNotificationController.java
[modify] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java
[modify] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/java_sources.gni
[modify] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java
[modify] https://crrev.com/3f353c8108d3c22e651c2deabc9a1597cbebcc5e/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/CastSessionControllerTest.java

Comment 49 by bugdroid1@chromium.org, Dec 7

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/06831194ab11bb1b40c0dfe8164084b862458381

commit 06831194ab11bb1b40c0dfe8164084b862458381
Author: Zhiqiang Zhang <zqzhang@chromium.org>
Date: Fri Dec 07 22:39:27 2018

Revert "Use separate notification controllers"

This reverts commit 3f353c8108d3c22e651c2deabc9a1597cbebcc5e.

Reason for revert: Broken build (duplicate files in java_sources.gni)

Original change's description:
> Use separate notification controllers
> 
> This CL makes Cast and Remoting have separate notification
> controllers so they can behave differently.
> 
> Bug: 711860
> Change-Id: I8fb5559b86d21678cd2d96c903a22085b08a3860
> Reviewed-on: https://chromium-review.googlesource.com/c/1365230
> Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
> Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#614650}

TBR=zqzhang@chromium.org,tguilbert@chromium.org

Change-Id: I85c60cd42ec2e5fb269527092bd6b5015f90d523
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 711860
Reviewed-on: https://chromium-review.googlesource.com/c/1368830
Reviewed-by: Zhiqiang Zhang <zqzhang@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614850}
[delete] https://crrev.com/c92f6ff28e1c27cd004201f48fe9e2eb16bbc749/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseNotificationController.java
[modify] https://crrev.com/06831194ab11bb1b40c0dfe8164084b862458381/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/06831194ab11bb1b40c0dfe8164084b862458381/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafNotificationController.java
[modify] https://crrev.com/06831194ab11bb1b40c0dfe8164084b862458381/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java
[delete] https://crrev.com/c92f6ff28e1c27cd004201f48fe9e2eb16bbc749/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingNotificationController.java
[modify] https://crrev.com/06831194ab11bb1b40c0dfe8164084b862458381/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java
[modify] https://crrev.com/06831194ab11bb1b40c0dfe8164084b862458381/chrome/android/java_sources.gni
[modify] https://crrev.com/06831194ab11bb1b40c0dfe8164084b862458381/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java
[modify] https://crrev.com/06831194ab11bb1b40c0dfe8164084b862458381/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/CastSessionControllerTest.java

Comment 50 by bugdroid1@chromium.org, Dec 7

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/22a43f435f72540247fead750ed37b106dc57267

commit 22a43f435f72540247fead750ed37b106dc57267
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Dec 07 23:02:16 2018

Reland "Use separate notification controllers"

This reverts commit 06831194ab11bb1b40c0dfe8164084b862458381.

Reason for revert: Reland after fixing

Original change's description:
> Revert "Use separate notification controllers"
> 
> This reverts commit 3f353c8108d3c22e651c2deabc9a1597cbebcc5e.
> 
> Reason for revert: Broken build (duplicate files in java_sources.gni)
> 
> Original change's description:
> > Use separate notification controllers
> > 
> > This CL makes Cast and Remoting have separate notification
> > controllers so they can behave differently.
> > 
> > Bug: 711860
> > Change-Id: I8fb5559b86d21678cd2d96c903a22085b08a3860
> > Reviewed-on: https://chromium-review.googlesource.com/c/1365230
> > Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
> > Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#614650}
> 
> TBR=zqzhang@chromium.org,tguilbert@chromium.org
> 
> Change-Id: I85c60cd42ec2e5fb269527092bd6b5015f90d523
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 711860
> Reviewed-on: https://chromium-review.googlesource.com/c/1368830
> Reviewed-by: Zhiqiang Zhang <zqzhang@chromium.org>
> Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#614850}

TBR=zqzhang@chromium.org,tguilbert@chromium.org

Change-Id: I8db0f204729cc32d855be8ae6a650fb8643af485
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 711860
Reviewed-on: https://chromium-review.googlesource.com/c/1368587
Reviewed-by: Zhiqiang Zhang <zqzhang@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614860}
[add] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseNotificationController.java
[modify] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafNotificationController.java
[modify] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastSessionController.java
[add] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingNotificationController.java
[modify] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java
[modify] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/java_sources.gni
[modify] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java
[modify] https://crrev.com/22a43f435f72540247fead750ed37b106dc57267/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/CastSessionControllerTest.java

Comment 51 by bugdroid1@chromium.org, Dec 14

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/18e93eba4b54ac5407e2fa31995997759726ecd9

commit 18e93eba4b54ac5407e2fa31995997759726ecd9
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Dec 14 01:06:48 2018

[MediaFling] Add the skeleton of CAF expanded controller

This is part of the ExpandedControllerActivity to CAF
implementation. This CL only checks in the skeleton of the CAF
implementation of the expanded controller activity. The layout is
reused from the ExpandedControllerActivity so there's no UI
change.

The notification controller and the expanded controller activity
are now listeners to BaseSessionController so they both observe
the changes instead of relying on the session controller to
notify them.

The media route button layout is copied from
cast_controller_media_route_button.xml but with a different class
name because FullscreenMediaRouteButton is unsuitable for CAF.

Bug: 711860
Change-Id: I721890fbe159325203bf4368ccfd656db78f60f4
Reviewed-on: https://chromium-review.googlesource.com/c/1370393
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616537}
[modify] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java/AndroidManifest.xml
[add] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java/res/layout/caf_controller_media_route_button.xml
[modify] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseNotificationController.java
[modify] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CafNotificationController.java
[add] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/CafExpandedControllerActivity.java
[modify] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingNotificationController.java
[modify] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java
[modify] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/java_sources.gni
[modify] https://crrev.com/18e93eba4b54ac5407e2fa31995997759726ecd9/chrome/android/junit/src/org/chromium/chrome/browser/media/router/caf/BaseSessionControllerTest.java

Comment 52 by bugdroid1@chromium.org, Dec 14

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2327ba6bcc2c3c84bae2118035c61894835e93d4

commit 2327ba6bcc2c3c84bae2118035c61894835e93d4
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Dec 14 02:35:57 2018

[MediaFling] CAF Expanded controller implementation

This CL fills in the logic of the CAF expanded controller.
Previously the old controller talks via MediaRouter, which is not
recommended in the Cast world. Instead, in this CL, the
controller talks directly to the CastSession/RemoteMediaClient.
Also, the UI logic is greatly simplified due to this.

Bug: 711860
Change-Id: Ib16e1b5271835232fd8c0594c05c18c8a709a3dc
Reviewed-on: https://chromium-review.googlesource.com/c/1370496
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616563}
[modify] https://crrev.com/2327ba6bcc2c3c84bae2118035c61894835e93d4/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseNotificationController.java
[modify] https://crrev.com/2327ba6bcc2c3c84bae2118035c61894835e93d4/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/2327ba6bcc2c3c84bae2118035c61894835e93d4/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/CafExpandedControllerActivity.java
[modify] https://crrev.com/2327ba6bcc2c3c84bae2118035c61894835e93d4/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/FlingingControllerAdapter.java
[modify] https://crrev.com/2327ba6bcc2c3c84bae2118035c61894835e93d4/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/RemotingSessionController.java
[modify] https://crrev.com/2327ba6bcc2c3c84bae2118035c61894835e93d4/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/StreamPositionExtrapolator.java

Comment 53 by bugdroid1@chromium.org, Dec 14

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/35a6a680eb067ee024da00a6f91b44bf58ce1a54

commit 35a6a680eb067ee024da00a6f91b44bf58ce1a54
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Fri Dec 14 19:35:54 2018

[MediaFling] Start a fresh session every time

When flinging videos, we should start a fresh session every time so that
the session state is cleaned up properly and we don't control previous
flinged videos.

Bug: 711860
Change-Id: I6be7e993f60294276e919cf4b2b7f5d19d176b07
Reviewed-on: https://chromium-review.googlesource.com/c/1371012
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616785}
[modify] https://crrev.com/35a6a680eb067ee024da00a6f91b44bf58ce1a54/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/CastOptionsProvider.java

Comment 54 by bugdroid1@chromium.org, Jan 5

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

commit bf528fa82010c9c2360430ac8da9f3f883c0422b
Author: Zhiqiang Zhang <zqzhang@google.com>
Date: Sat Jan 05 00:33:50 2019

[Clank MR] Safely seek in MediaFling to avoid an SDK crash

There was a crash in SDK before version 16.0.2. This CL works around the issue
by generating the low-level message directly.

Bug: 711860
Change-Id: I262143fae845ae6e8d4f9042487f554f7f5d94a1
Reviewed-on: https://chromium-review.googlesource.com/c/1396380
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620125}
[modify] https://crrev.com/bf528fa82010c9c2360430ac8da9f3f883c0422b/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/BaseSessionController.java
[modify] https://crrev.com/bf528fa82010c9c2360430ac8da9f3f883c0422b/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/CafExpandedControllerActivity.java
[modify] https://crrev.com/bf528fa82010c9c2360430ac8da9f3f883c0422b/chrome/android/java/src/org/chromium/chrome/browser/media/router/caf/remoting/FlingingControllerAdapter.java

Comment 55 by zqzh...@chromium.org, Jan 31

Forgot to put the bug number in the CL:

[Clank MR] Remove v2 code for MediaRouter and MediaFling

The v2 code is planned for removal in M74. This CL removes
all the v2 code on the Java side.

Here are the dex and APK size changes in this removal
compared with the migrated code (in parenthesis).

Dex:
  -284 (vs. +100) entries fields
  -680 (vs. +292) entries methods
  -97  (vs. +49) entries types
  -241 (vs. +69) entries strings

Dex file size: -70,38KB (vs. +31.35KB)
Apk size: -36.72KB (vs. +12.88KB)

Change-Id: I084164c9de50ee0be732f56c550d49f798261ad1
Reviewed-on: https://chromium-review.googlesource.com/c/1431017
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#627779}

Sign in to add a comment