Commit Graph

9000 Commits

Author SHA1 Message Date
Eric Laurent
d77752dbf2 audio: add device definitions for BLE Audio
Add device type enums for BLE Audio.
Device types for BLE audio headset and BLE audio speaker are added
to AudioDeviceInfo class.
Conversions to internal device types are added to AudioSystem.

Bug: 161358428
Test: make flash and boot
Change-Id: I0a39ffc49c0e7e5b36975656a33a2dd2946b60b7
Merged-In: I0a39ffc49c0e7e5b36975656a33a2dd2946b60b7
(cherry picked from commit 6239d7ee87)
2020-08-14 01:09:51 +00:00
Eric Laurent
e502c6aa15 Merge "AudioService: Add metrics for audio mode" into rvc-dev am: 148c8bc210
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12065323

Change-Id: I0c64ec09a72ccf1c781b5652a1cc36508062083c
2020-07-19 17:08:41 +00:00
Eric Laurent
148c8bc210 Merge "AudioService: Add metrics for audio mode" into rvc-dev 2020-07-19 16:46:20 +00:00
Henry Fang
0b7ea54a86 Merge "Fix MediaCas CTS failure TRM is checking input parameters and won't allow null executor. Use context main executor to call Tuner Resource Manager (TRM)" into rvc-dev am: bdc05af123
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12162120

Change-Id: Icdb03ffdb5056b7023a491424c24996fe31ba69b
2020-07-16 19:07:36 +00:00
Eric Laurent
6915e2ff50 AudioService: Add metrics for audio mode
A metrics for audio mode changes and failure to release IN_COMMUNICATION
mode when inactive.

Bug: 153934174
Bug: 161444687
Test: repro steps in Bug and verify logs and metrics
Change-Id: Ib3beab2e8b64e7354ff1a32f04561e7b95f61855
2020-07-16 08:39:22 -07:00
Henry Fang
f0e3e4f470 Fix MediaCas CTS failure
TRM is checking input parameters and won't allow null executor.
Use context main executor to call Tuner Resource Manager (TRM)

Also fix ConcurrentModificationException when use HashMap.forEach to free element in hashmap.

Test: atest MediaCasTest
bug: 161391585
Change-Id: Ie5111b46b5b601f0a5b56e5828d79771e153a210
2020-07-15 19:06:25 -07:00
TreeHugger Robot
bc6f7b7b4f Merge "Add FEATURE_REMOTE_GROUP_PLAYBACK" into rvc-dev am: c0fcd758c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12043613

Change-Id: I7e9e9371b7108f2fa2179bf99f7f21f7670594c9
2020-07-02 01:08:02 +00:00
TreeHugger Robot
c0fcd758c4 Merge "Add FEATURE_REMOTE_GROUP_PLAYBACK" into rvc-dev 2020-07-02 00:47:56 +00:00
TreeHugger Robot
0511013257 Merge "media: clarify keys used for CodecCapabilities.isFormatSupported" into rvc-dev am: db6e11150c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12062381

Change-Id: Ifbc857cb095e937234dc8567137863f2e6a2e054
2020-07-01 23:49:50 +00:00
Lajos Molnar
e167804b42 media: clarify keys used for CodecCapabilities.isFormatSupported
Bug: 159281744
Change-Id: Id93dd2529e468b76bdd01e2a8ebe14b8435a54d7
2020-07-01 14:56:30 -07:00
Kyunglyul Hyun
e44b5a2641 Add FEATURE_REMOTE_GROUP_PLAYBACK
Can be used to distinguish a group route from single device routes

Bug: 160113560
Test: N/A
Change-Id: Id65aded4ce396bbfaec7040fc2227b769f8c5794
2020-07-01 14:07:39 +08:00
TreeHugger Robot
882446d79c Merge "Camera: Clarify timestamp behavior for VIDEO_RECORD usage flag" into rvc-dev am: 26bf8c7aa0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12002522

Change-Id: I2f33806d11d7b7ac91a00a045cc4b420a3e438f1
2020-06-26 16:21:15 +00:00
TreeHugger Robot
26bf8c7aa0 Merge "Camera: Clarify timestamp behavior for VIDEO_RECORD usage flag" into rvc-dev 2020-06-26 16:09:09 +00:00
Jean-Michel Trivi
0039734e58 Merge "AudioAttributes: fix setter for flags" into rvc-dev am: a750903b42
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12003758

Change-Id: I02580d1da80e38850721268ad75a1840bec8c263
2020-06-26 03:50:24 +00:00
Jean-Michel Trivi
a750903b42 Merge "AudioAttributes: fix setter for flags" into rvc-dev 2020-06-26 03:49:30 +00:00
Jean-Michel Trivi
b097d9e1cd AudioAttributes: fix setter for flags
A regression was introduced by d0c4968 which prevented @SystemApi
flags to be set in the builder of an AudioAttributes, causing
FLAG_BYPASS_INTERRUPTION_POLICY and FLAG_BYPASS_MUTE to get
ignored.
Note that even though any client can set System flags, they will
be discarded and ignored server side in the audio policy service if
the caller doesn't have the permissions.

Bug: 154205921
Test: fire alerts with packages/apps/CellBroadcastReceiver/tests/testapp
Change-Id: I9d593787c18a510aa702dc0da85254f0d9574f11
2020-06-26 03:48:35 +00:00
Kyunglyul Hyun
0bfba9c369 Merge "Don't check selectedRoutes of created sesions" into rvc-dev am: bc41b14c58
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11997601

Change-Id: I7e91ac9a422d29ca5be052c6b2929d65e6538be3
2020-06-26 01:53:46 +00:00
Shuzhen Wang
f09a4cdbd6 Camera: Clarify timestamp behavior for VIDEO_RECORD usage flag
Test: make docs and read the doc
Bug: 143240912
Change-Id: I64032c7e2644680888979696968bdebd772530cc
2020-06-25 16:31:14 -07:00
Kyunglyul Hyun
f19e811c88 Don't check selectedRoutes of created sesions
There are cases that a newly create session does not contain
the requested route. (e.g. static group)
This CL removes check that disallowed those cases.

Bug: 159881597
Test: Run CTS, atest mediaroutertest and manually
using support v7 demos, which is edited to call
notifySessionCreated with member routes selected

Change-Id: I30741d2f3587d0fa9ee5a10fdb8fab9e0d82c721
2020-06-25 19:16:45 +09:00
Makoto Onuki
d9bdedcf5b Merge "Remove unnecessarily @System/TestApi annotations" into rvc-dev-plus-aosp 2020-06-24 18:02:52 +00:00
Makoto Onuki
42bec243c0 Remove unnecessarily @System/TestApi annotations
We can't expose APIs if the enclosing class is hidden, so these
annotations are redundant. We need to remove them so that we can enable the
check.

Exempt-From-Owner-Approval:Cherry-pick from goog/master
Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Merged-in: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
Change-Id: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
2020-06-24 18:02:10 +00:00
TreeHugger Robot
308851ebde Merge "Fix CryptoInfo.toString" into rvc-dev am: 4b23ea8b74
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11986780

Change-Id: I87f8b699f8be0c1aaddeed343e88d3d02c4b8e03
2020-06-24 17:01:17 +00:00
TreeHugger Robot
4b23ea8b74 Merge "Fix CryptoInfo.toString" into rvc-dev 2020-06-24 16:58:11 +00:00
Santiago Seifert
3c715d5778 Fix CryptoInfo.toString
It's using the key length when it should use the iv length.

Bug: 154120292
Test: Manually.
Change-Id: I98d71b974688acbeef0c7112298c5edf37d47ef7
2020-06-24 14:58:47 +01:00
Kyunglyul Hyun
e08ef1e658 Merge "MediaRouter: Defer releasing routing controller when transfer" into rvc-dev am: 82ff3f1472
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11593494

Change-Id: I8d6fcaab699f7fa8342206c2a19e247506ec52e3
2020-06-24 06:45:21 +00:00
Kyunglyul Hyun
82ff3f1472 Merge "MediaRouter: Defer releasing routing controller when transfer" into rvc-dev 2020-06-24 06:41:39 +00:00
Madhava Srinivasan
c47c0cc58c Merge "Persisting setDeviceVolumeBehavior calls" into rvc-dev am: d03a59938e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11838112

Change-Id: I72537a3093019228ad8bbd9fd8e6f1ccbc48ff90
2020-06-23 15:06:03 +00:00
Madhava Srinivasan
d03a59938e Merge "Persisting setDeviceVolumeBehavior calls" into rvc-dev 2020-06-23 14:51:38 +00:00
Madhava Srinivasan
b5ed600d41 Persisting setDeviceVolumeBehavior calls
This change does the following
0. Robustly enforce setDeviceVolumeBehavior.
Prior to this change, setDeviceVolumeBehavior could have been overridden
in cases like HDMI_CEC enable/disable, HDMI re-plug, etc.

1. Persist setDeviceVolumeBehavior across AudioService restarts and
system reboots.
Prior to this change, setDeviceVolumeBehavior was lost on AudioService
crash/restart, or system restart.

2. Persist software volume across reboots.
Prior to this change, HDMI_OUT device was initialized as a "Fixed"
Volume device and then updated to either full volume device or
"variable" volume device based on the outcome of HDMI-Sink's CEC
capabilities. However, when connected to a non-CEC capable sink this
would result in audio resetting to 100% on each reboot.

3. Some refactoring around how mFixedVolumeDevices and
mFullVolumeDevices are updated in some instances.

Bug: 153193369
Bug: 155482023
Test: Locally on ADT3
Change-Id: I4adb38c64fe1ae7713992ab83acbd66bce4524a4
2020-06-22 20:22:01 -07:00
Kyunglyul Hyun
6a2f1d67b7 MediaRouter: Defer releasing routing controller when transfer
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
2020-06-23 11:28:35 +09:00
Andy Hung
98ef1743b4 Merge "AudioTrack: Update javadoc" into rvc-dev am: 72998aeaf7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11932147

Change-Id: I372c962a1ff0f3f9e4972998452789cf0edb3fc3
2020-06-22 17:21:50 +00:00
Andy Hung
72998aeaf7 Merge "AudioTrack: Update javadoc" into rvc-dev 2020-06-22 17:15:09 +00:00
Sungsoo Lim
63861415e8 Merge "Prevent unnecessary call of setBluetoothA2dpOn(false)" into rvc-dev am: 7bfb0c31bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11926258

Change-Id: Ie64625601ff92b170ffd6427590c703c5a469fc5
2020-06-22 06:37:59 +00:00
Sungsoo Lim
7bfb0c31bf Merge "Prevent unnecessary call of setBluetoothA2dpOn(false)" into rvc-dev 2020-06-22 06:23:42 +00:00
Kyunglyul Hyun
460ba3e6e5 Merge "System routes are not automatically exposed" into rvc-dev am: c8f4a8a5e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11926262

Change-Id: I0fe1b249c9d186a98f6f68caba88e7642da705b3
2020-06-22 05:06:48 +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
Andy Hung
c1bd8cbfd3 AudioTrack: Update javadoc
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
2020-06-19 18:57:14 -07: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
Sungsoo Lim
0ea65316f4 Prevent unnecessary call of setBluetoothA2dpOn(false)
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
2020-06-19 14:42:08 +09: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