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
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
The hidden API is used by SystemUI process to adjust the system UI based
on when a certain camera is opened or closed.
Test: Manually observe callbacks in SystemUI when running camera CTS
Bug: 150540299
Change-Id: I04cae782d96f0e32be8ef588dcd328f84b32887a
For consistency, this CL applies the same changes also to the
internal methods.
Bug: 150922531
Test: CTS and mediaroutertest (Passed except already failing methods)
Change-Id: Iac0ab78464b16212cb3ad46519f5892e8d1b69d9
In the previous CL, we relied on MediaRouterUtils.getOriginalId()
that returns a wrong ID when it has no provider ID but the separator.
Resolve the issue by resetting route ID in Builder class.
Bug: 150666870
Bug: 150751854
Test: cts test realted to MediaRouter2
Change-Id: Ib17cdc8385308ccadad79e117fcfede72b8af6b5
This CL fixes the issue that RoutingSessionInfo#getSelectedRoutes
return improper route IDs when it is recreated.
To ensure provider ID related feature, another test is added.
Since RoutingSessionInfo#setProviderId is a hidden method, the test
is not added to CTS.
The reason for moving "updating route ID logic" into Builder is from
considering use cases.
The original ID of the route is only checked when the provider ID is
set and a route is added to or removed from a RoutingSessionInfo,
which is very rare case.
This CL also fixes the issue that didn't release the previous routing
session when transfer.
Bug: 150666870
Bug: 150751854
Test: atest mediaroutertest
Change-Id: Ic05c11ebf43562b44214eb661c8b9c106f1c9d3e
As a following CL, RoutingController will be removed.
Instead, MediaRouter2Manager will use RoutingSesionInfo.
This CL adds necessary methods for that.
Added Callback#onTransferred and #onTransferFailed.
Bug: 150571233
Test: atest mediaroutertest
Change-Id: If2c23c483f80b6c93a14d1f1f93dfc40463ede1a
Change deviceType to type and define more types.
TYPE_GROUP is also added to classify static group routes.
Device type for the default route is set from now
Bug: 149677159
Test: cts test and atest mediaroutertest
Change-Id: I0626efe7b6160f22fe69a0b75368ee1a67d8768c
Two set of preferred features could be the same in a different order.
Test: atest mediaroutertest
Bug: 149887171
Change-Id: I10f6878ad42cf49f2337d2d69f884038b144df45
There was a bug that waitAndGetRoutesWithManager returnes
a wrong list of routes that doesn't match the given features.
Test: atest mediaroutertest
Change-Id: Ibd01ba9d20fd5fa922d268998e10b497a88a3b45
Rename APIS related to RoutingController.
Specifically,
- requestCreateController is changed to transferTo, which is the only
way to "transfer" that may or may not create a controller.
- ControllerCallback is split into TransferCallback and
(new) ControllerCallback.
- onControllerCreated and onControllerReleased is merged into
onTransferred(old, new)
Rename APIS related to RoutingController.
Bug: 149185558
Test: atest android.media.cts.MediaRoute2InfoTest
&& atest android.media.cts.MediaRouter2Test
&& atest android.media.cts.RouteDiscoveryPreferenceTest
&& atest android.media.cts.RoutingSessionInfoTest
&& atest android.media.cts.MediaRoute2ProviderServiceTest
&& atest mediaroutertest
Change-Id: I348581be7c0b8537da22da3bc81e2ca31e16203f
Unused sendControlRequest is removed.
According to that, MediaRouter2ManagerTest is a little bit
modified.
Bug: 145487522
Test: atest cts realted to media router 2
Change-Id: I3c2c5d1c2c67a3398a45bb2fab4e90dcf90f627e
It was s/[tT]ransferrable/$1ransferable/g though.
Bug: 149534504
Test: build & atest mr2 related tests
Change-Id: I7b6cbb51993a5f1673e39f590d65e057d9474315