Commit Graph

11396 Commits

Author SHA1 Message Date
Santiago Seifert
9cd4601ff1 Merge "Add support for app route listing preferences" 2022-11-25 15:20:09 +00:00
Santiago Seifert
71e5d2f4b6 Add support for app route listing preferences
Test: atest MediaRouter2HostSideTest
Bug: 241888071
Bug: 235352899
Change-Id: Ic9545a035631f2adb79d46e6432356dd7af4f5a0
2022-11-24 16:21:53 +00:00
Alex Dadukin
c4d0c7e513 Merge "Fix issues with nullability contract in MediaRouter2Utils" 2022-11-24 14:41:45 +00:00
TreeHugger Robot
9fcd09ed51 Merge "Audio: Make AudioTimestamp be parcelable" 2022-11-24 04:01:12 +00:00
TreeHugger Robot
2064ae92ad Merge "AudioDeviceVolumeManager and VolumeInfo API changes" 2022-11-24 03:07:56 +00:00
Jean-Michel Trivi
283a4c7153 AudioDeviceVolumeManager and VolumeInfo API changes
Context service name for accessing AudioDeviceVolume manager.
Address API comments on VolumeInfo and AudioDeviceVolumeManager.
Add support in VolumeInfo to know whether it carries an explicit
  mute/unmute information (vs just default value of isMuted()).

Bug: 244326361
Test: atest android.media.audio.cts.AudioDeviceVolumeManagerTest
Test: atest android.media.audio.cts.VolumeInfoTest
Change-Id: Id718fbd7e0d5795ac480d9188faad4a70fba9808
2022-11-23 18:14:47 +00:00
Dorin Drimus
245a606c1d Merge "Audio: Add ENCODING_DTS_HD_MA, ENCODING_DTS_UHD_P2" am: 7edaca37dd am: 41264808de am: 5246e464ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991785

Change-Id: Ie1e5a863c1670a0bd45b8149927eb0d00509e269
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 17:32:27 +00:00
Treehugger Robot
2924b3883f Merge "Fix how ExifInterface creates VP8X chunks for WebP files" am: 7bd2520d4a am: a34879653e am: da79afaad9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2303892

Change-Id: Id9ce00165b7ca57e3ba6e519acf4fbd01c687bbf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 17:14:06 +00:00
Treehugger Robot
01a16c8957 Merge "Prevent ExifInterface incorrectly copying a WebP padding byte" am: efdf0d6cde am: 83df98e8d3 am: 6fb8877809
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2303891

Change-Id: I728b5d4744648687d91e3e447083585141832fc3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 16:37:48 +00:00
Alex Dadukin
093d7d20a9 Fix issues with nullability contract in MediaRouter2Utils
Bug: b/259025372
Test: atest MediaRoute2InfoTest RoutingSessionInfoTest
Change-Id: I3e6de420582db117d7dae6bb460614d27b1b322a
2022-11-23 15:00:56 +00:00
Ivan Chiang
5292504bea Audio: Make AudioTimestamp be parcelable
Test: atest AudioTimestampTest
Bug: 259001306
Change-Id: Ie5702085e072aef85493b697a4b38d71d99452ba
2022-11-23 05:32:55 +00:00
Jean-Michel Trivi
b4509c9ddb Merge "AudioDeviceInfo: add analog audio dock type" 2022-11-23 00:51:25 +00:00
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
Alex Dadukin
a36c5fe4e2 Merge "Rethrow RemoteExceptions from MediaRouter2 instead of logging them" 2022-11-22 14:52:23 +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
Jean-Michel Trivi
ea4bfc1622 AudioDeviceInfo: add analog audio dock type
Introduce TYPE_DOCK_ANALOG.
Fix mappings of TYPE_DOCK to map to a single
 device type, digital dock.

Bug: 253118335
Test: atest android.media.audio.cts.AudioDeviceInfoTest
Change-Id: I160875e74b29739a0232d6a7b833c3927433e067
2022-11-20 21:23:27 +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
Alex Dadukin
317e3b8c11 Re-throw unexpected RemoteExceptions in MediaRouter
This change re-throws exceptions that can only be caused by a dead
system server. We avoid spamming the logs by just re-throwing.
This makes it more clear that the MediaRouter instance does not
end the method execution in a consistent state.

Bug: b/259025372
Test: atest MediaRouterTest
Change-Id: I28dbe7936e199e322dc634a8bcc2206afbc0eaf7
2022-11-18 09:58:31 +00:00
Alex Dadukin
3e6e78b9f0 Rethrow RemoteExceptions from MediaRouter2 instead of logging them
Bug: b/259025372
Test: atest MediaRouter2Test
Change-Id: I90d4197555e37ac5b484b36a594ead4390334e64
2022-11-16 11:02:54 +00:00
Cole Faust
22deef8d08 Merge "[conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc" 2022-11-16 03:17:38 +00:00
David Zhao
9c5ce9d0b4 Merge "Add notifyRecordingStopped API" 2022-11-16 02:22:41 +00:00
David Zhao
2f09f6979f Add notifyRecordingStopped API
Test: atest
Bug: 256713311
Change-Id: I9d8a0e163730bcd88597ebc468bc6ea88929ebdf
2022-11-15 12:55:14 -08:00
Cole Faust
e4abcbec1d [conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I84d67fdfcc99f9f6fca218d4264ab8e0bc1f1653
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:47:41 +00:00
Hongguang Chen
4085006170 Merge "Fix requestFrontend API" 2022-11-15 19:35:06 +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
David Zhao
3d254be3c2 Merge "Add requestStopRecording APIs" 2022-11-15 00:02:18 +00:00
Santiago Seifert
2a1b07f152 Simplify looper selection when instantiating MediaSession
This change essentially replaces new Handler().getLooper() with
Looper.myLooper().

Bug: 205124386
Change-Id: If2d9664d6844cf4fa2cb97b3724854db506985a3
Test: Presubmit.
2022-11-13 19:11:07 +00:00
Iván Budnik
4e72b9846e Merge "Rename selectRoute(String, MediaRoute2Info) to transfer()" 2022-11-11 11:17:46 +00:00
Eric Laurent
4a8b7d7f9b Merge changes from topic "fix-b-255477173-aptx-formats" am: 4872186e0b am: 526354de36 am: a14bf11804
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2277189

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

Change-Id: Idf827b6d59725f901f46ac3186b2c5e0b35f7a20
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 13:31:21 +00:00
David Zhao
08953f55d2 Add requestStopRecording APIs
Bug: 256713311
Test: atest
Change-Id: I007f77f9480546095e98eb17670169b1861685d1
2022-11-09 16:09:30 -08:00
TreeHugger Robot
2d4746d1aa Merge "Reuse ringtone across multiple ringer operations" 2022-11-09 19:26:37 +00:00
Iván Budnik
5bf22a1ffc Rename selectRoute(String, MediaRoute2Info) to transfer()
The new method represents the real underlying operation, which is a
routing session transfer to a different device. The appropriate method
for route selection is selectRoute(RoutingSessionInfo, MediaRoute2Info).

This change is a non-functional refactor.

Bug: 238178508
Bug: 205124386
Test: atest CtsMediaBetterTogetherTestCases MediaDeviceTest
MediaRouter2Manager InfoMediaManagerTest

Change-Id: Ic199686849365138049ccb73189bbc03703117b1
2022-11-09 14:57:47 +00: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
Ray Chin
46c31937d8 Fix requestFrontend API
Bug: 254408478
Test: atest android.media.tv.tuner.cts
Change-Id: I8c19cdd28a3d76ceb1bf5885513a02cbe5a2c29d
2022-11-07 11:09:04 +08:00
David Zhao
bd45073af0 Merge "Unhide notifyRecordingStarted API" 2022-11-03 22:59:03 +00:00
David Zhao
1a77f0874b Merge "Unhide requestStartRecording APIs" 2022-11-03 22:58:00 +00:00
David Zhao
c555dd0189 Unhide notifyRecordingStarted API
Bug: 252888452
Test: atest
Change-Id: Ie40b57389d3f1a03fe098cd17d07286f6bb029ab
2022-11-03 00:35:01 +00:00
Vlad Popa
39ca328582 APC: expose the mute state for system APIs
Add the possibility for system APIs to query if an app is muted and what
are the sources that are muting a specific player/track.

Test: atest android.media.audio.cts.AudioPlaybackConfigurationTest
Bug: 248145607
Change-Id: If40faa860c2663c9ca8436df0e7b8c10464d535b
2022-11-01 20:02:40 +01:00
Vlad Popa
3ddad6750e Adjust the APC active state
Some mute events like master mute and stream mute should not affect the
active state of the AudioPlaybackConfiguration.

Test: atest android.media.audio.cts.AudioPlaybackConfigurationTest
Bug: 246846130
Change-Id: Id7c94fd44cf714d65ef8ae21734af4c2c02ff873
2022-11-01 13:20:47 +01:00