Commit Graph

11148 Commits

Author SHA1 Message Date
Dorin Drimus
41264808de Merge "Audio: Add ENCODING_DTS_HD_MA, ENCODING_DTS_UHD_P2" am: 7edaca37dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991785

Change-Id: I8d23b935fe5976e72372671fc5ffa9a01ae2a8e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-22 14:57:06 +00:00
Dorin Drimus
7edaca37dd Merge "Audio: Add ENCODING_DTS_HD_MA, ENCODING_DTS_UHD_P2" 2022-11-22 14:28:45 +00:00
Treehugger Robot
a34879653e Merge "Fix how ExifInterface creates VP8X chunks for WebP files" am: 7bd2520d4a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2303892

Change-Id: Ib1901b38dc8f9b91b41f6841608b945d92404b47
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-22 11:42:00 +00:00
Treehugger Robot
7bd2520d4a Merge "Fix how ExifInterface creates VP8X chunks for WebP files" 2022-11-22 11:38:23 +00:00
Treehugger Robot
83df98e8d3 Merge "Prevent ExifInterface incorrectly copying a WebP padding byte" am: efdf0d6cde
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2303891

Change-Id: I22a4922d790e3ead2776b541bc96bd0d6758917f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-22 06:19:21 +00:00
Treehugger Robot
efdf0d6cde Merge "Prevent ExifInterface incorrectly copying a WebP padding byte" 2022-11-22 05:37:13 +00:00
Rakesh Kumar
0d30ebcac2 Fix how ExifInterface creates VP8X chunks for WebP files
The current code reads alpha into an int, doesn't shift it back to the
least-significant-bit, and then shifts that value 4 more bits before
writing to the VP8X 'flags' byte. This results in setting the MSB of the
flags byte, which is a reserved bit that must always be zero, resulting
in an invalid file.

VP8X part of WebP spec:
https://developers.google.com/speed/webp/docs/riff_container#extended_file_format

Test: ExifInterfaceTest (after removing the suppression for this bug)

Bug: 253622642
Change-Id: I42469a479c94442eb395124c4eac174bd9ab6e09
2022-11-20 05:44:38 +00:00
Rakesh Kumar
e3e6fa1ecc Prevent ExifInterface incorrectly copying a WebP padding byte
When skipping over the EXIF chunk in the input file (and writing a new
EXIF chunk to the output based on the internal Exif data of the class),
it's important to skip both the chunk and any trailing padding byte (if
the chunk size is odd).

Without this fix the output of saveAttributes may be invalid (not
decodable with BitmapFactory.decodeFile).

Test: Added tests to ExifInterfaceTest to check the output of
saveAttributes is always parsable with BitmapFactory.

Bug: 253622642

Change-Id: I6b7c4612b830dbf95a12c42eac5d6301dfb15104
2022-11-20 10:46:37 +05:30
Rahul
9c85cfc37e Audio: Add ENCODING_DTS_HD_MA, ENCODING_DTS_UHD_P2
The DTS codec capability in sink devices can be DTS Digital Surround,
DTS HD, DTS HD Master Audio (Lossless), DTS:X Profile 1,
or DTS:X Profile 2.

The AudioFormat class already supports ENCODING_DTS, ENCODING_DTS_HD,
and ENCODING_DTS_UHD compressed formats. To distinguish all the
five categories of DTS codec capabilities, two more compressed
formats need to be added in AudioFormat class.

 - The ENCODING_DTS_HD_MA format represents codec capability for
   DTS HD Master Audio (both w/core and coreless lossless)

 - The ENCODING_DTS_UHD_P1 format represents DTS:X Profile 1
   codec capability and is the same as existing ENCODING_DTS_UHD

 - The ENCODING_DTS_UHD_P2 format represents DTS:X Profile 2
   codec capability

The codec capability represented by the existing formats are:

 - ENCODING_DTS is for DTS Digital Surround

 - ENCODING_DTS_HD is for DTS HD (DTS 8Ch Discrete, DTS High Resolution,
   DTS Express)

 - ENCODING_DTS_UHD is for DTS:X Profile 1

Test: atest AudioFormatTest
Change-Id: Id4d332cc75beee40cfe8637a4ecef18a0d2a0908
2022-11-18 14:40:22 +00:00
Cole Faust
f9df26ae3c Merge "Fix errorprone warnings that should be errors" am: 677d6cd780
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I0e9c5077610407a117ee34ff688b40b52e161a03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:11:55 +00:00
Cole Faust
7da659bb6c Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
2022-11-14 17:57:30 -08:00
Eric Laurent
526354de36 Merge changes from topic "fix-b-255477173-aptx-formats" am: 4872186e0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2277189

Change-Id: Id3f6cf75875bc9bcb799b1822c5cf7c36cda2348
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 09:11:30 +00:00
Mikhail Naganov
cae458e44a AudioSystem: add missing native audio formats am: 9b914446d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2277188

Change-Id: I0467ac32b1bfb02707484945b74de01a8abe8b02
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 09:11:21 +00:00
Mikhail Naganov
72eb0b689c AudioSystem: Add AUDIO_FORMAT_APTX_ADAPTIVE_{QLEA|R4}
This adds new flavors of the APTX codec.

Bug: 255477173
Test: m
Change-Id: I600496f857cb290ff8b279ba6791622e458a209f
2022-11-08 19:00:04 +00:00
Mikhail Naganov
9b914446d3 AudioSystem: add missing native audio formats
Add missing native audio formats to audioFormatToString.

Bug: 255477173
Test: m
Change-Id: I4f13e7527ad407b0141cb4895083abc0e5b33df2
2022-11-08 18:58:46 +00:00
Darwin Huang
d2667447f7 Merge "AudioManager: Remove no-longer-relevant error message" am: 08f4332515
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2264344

Change-Id: I635dd1cb1df351bda7265bc93b09d558cc7ee0c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-21 21:09:03 +00:00
Darwin Huang
bb11173147 AudioManager: Remove no-longer-relevant error message
Bug: http://b/254647699
Change-Id: I1059ed8594a0a4a2737f6df1909f1f3bf6840d91
2022-10-21 13:18:49 +00:00
Ian Baker
8640d2a406 Merge "Clarify that MediaCrypto.setMediaDrmSession cannot switch DRM schemes" am: 258d8f6321
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2260581

Change-Id: I7cc050ac65a21bc96e0ffdb8714b2f9a96783b5c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-19 10:49:07 +00:00
Ian Baker
07f35e7e2b Clarify that MediaCrypto.setMediaDrmSession cannot switch DRM schemes
Bug: 244832508
Change-Id: I88cf4936554731354e326890ea7b66143c8d7c15
2022-10-18 17:03:31 +00:00
Treehugger Robot
f56c5cc599 Merge "Add graphics owners for Image, ImageReader and ImageWriter files." am: 624fe54fb3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2258322

Change-Id: I00d79cc443afc009005c28883f3267703d749e7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-17 23:39:50 +00:00
Sally Qi
97f5fba010 Add graphics owners for Image, ImageReader and ImageWriter files.
Change-Id: Ia4b4560685f2ee5401e90a6b476bdbe6cf8f81c6
2022-10-17 21:17:42 +00:00
Xin Li
92da83812c Merge "Merge tm-qpr-dev-plus-aosp-without-vendor@9129937" into stage-aosp-master 2022-10-11 17:39:41 +00:00
Treehugger Robot
f9a1e3c913 Merge "MediaMuxer: throw exception if create() fails for muxer" 2022-10-10 17:53:56 +00:00
Manisha Jajoo
29eda3fb1e MediaMuxer: throw exception if create() fails for muxer
This patch also updates the documentation for MediaMuxer()

Bug: 146417874
Test: atest CtsMediaV2TestCases:MuxerTest
Test: atest CtsMediaV2TestCases:MuxerUnitTest
Test: CtsMediaMuxerTestCases

Change-Id: Ia07a7e6864d6c27476b960069a6f4e8ac0de8255
2022-10-07 16:07:20 +00:00
TreeHugger Robot
ad53d223ad Merge changes I363dc391,I84786697,I8d80872d,I4d6aa4d7,I396d376a into tm-qpr-dev am: 5926e155a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20024534

Change-Id: Icc174a17ed177b3d88fce78eda3432f9db5a51ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-24 00:54:16 +00:00
Santiago Seifert
4f20fc8fbe Remove unnecessary if checks am: 0952e0377e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20024533

Change-Id: I5ceaa149be65c7032f3f984446a8aaba034aa349
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-24 00:54:06 +00:00
Santiago Seifert
783ed3f0a2 Manage scan requests in MediaRouter2Manager am: cbca646e97
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20024532

Change-Id: I551f78055c3081a03e26ec4bac7e5f3321f0af24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-24 00:53:37 +00:00
Santiago Seifert
006c51319f Rethrow MediaRouter2Manager RemoteExceptions am: 0541c4e942
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20008346

Change-Id: I6d54f53b7b2c3471adca472b8b2fe31145c29ed6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-23 22:34:41 +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
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
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
Treehugger Robot
4e5b113d70 Merge "Change 'HDMI' on music notification panel UI to 'External Device'" am: 96c760a013 am: 3d184790df am: caa3fac6b6 am: 54f6da707a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2221103

Change-Id: Ibe39f658c83b414b227c747e1d2fd80e44c88a2b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 17:26:31 +00:00
Treehugger Robot
caa3fac6b6 Merge "Change 'HDMI' on music notification panel UI to 'External Device'" am: 96c760a013 am: 3d184790df
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2221103

Change-Id: If0fea085f33dde8c571396848a152bb71b6a3af3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 15:49:31 +00:00
Alex Dadukin
376bae463a Change 'HDMI' on music notification panel UI to 'External Device'
- 'HDMI' was replaced with 'External Device'
- resource 'default_audio_route_name_hdmi' was renamed to
  'default_audio_route_name_external_device'

This is a cherry-pick of changes from ag/19927045.

Bug: b/233323666
Test: Tested manually by replacing text in UMO's chip
Change-Id: I8178ab2c27b1ec1e4bbcfc244611190593d5d836
(cherry picked from commit 8b59d645f2)
Merged-In: I8178ab2c27b1ec1e4bbcfc244611190593d5d836
2022-09-20 14:06:53 +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
Wonsik Kim
a9cb0d623a 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
Change-Id: I1af0cd61ae19e86a115b5e347625b8476440e848
2022-09-12 23:02:58 +00:00
Wonsik Kim
5c8f80f756 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
(cherry picked from commit 4a114c2f9c)
2022-09-12 23:01:05 +00:00
TreeHugger Robot
e7eef125bf Merge "Fix to allow setting URI without recreating ringtone" into tm-qpr-dev am: 6170285a1a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19867851

Change-Id: I20a2b0e8e77d32ea90ec833990adb0589d61da71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 22:09:34 +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
Andy Hung
a9ffc452b8 Merge "AudioSystem: Fix hdmi name typo" am: a9739b791d am: e5fbf2627a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2212735

Change-Id: I560fac2de13f3d55347a787acfe392a178019b67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 18:16:36 +00:00
Andy Hung
a9739b791d Merge "AudioSystem: Fix hdmi name typo" 2022-09-09 17:13:12 +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
Jack He
30060bfa6f Merge "LeAudio: Fix volume control" am: 0075e9935d am: 5a664a3a71 am: 417a10f9cf am: 4315a6f223
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2203775

Change-Id: I600bd7fa6ffa37914135b21baf3e35a6200f4cc2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 08:07:13 +00:00
Jack He
417a10f9cf Merge "LeAudio: Fix volume control" am: 0075e9935d am: 5a664a3a71
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2203775

Change-Id: I79aa22799b62b43926c9217c527ef13613899658
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 07:14:45 +00:00
TreeHugger Robot
138ca58710 Merge "Remove support for writing DNG files from ExifInterface" into tm-qpr-dev am: 96ca825746
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19867204

Change-Id: I7106feefe3a9ac6923ec5dca29909065ad5e8b84
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 23:17:25 +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