When dealing with a pair of hearing aid devices are active,
a single "selected route" is not sufficient.
Instead, this CL introduces activeRoutes which can hold multiple active
bluetooth route and deal with them.
Bug: 152585170
Test: cts tested & manually w/ A2dp BT devices
Change-Id: I2c2b8967d9f221db73f9d3b9332de7c76d07a0f9
Remove todo, audio TV metadata still pending final update for rvc-tv-dev.
AudioDeviceInfo.getEncapsulationModes suppresses return of
AudioTrack.ENCAPSULATION_MODE_NONE.
Test: make docs and check
Bug: 147778408
Change-Id: Ia7da6c3805e42f7a6b9a3b18d44f4c4ef92171a4
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
When an active BT device is changed, instead of just notifying that
the changed BT name, AudioService sometimes notify it with two steps.
1) Notify prev BT disconnected
2) Notify new BT connected
By not calling setBluetoothA2dpOn(false) when BT is disconnected,
we can prvent the unnecessary call of it.
Bug: 144784716
Test: manual
Change-Id: I31442204cd4dd4a78552e0f993e9dfa37d6fc03f
When a route changes its features, the returned getRoutes() can be
changed.
Bug: 159142641
Test: run support v7 demos manually to check onRouteAdded callback is
invoked
Change-Id: Icea855d631a566fd9129f98306e3ea8af4920764
This CL logs transfer between routes to easily track potential bugs.
Selecting a route was also logged in MediaRouter.
It also reverts the log level of SystemMediaRoute2Provider because
we resolved issues related to it.
Bug: 156996903
Test: N/A
Change-Id: I6d7e165a79679305fd21a378fd3ae35b941c17c6
MediaRouter2Managers' preferred feature didn't get cleared even when the
MediaRouter2 is unregistered/died. As a result, when an app is
reinstalled/relaunched, the routes for the previous process are still
shown in the MediaRouter2Manager.
This CL fixes the problem.
Bug: 158824569
Test: Passed CTS and mediaroutertest
Also tested with reinstalling support7Demos.
Change-Id: Ib5d84c41862177af32931e0d69b02f461105bba6
This CL prevents duplicate logs which are printed from
different code locations, which makes investigating future bugs easier.
Also modifies some logs to make them clearer.
Bug: 157873330
Test: Builds successfully
Change-Id: I90ca0e6b46e2b796d069dbecef4a8000cca85b4b
The route ID of a bluetooth route was its hardware address and
SettingsLib depended on that to get BluetoothDevice.
We can't use the address as ID for a pair of hearing devices,
which has their own address but should have the same route ID.
Instead, this CL adds "address" field explictly to be used for bluetooth
routes.
Maybe it can be used by other devices as well.
Bug: 157708273
Test: make -j42 RunSettingsLibRoboTests && cts test
Change-Id: Ib940da9975fc8d68ec3fb7cf2c4a85c0d1a195f3
The audio format doesn't always make sense in recognition events, for
example in a failure or abort event, so we allow it to be null.
However since the SoundTrigger.java API doesn't allow that, we inject
a default if it is not available.
Bug: 157496890
Test: Simulated a device that doesn't support concurrent capture,
reproduced the bug, applied the fix, verified.
Change-Id: I1e4adf9f3ccdc0f62cb9ca5e8c07df3c40a9d2cd
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
Eliminate potential race condition for postEventFromNative.
Fixes: 157755647
Test: atest com.android.car where race condition was hit
Change-Id: I5d11f8769d2c09a6a630332db447302e06a5869b
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
Bug: 149526397
Test: Passed CTS and mediaroutertest
Also checked logs that DEFAULT_ROUTE is not added.
Change-Id: Icc0a5f2ea8f93fd7baba132a9bd4a1f9d798bba9
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
It actually needs the foregroud service to be the type "mediaProjection"
Bug: 157265923
Test: m -j ds-docs-java
Change-Id: Ia5aab928be1755e3117432bdec423e88f997c55b
This CL ignores requests that contain unknown session IDs and
make sure sequence of binder calls are aligned with notifySession
Created/Updated/Released.
Bug: 157873546
Bug: 157873487
Test: Run CTS and atest mediarouter test
Change-Id: Ie31e2fca8160093cf54886180e67d40865a35d6d