Commit Graph

8964 Commits

Author SHA1 Message Date
Kyunglyul Hyun
d7243c4e39 Merge "System routes are not automatically exposed" into rvc-dev am: c8f4a8a5e9 am: 387622bd1d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11926262

Change-Id: I06577d65a4f57e14fccddf90312be4054cb9b3ce
2020-06-22 05:21:00 +00:00
Kyunglyul Hyun
c8f4a8a5e9 Merge "System routes are not automatically exposed" into rvc-dev 2020-06-22 04:52:17 +00:00
Kyunglyul Hyun
4d65a4c37d Merge "Handle multiple active bluetooth devices" into rvc-dev am: 4b6472722e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11947520

Change-Id: Ie1c4577698aab165e330516fad841641720b5293
2020-06-22 04:41:58 +00:00
Kyunglyul Hyun
e1b8006e2b Handle multiple active bluetooth devices
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
2020-06-21 21:51:44 +09:00
Kyunglyul Hyun
c036350122 System routes are not automatically exposed
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
2020-06-19 22:54:59 +09:00
TreeHugger Robot
4c42e15d75 Merge "Fix MediaEvent release issue" into rvc-dev am: c266b0398e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11897358

Change-Id: Ib2994c8d94092733733254d92d9a5ef3238f6e6f
2020-06-19 07:47:17 +00:00
TreeHugger Robot
c266b0398e Merge "Fix MediaEvent release issue" into rvc-dev 2020-06-19 07:29:26 +00:00
Kyunglyul Hyun
bbc25f43d9 Merge "Log transferring and fix verbose system logs" into rvc-dev am: 6edbf48c2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862403

Change-Id: Ia5f92588f94f0150342e1a2f7233b3ff20b096f3
2020-06-19 04:42:53 +00:00
Kyunglyul Hyun
6edbf48c2b Merge "Log transferring and fix verbose system logs" into rvc-dev 2020-06-19 04:32:01 +00:00
Kyunglyul Hyun
89aa71b0bd Merge "Refresh mFilteredRoutes when routes are changed" into rvc-dev am: 099818be0e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882563

Change-Id: I2b06d00344f29318e1869b313b4cb3b5419fde77
2020-06-18 02:52:50 +00:00
shubang
c84fe12f1d Fix MediaEvent release issue
Bug: 158876323
Test: make;
Change-Id: Idedf41620b5a32ca552836d00b1db78adcfd1a7f
2020-06-17 14:57:10 -07:00
Kyunglyul Hyun
f9ad0f6e3c Refresh mFilteredRoutes when routes are changed
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
2020-06-17 20:29:04 +09:00
Kyunglyul Hyun
a464837e48 Log transferring and fix verbose system logs
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
2020-06-17 13:54:06 +09:00
Hyundo Moon
1fc4363546 Merge "Clear preferred feature when unregistering MediaRouter2" into rvc-dev am: e7ae494759
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11846909

Change-Id: Ifed92665230b5ff5defe4a53bcd8ec768af592ab
2020-06-15 09:45:58 +00:00
Hyundo Moon
ac9df100f5 Clear preferred feature when unregistering MediaRouter2
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
2020-06-12 21:01:56 +09:00
TreeHugger Robot
b8e0bafbd5 Merge "Reset app routes when global a2dp state changed" into rvc-dev am: 70b9d348eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11833779

Change-Id: If3a14335833a78b0306d0f3fa9bcdd15820697c1
2020-06-12 07:02:56 +00:00
TreeHugger Robot
70b9d348eb Merge "Reset app routes when global a2dp state changed" into rvc-dev 2020-06-12 06:37:46 +00:00
Hyundo Moon
a6760a6ce0 Merge "MediaRouter2: Prevent printing same logs from different lines" into rvc-dev am: 6d8d91dcfb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11835420

Change-Id: Ifcdc722cd1a581846012a0406f04821e8f398d1a
2020-06-12 05:31:32 +00:00
Hyundo Moon
6d8d91dcfb Merge "MediaRouter2: Prevent printing same logs from different lines" into rvc-dev 2020-06-12 05:23:25 +00:00
Sungsoo Lim
07e40316f8 Reset app routes when global a2dp state changed
Bug: 156549746
Test: manual
Change-Id: I8985136220c9cb96bd4da013653a69f12bfbb6b1
2020-06-12 12:13:08 +09:00
Hyundo Moon
369be956e0 MediaRouter2: Prevent printing same logs from different lines
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
2020-06-12 11:28:13 +09:00
Kyunglyul Hyun
60031d4eb4 Merge "Add address to MediaRoute2Info" into rvc-dev am: 55e5ac8fc0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11822778

Change-Id: I01d880fb5fa471b6b7e80cb97906dede5c43d4b4
2020-06-11 10:56:05 +00:00
Kyunglyul Hyun
55e5ac8fc0 Merge "Add address to MediaRoute2Info" into rvc-dev 2020-06-11 10:53:55 +00:00
Hyundo Moon
49b01ec14c Merge "Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()" into rvc-dev am: f3ff3de37e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788495

Change-Id: I8fd3f269be7d0224ba83b0fd83a5ea13b27a624b
2020-06-11 01:15:14 +00:00
Hyundo Moon
f3ff3de37e Merge "Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()" into rvc-dev 2020-06-11 01:10:25 +00:00
Ytai Ben-tsvi
72daaeb263 Merge changes Ibf4ecdb4,I1e4adf9f into rvc-dev am: 3917b729a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11815381

Change-Id: I6fec22000cbf048a1532afe951c5e2f7b495c921
2020-06-10 19:38:52 +00:00
Ytai Ben-tsvi
3917b729a6 Merge changes Ibf4ecdb4,I1e4adf9f into rvc-dev
* changes:
  Correctly propagate service state change
  Support null audio format in recognition event
2020-06-10 19:31:42 +00:00
Kyunglyul Hyun
1ea19b1d01 Add address to MediaRoute2Info
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
2020-06-10 20:59:15 +09:00
Ytai Ben-Tsvi
7caef40ad0 Support null audio format in recognition event
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
2020-06-09 16:05:19 -07:00
Hyundo Moon
9b5e3923d1 Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()
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
2020-06-09 19:12:30 +09:00
Hyundo Moon
84a06dbe0b Merge "MediaRouter2: Add missing synchronized(sRouterLock) block" into rvc-dev am: 5aacc569c7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11782206

Change-Id: I5cb99d76f8f7e38a6f3a03b18ec948c00bf34799
2020-06-09 06:44:30 +00:00
Hyundo Moon
5aacc569c7 Merge "MediaRouter2: Add missing synchronized(sRouterLock) block" into rvc-dev 2020-06-09 06:40:51 +00:00
TreeHugger Robot
b18e625b5b Merge "Add MediaRouterManager.Callback#onSessionReleased" into rvc-dev am: 2950ebf07d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11733425

Change-Id: I720ea5577814b17bfcfc705585af154566367a59
2020-06-09 06:21:39 +00:00
TreeHugger Robot
2950ebf07d Merge "Add MediaRouterManager.Callback#onSessionReleased" into rvc-dev 2020-06-09 06:10:19 +00:00
Kyunglyul Hyun
fe7b5b125b Add MediaRouterManager.Callback#onSessionReleased
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
2020-06-09 13:13:30 +09:00
Hayden Gomes
98989f06d1 Merge "Adding lock to sendEventFromNative" into rvc-dev am: 50980050a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11720016

Change-Id: I25f6ccaf6adca626b32d83b366984f69654fd71c
2020-06-08 16:11:24 +00:00
Hayden Gomes
50980050a6 Merge "Adding lock to sendEventFromNative" into rvc-dev 2020-06-08 16:02:49 +00:00
TreeHugger Robot
710ada644e Merge "Ignore transfer to an unknown route" into rvc-dev am: e3767bdaae
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11700107

Change-Id: I5a6985ebb8a40fafe32d2a45cfd3baffe9868a83
2020-06-08 11:49:04 +00:00
TreeHugger Robot
240637a450 Merge "Notify a failure on transfer timeout" into rvc-dev am: 6b1cfced63
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11716082

Change-Id: I4c6ba02ea002b1790be2de1c652416548010c7c1
2020-06-08 11:48:27 +00:00
TreeHugger Robot
e3767bdaae Merge "Ignore transfer to an unknown route" into rvc-dev 2020-06-08 11:34:35 +00:00
TreeHugger Robot
6b1cfced63 Merge "Notify a failure on transfer timeout" into rvc-dev 2020-06-08 11:34:13 +00:00
Hyundo Moon
23a9e17874 MediaRouter2: Add missing synchronized(sRouterLock) block
Bug: 157873496
Test: Builds successfully
Change-Id: I87882c642bcdd93a2fedd9ad2c6c5dc54eada598
2020-06-08 15:48:56 +09:00
Hyundo Moon
d35c1381c7 Merge "MediaRouter2: Sync routes when first RouteCallback is registered" into rvc-dev am: ebb7ae6679
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11733427

Change-Id: I0fcbf3c186f7d3647d0e08fb64492e03c8bd1ae7
2020-06-08 06:20:54 +00:00
Hyundo Moon
ebb7ae6679 Merge "MediaRouter2: Sync routes when first RouteCallback is registered" into rvc-dev 2020-06-08 06:07:31 +00:00
Hayden Gomes
14e3bd0c3e Adding lock to sendEventFromNative
Eliminate potential race condition for postEventFromNative.

Fixes: 157755647
Test: atest com.android.car where race condition was hit
Change-Id: I5d11f8769d2c09a6a630332db447302e06a5869b
2020-06-05 10:15:42 -07:00
Kyunglyul Hyun
8df5fb6e7d Notify a failure on transfer timeout
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
2020-06-05 18:22:42 +09:00
Hyundo Moon
bc63327359 MediaRouter2: Sync routes when first RouteCallback is registered
Bug: 149526397
Test: Passed CTS and mediaroutertest
      Also checked logs that DEFAULT_ROUTE is not added.
Change-Id: Icc0a5f2ea8f93fd7baba132a9bd4a1f9d798bba9
2020-06-05 17:38:04 +09:00
Automerger Merge Worker
7daf2ca947 Merge "Merge "Fix TvRecordingClient api issues" am: cce2ca958e am: f7cbbae9e4" into rvc-dev-plus-aosp am: 14bd7ccbb0 am: f9061f953d am: 4276a00208
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/972628

Bug: 134042967

Change-Id: Ib3ca9467b68563383fef4dbc0f11b0f4aa8fd111
(cherry picked from commit 69244518dd)
2020-06-05 05:01:31 +00:00
Jay Patel
9619c74c12 Merge "Fix TvRecordingClient api issues" am: cce2ca958e am: f7cbbae9e4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/972628

Change-Id: Ibea39cfbea0ebdd4d1bd087d9faccb5847d45d4b
2020-06-05 03:35:36 +00:00
Jay Patel
f7cbbae9e4 Merge "Fix TvRecordingClient api issues" am: cce2ca958e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/972628

Change-Id: Idf510533785e6bd513480c283648666c29ec7847
2020-06-05 03:16:30 +00:00