In order to allow media router to communicate with the old routing
controller for synchronizing media status during transfer,
this CL postpone releasing the old routing controller.
Basically media router should release the old routing controller by
itself when it's done with the old routing controller.
If it didn't, the old routing controller is automatically released
after timeout (30s for now)
This CL also clarifies "old routing controller" in onTransfer callback.
Now it is consistent regardless of who requested transfer.
A request from MediaRouter2Manager is handled by MediaRouter2 to
simplify session creation logic.
Limitation of this approach is that a routing session unknown to
MediaRouter2 can't be transferred to a different provider but it is out
of R scope so it's okay.
Bug: 158713035
Test: CTS test && atest mediaroutertest && manually transfer using
support v7 demos
Change-Id: I168af69e2a25240227aea0fd9e892eaa91e78ee3
From this CL, even for system routes (phone speaker, bt routes),
features are required to get notified of events on routes or to
get them as "available" routes.
By adding this, apps can disable cast -> phone feature.
Bug: 159090706
Test: cts test && atest mediaroutertest && manually
using support v7 demos such that
with LIVE_AUDIO : nothing changed
w/o LIVE_AUDIO : cast -> phone feature is disabled
unregistering callback : cast -> cast (media transfer) and
phone -> phone is only enabled <- this is
the expected behavior for apps that updates
AndroidX library
Change-Id: I4bd27eb1d4776b9cedb59b10e1bac5868d56d305
The method can be called with a random requestId, or called multiple
times with the valid requestId. It can result unnecessary calls
to MediaRouter2Manager#onRequestFailed().
This CL resolves this problem.
Bug: 157873556
Test: Passes CTS and mediaroutertest
Change-Id: Ia7dd4ddafd532b9f23bf19491a0820d5a74f6a70
Add the callback to let MediaRouter2Manager get notified
of released sessions.
A test is also added to check if the manager is aware of
a released session when the session is released from the
media router.
Bug: 157872573
Test: atest mediaroutertest
Change-Id: Ifb96b23ed61cc15f5015c453727a487c3b09a92b
When a transfer is ignored by the provider.
It is handled as a failure by MediaRouter2Manager.
A test is added for timeout, which takes 30 seconds.
Bug: 157875723
Test: atest mediaroutertest
Change-Id: I3f0ec77551309c96f8f589057800082f6121d4e2
This CL ignores attempts to transfer to unknown route in
MediaRouter2Manager.
This CL also fixes wrong acquisition of locks when getXXXRoutes.
Bug: 157875504
Test: atest mediaroutertest
Change-Id: Ic3415844551c672b42d19d9744d7538a9d7df7c3
This CL adds bug nubmers for TODOs which are needed to resolve in
Android R timeframe.
Bug: 157875570
Test: Builds successfully
Change-Id: I8d5adcabb4ec42feabf38ac3cedcd63e9a5a9cf2
With this CL, some methods such as getAllRoutes, getActiveSessions
can be used without registering a callback.
Bug: 155042836
Test: atest mediaroutertest
Change-Id: Iba38d73a95c1d184bc89ff91d128b00109029d0a
Only selected routes can be deselectable and not selected routes
can be selectable from this CL.
Bug: 154918270
Test: Manually and atest mediaroutertest
Change-Id: I2e66d814190b003c935b21a744d24fa2b5d2c7ac
This metrics now is used for calculating the value reported by
Display#getSize. It could be extended to have more function later.
Also replace getCurrentMetrics usages to make them report
Display#getSize value.
Bug: 148904274
Test: atest WindowMetricsHelperTest
Change-Id: I182b6e63f7c28752eee22839cb9e69f073046c3f
This CL clears routes when the last callback of MediaRouter2Manager
is unregistered. By doing this, we can ensure
MediaRouter2Manager#getAvailableRoutes() returns correct routes
during at least a single callback is registered.
A test for the behavior is added as well.
This CL also fixed a bug that unregistering a callback from MediaRouter2
disconnects it when multiple callback is used.
Bug: 153515567
Test: atest mediaroutertest & cts test & manually
using MediaRouter2Demo and Sample OutputSwitcher to see
if forgotten BT device is correctly removed.
(w/o this CL forgotten BT device remains)
Change-Id: I31a5001115f1f163c8971bbd906516551b860252
When MR2Manager requests to create a routing session, it should pass
session hints to the target provider.
This CL adds a logic that MR2Manager asks media router instance to
get session hints to be passed to the provider.
Bug: 152851868
Test: atest mediaroutertest
Change-Id: Ib421f61f663090c6ed95c8b1a2f7deeb80e5be16
Call MediaRouter2Manager#onTransferred to notify
whether transfer is succeeded or failed.
Bug: 151396145
Test: atest mediaroutertest
Change-Id: I4331c80d03c61b5a722a8be404c979d3fcfa23f1
Use case: Jetpack WM will use them to get the location of windows on
screen and compute the display feature positions in window coordinate
space.
Bug: 150908045
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest CtsWindowManagerDeviceTestCases:WindowMetricsTests
Change-Id: Ia08950cd5df35971408e8b17bb27d97d29d0ab9b
Exempt-From-Owner-Approval: API change
Adding a multi-thread client helps to unveil problems
with concurrent use of VisualizerEffect.
Bug: 149375271
Test: enable "Multithreaded Use" in Visualizer Test
Change-Id: Id485790dc7e91fde5dc5844a287645e96f8ec253
In the core functionality this changes everything including aidl's and
field names:
- Context
- ContentProvider
- AppOps*
- Package parsing
For the rest, this is a shallow change to only change to the changed
APIs. This keeps the change small-ish
Exempt-From-Owner-Approval: Rename
Fixes: 148792795
Test: TH
Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a