Commit Graph

11073 Commits

Author SHA1 Message Date
Santiago Seifert
ea4e722810 Simplify MediaRouter2Manager.Client's lifecycle
This is a cherrypick of commit 3aa151259c.

Test: atest MediaRouter2ManagerTest
Bug: 239926177
Change-Id: I363dc3918465de7fdb74f833fae78f46bde72a37
Merged-In: I363dc3918465de7fdb74f833fae78f46bde72a37
2022-09-23 22:23:53 +00:00
Santiago Seifert
0952e0377e Remove unnecessary if checks
This is a cherrypick of commit 58fb7d617d.

Bug: 239926177
Test: atest mediaroutertest CtsMediaBetterTogetherTestCases
Change-Id: I8478669747ca291d92b825e205f58add76e9a2a2
Merged-In: I8478669747ca291d92b825e205f58add76e9a2a2
2022-09-23 22:23:53 +00:00
Santiago Seifert
cbca646e97 Manage scan requests in MediaRouter2Manager
This is a cherrypick of commit d9ac018756.

Before this change, MediaRouter2Manager (singleton) does not
protect clients against independent changes to the scanning
state, which means one client can stop the scan while another
needs scanning to go on. After this change, MediaRouter2Manager
keeps count of the calls to request scanning, and will only
request scanning from the system server while there is at least
one active scan request (via registerScanRequest).

This change does not affect MediaRouter2.start/stopScan.

Bug: 232812007
Test: atest CtsMediaBetterTogetherTestCases
Change-Id: I8d80872d7c55791b9a429180da1c68af50ae13b7
Merged-In: I8d80872d7c55791b9a429180da1c68af50ae13b7
2022-09-23 22:23:52 +00:00
Santiago Seifert
0541c4e942 Rethrow MediaRouter2Manager RemoteExceptions
This is a cherrypick of commit 147cb7c877.

Said exceptions mean the system server died, after which
guidance suggests it's not a good idea to silently swallow
said exception. Specially considering the client will be
restarted shortly after the system server dies.

Bug: 232812007
Test: atest MediaDeviceManagerTest MediaDataCombineLatestTest CtsMediaBetterTogetherTestCases
Change-Id: I21a724896684d79097ae74df2d5a54e60514ebdf
Merged-In: I21a724896684d79097ae74df2d5a54e60514ebdf
2022-09-23 19:47:55 +00:00
Wonsik Kim
ba37978035 Merge "MediaCodec: skip index validation at buffer validations" into tm-qpr-dev 2022-09-13 17:22:02 +00:00
Wonsik Kim
b5547085bc MediaCodec: skip index validation at buffer validations
The index validation will happen at the MediaCodec native layer.

Bug: 244121189
Test: atest CtsMediaCodecTestCases
Test: atest CtsMediaDecoderTestCases
Test: atest CtsMediaEncoderTestCases
Test: atest CtsMediaV2TestCases
Merged-In: I1af0cd61ae19e86a115b5e347625b8476440e848
Change-Id: I1af0cd61ae19e86a115b5e347625b8476440e848
2022-09-12 23:05:27 +00:00
TreeHugger Robot
6170285a1a Merge "Fix to allow setting URI without recreating ringtone" into tm-qpr-dev 2022-09-12 21:45:47 +00:00
TreeHugger Robot
e9b5e1d675 Merge "LeAudio: Fix volume control" into tm-qpr-dev 2022-09-12 16:44:36 +00:00
Edgar Arriaga
04432a6405 Fix to allow setting URI without recreating ringtone
This patch splits the behavior of creating the media player
and the uri setter and avoids it from being recreated upon
being retrieved by getRingtone which harms performance
causing a double asset load.

Bug: 240621827
Test: Receive a phone call and verify ringtone works

Change-Id: I91563ddcc94f25911937e9fbb35ff36bbe9d3012
2022-09-09 22:45:54 +00:00
Jakub Tyszkowski
142729a64d LeAudio: Fix volume control
The calculation formula is now set to be the inverse of the one used
in VolumeControlService.java when calculating volume index from the
BLE audio volume level.

This also fixes not using the absolute volume for BLE audio stream,
which could result with very low volume levels at the lower registers
of the volume slider. It was caused by lowering the volume on both
ends. Not transmitting the sound at the maximum volume level could
also reduce the sound quality due to effective sound sample resolution
being lower.

Bug: 238587620
Bug: 241501978
Test: built and manually tested
Tag: #feature
Change-Id: I368c8978be5fbd94b0f62df2551fe179a9f203a0
Merged-In: I368c8978be5fbd94b0f62df2551fe179a9f203a0
(cherry picked from commit 51d75fbc69)
2022-09-09 12:33:18 +00:00
TreeHugger Robot
96ca825746 Merge "Remove support for writing DNG files from ExifInterface" into tm-qpr-dev 2022-09-08 22:49:58 +00:00
Ian Baker
aaaaf27af4 Remove support for writing DNG files from ExifInterface
The DNG support added was incomplete, and results in the input being
overwritten by invalid data.

This is a partial revert of ag/15320526

Bug: 193010735
Bug: 239902748
Test: atest CtsMediaMiscTestCases:ExifInterfaceTest
Change-Id: I492020bc7a9fbaa6a3670c118589173822db0fe1
2022-09-06 16:11:55 +00:00
Andy Hung
bca24335ac Merge "AudioSystem: Fix hdmi name typo" into tm-qpr-dev 2022-08-24 17:12:45 +00:00
TreeHugger Robot
abba82cd9d Merge "RELAND MediaCodec: don't cache buffers until requested" into tm-qpr-dev 2022-08-22 20:13:22 +00:00
Andy Hung
9c31ca9be3 AudioSystem: Fix hdmi name typo
Used for metrics logging.

Test: compiles
Bug: 233773341
Merged-In: I4e2c14f49d96f2bde98b3274233f0dd2083134bb
Change-Id: I4e2c14f49d96f2bde98b3274233f0dd2083134bb
(cherry picked from commit 799bb3e978)
2022-08-22 17:41:33 +00:00
Jean-Michel Trivi
bfe6b27698 Merge "BLE audio: support assigning volume at BLE device connection" into tm-qpr-dev 2022-08-18 21:06:06 +00:00
Jean-Michel Trivi
b2c88cca28 AudioService: properties for configuring ring/notif steps/default vol
Define 4 new properties that can be used to override the default
notification and ringtone volume number of steps and default value.
  Throw IllegalArgumentException when max volume is not strictly
positive, if default volume is greater than max volume or
lower than min volume.

Bug: 228180814
Test: dumpsys audio to check default/max for notif/ring
Change-Id: Ib12fd2207b1201ced4bc838892ed23d10e45c3c9
2022-08-16 19:34:42 +00:00
Wonsik Kim
4a114c2f9c RELAND MediaCodec: don't cache buffers until requested
Do not cache input/output buffers until explicitly requested.

Track validity of buffers before getInput/OutputBuffers so that the
dequeued buffers are marked accessible when the array is returned
to the client.

Bug: 189889230
Bug: 236106096
Test: manual
Merged-In: I6892f02853f00c3e355c827ec943fbdf183469f1
Change-Id: I6892f02853f00c3e355c827ec943fbdf183469f1
2022-08-06 09:18:01 -07:00
Omer Osman
165f760907 Merge "Add support for Opus over A2DP" into tm-qpr-dev 2022-08-04 17:40:20 +00:00
Jean-Michel Trivi
118ca2fc25 AudioDeviceVolumeManager: set volume per device
Add API in AudioDeviceVolumeManager that allows setting
volume for a specific audio device.

Bug: 236764441
Test: atest AudioDeviceVolumeManagerTest
Change-Id: Iebb277b35dbf5aa49c1fd4a8ec6dd904afa11ad9
2022-07-27 19:02:25 +00:00
Jean-Michel Trivi
ff46cdd950 BLE audio: support assigning volume at BLE device connection
Add support for associating an initial volume with a BLE
connection:
- add volume info to BluetoothProfileConnectionInfo in a new
BLE output factory method
- when handling device connection for BLE, also check if
volume information from the connection information is available.

Bug: 233975367
Test: atest frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/BluetoothProfileConnectionInfoTest.java
Change-Id: Ib54267727bc4d47e6999f2b84eab805f23c4955a
2022-07-11 16:41:01 +00:00
Naomi Musgrave
6254236666 [Partial Screenshare] Set WindowContainerToken for task capture
The launch cookie of the target task will be provided by SysUI;
convert this to the WindowContainerToken so the ContentRecorder
can capture the correct layer of the hierarchy.

Bug: 235984372
Test: atest WmTests:WindowManagerServiceTests
Change-Id: I52f69cd078dd5b8ba6cb5b1c292423773dbd8123
2022-06-27 17:52:09 +00:00
Omer Osman
66e4abf7da Add support for Opus over A2DP
This CL add support for Opus as an A2DP codec in Audio Framework and
selection of the codec in Developer Options.

Bug: 226441860
Test: Sink device using bds-dev

Change-Id: I1d68209e8f996e78adeed03b77a3ee9cacda6307
2022-06-21 16:43:05 +00:00
Oliver Woodman
a110072a44 Proactively unparcel bitmaps in MediaMetadata
This ensures that the GC accounts for the underlying allocations

Bug: 215820910
Test: Manual
Change-Id: I6b1d3f17abdb513b1ac929267b3d386326fa83c4
2022-06-16 12:12:42 +00:00
Wonsik Kim
84959301fb Merge "Revert "MediaCodec: don't cache buffers until requested"" into tm-dev 2022-06-14 21:48:41 +00:00
Wonsik Kim
bc7d1172e0 Revert "MediaCodec: don't cache buffers until requested"
This reverts commit d59a075f79.

Reason for revert: regression (see b/235925715)
Fixes: 235925715
Bug: 189889230
Test: manual

Change-Id: I2e52c3abdd13fa0547a510b3599e082e3bff0989
2022-06-14 20:01:22 +00:00
Jakub Tyszkowski
a1728774ae aidl: Fix missing conversion logic for broadcast device
Bug: 234707737
Test: atest AidlConversionUnitTests
Change-Id: I32e2ae9d6d433fb49e76ed3079cf85639eb71486
Merged-In: I32e2ae9d6d433fb49e76ed3079cf85639eb71486
(cherry picked from commit 2d1b9ae095)
2022-06-07 01:22:04 +00:00
Jon Eckenrode
0cfcaa28ee Merge "Revised the API documentation for the getMediaProjection() method." into tm-dev 2022-06-03 23:36:13 +00:00
Lajos Molnar
fee968da45 media: return null when there are no CamcorderProfiles for getAll
The API says that null is returned, but an exception was thrown.

Also correct a misleading word in the getAll description.

Bug: 232286218
Change-Id: Iee336628753fad29bb5fccff211e4997fb51a99b
2022-06-02 15:06:20 -07:00
Henry Fang
9dd35d01f8 Merge "Allow LNB to be opened before Frontend" into tm-dev 2022-05-28 18:43:29 +00:00
joneckenrode
9c28afbf90 Revised the API documentation for the getMediaProjection() method.
Test: Built API documentation
Bug: 233914615
Signed-off-by: joneckenrode <joneckenrode@google.com>
Change-Id: I722d2b0223603b265b68437eea12248b8002b501
2022-05-27 22:01:59 +00:00
Lajos Molnar
894dabfbb2 Merge "media: clarify that MediaFormat.KEY_LEVEL is required when specifying a profile" into tm-dev 2022-05-27 18:54:26 +00:00
Henry Fang
e6983c1f66 Allow LNB to be opened before Frontend
Change-Id: If7e82db95dda80a90767d7808b140ebcb175ab97
bug: 233830709
Test: atest TunerTest.java
2022-05-27 17:47:31 +00:00
TreeHugger Robot
381a3b6691 Merge "media: clarify that flush() is not supported for encoders." into tm-dev 2022-05-26 09:56:47 +00:00
Lajos Molnar
062784a9f2 media: clarify that flush() is not supported for encoders.
Bug: 146022133
Change-Id: If1083bb6c6193b01bdd29e60dfc907df8e052663
2022-05-25 17:11:09 -07:00
Lajos Molnar
2e9d9128de media: clarify MediaFormat.KEY_FRAME_RATE for video encoders
Bug: 228530100
Change-Id: I4fb6d1228f9e84541e2048ac6dfe29d4f8939c02
2022-05-25 15:40:33 -07:00
Lajos Molnar
269a560b37 media: clarify that MediaFormat.KEY_LEVEL is required when specifying a profile
Also further clarify the meaning of level and profile.

Bug: 219899706
Change-Id: Ibf8e821a1c97173521163d7a3bb956d85194048d
2022-05-25 15:34:48 -07:00
TreeHugger Robot
d7d0d4b1ab Merge "MediaCodec: don't cache buffers until requested" into tm-dev 2022-05-23 17:13:42 +00:00
Eric Laurent
e2049a8968 Merge "SpatializerHelper: Deliver metrics to MediaMetrics" into tm-dev 2022-05-23 09:11:41 +00:00
Andy Hung
b71ee9b9c9 SpatializerHelper: Deliver metrics to MediaMetrics
Added minor optimization to prevent unnecessary
spatial device update.

Test: adb shell dumpsys media.metrics
Bug: 203434487
Change-Id: If35ab4362c95b3559567296acc756527eeb42680
2022-05-20 14:05:22 -07:00
Naomi Musgrave
55ecb4ec82 Merge "[Media Projection] Require valid token to set session" into tm-dev 2022-05-20 13:39:48 +00:00
Wonsik Kim
d59a075f79 MediaCodec: don't cache buffers until requested
Bug: 189889230
Test: manual & presubmit
Change-Id: I4caca59d6854416cedb6758fe66aefaacb69beb7
(cherry picked from commit 07358dfea5)
Merged-In: I4caca59d6854416cedb6758fe66aefaacb69beb7
2022-05-19 23:25:27 +00:00
Naomi Musgrave
e3f6b7e16a [Media Projection] Require valid token to set session
When MediaProjection sets the session details in
MediaProjectiondManagerService, clear and re-set the
calling identity (since we have entered the system server
across the aidl boundary).

Additionaly, verify that the call originated from a valid
MediaProjection session. In the current model for
MediaProjection, signature-level permission
MANAGE_MEDIA_PROJECTION is held by the component that shows the
acceptance dialog to the user. The user allowing some app to
capture with MediaProjection is represented by
the IMediaProjection token (see MediaProjectionManagerService#
isValidMediaProjection).

Bug: 230748205
Test: Manual
Change-Id: Iace8eb7eea6c7a99fba7ea726481461a11bd1c90
2022-05-17 22:11:33 +01:00
Yixiao Luo
a021fd7d31 Merge "TIAS:The oneway flag add in ITvInteractiveAppManagerCallback.aidl" into tm-dev 2022-05-13 17:32:44 +00:00
Jean-Michel Trivi
189ce28929 Merge "AudioService: logs for volume behavior and absolute volume on A2DP" into tm-dev 2022-05-12 15:55:48 +00:00
Jean-Michel Trivi
b6562db67a AudioService: logs for volume behavior and absolute volume on A2DP
Bug: 230623091
Test: adb logcat | grep AudioService
Change-Id: Ie8b020d3594399ec56d9f24ba88b325c383f3083
2022-05-11 23:23:37 +00:00
Yan Han
f7b504cece Merge changes I0579b3af,If7ecd588 into tm-dev
* changes:
  Enable volume UI for TVs using Absolute Volume Control.
  Clear listeners when adding a new one in AudioDeviceVolumeManager
2022-05-11 14:16:54 +00:00
Dorin Drimus
929575cf80 Add mention of start threashold in AudioTrack.play()
Expand documentation for AudioTrack.play() to include get and set start
threshold from Android S.

Bug: 192920591
Test: N/A, only changes documentation
Change-Id: Ibb4da2c3f5239b480c49e7bcbaae5b50ef5d01d3
2022-05-10 19:15:16 +02:00
Yixiao Luo
033d9eb954 TIAS:The oneway flag add in ITvInteractiveAppManagerCallback.aidl
Cherry Pick from
https://partner-android-review.googlesource.com/c/platform/frameworks/base/+/2211650/

Bug: 231539756
Test: CtsTvTestCases
Change-Id: I0ea1c5f207617de0e5ae1ea91f4b756240d92371
2022-05-10 10:13:52 -07:00
Yan Han
dcfe66fda1 Clear listeners when adding a new one in AudioDeviceVolumeManager
Currently, multiple absolute volume listeners from the same controller
can be notified of volume change events because old ones are not removed
from AudioDeviceVolumeManager.

This CL removes existing listeners for a device when a new one is added.
We also no longer forbid re-adding a listener currently in
AudioDeviceVolumeManager's list, as it might have been removed from
AudioService.

Bug: 231433390
Test: manual; atest android.hdmicec.cts.playback.HdmiCecAvcToTvTest
Change-Id: If7ecd58880001b955565e0f65ede9f0787e1be49
2022-05-09 13:42:39 +02:00