To support AudioTrack builder for compressed audio (e.g. AC3) without
specifiying setBufferSizeInBytes, default the bytesPerSample to 1, and
handle the possible getBytesPerSample exception.
Test: atest AudioTrackTest#testAc3BuilderNoBufferSize
Bug: 169875806
Change-Id: I1b28d94c4dbf3a72e807ef445163e1dd84e4553b
When test the monkey, the mCursor is not null and the mCursor is Closed.
So that the mCursor cannot call the method of moveToPosition. Otherwise
it will lead to StaleDataException.
In order to prevent the android.database.StaleDataException and IllegalStateException,
use the try catch to deal with the StaleDataException and IllegalStateException.
Test:Perform the monkey test, and See if this android.database.StaleDataException will happen again when call the method of android.media.RingtoneManager#getRingtoneUri.
Bug: 169292273
Change-Id: I577c41c6a4b0025ce562a2dc495a6f28b103cfaa
When test the monkey, the mUri is existed to be null pointer high probability.
In order to prevent a null pointer exception, added a judgment condition that the mUri is not null or empty.
Test:Perform the monkey test,and See if this NullPointerException will happen again when call the method of android.media.Ringtone#play.
Bug: 169292270
Change-Id: I7907f0a376d67bb0a0f50ea155e2aa2f4552b1de
This allows headless media applications to access the location if they
have the permission and is needed for AAOS apps in particular.
Bug: 169242810
Bug: 156904507
Test: manual with AAOS Media app
Change-Id: I1196718638fba336a815809578f643814545baf4
When only DisplayName is used to query the default ringtone,
the query may be incorrect, because other types of ringtones
may contain resources with the same name.
It should not happen that other types of ringtone uri are set
as the default ringtone of the current type by mistake.
Test: manual set all types of default ringtones to use the audio
with the same DisplayName as the preset value. See if all types
of ringtones are selected in RingtonePickerActivity.
Bug: 168431815
Change-Id: Iec46c80b1da929cacc0e04fd9641955ce6e8cfcf
Code copied from aosp/1148409 and aosp/1236647 with some minor
changes.
Original commit message:
Added code and test for WebP files
1) with EXIF data
2) without EXIF data but with other extra data
Added code and test for saving EXIF to WebP files without EXIF data
1) and have lossy encoding
2) and have lossless encoding
Also refactored test method names for better readability.
Bug: 138786288
Test: atest CtsMediaTestCases:android.media.cts.ExifInterfaceTest
Change-Id: Ib6319e1b7b6711b071542d94ebfdc4a9f80e9c16
Merged-In: Ib6319e1b7b6711b071542d94ebfdc4a9f80e9c16
This reverts commit 3b25df9ad3.
Reason for revert: potential culprit for test breakage: b/168789394
Change-Id: Ie042b91c189c026079b040f6609df4c22c70f2cf
When only DisplayName is used to query the default ringtone,
the query may be incorrect, because other types of ringtones
may contain resources with the same name.
It should not happen that other types of ringtone uri are set
as the default ringtone of the current type by mistake.
Bug: 168431815
Change-Id: Ic37f879a658379179dc53715fa016631bb7309d9
The package name will be used when starting external vibration. The
package name will be sent to vibrator service to check if the
application has the permission to start vibration,
Bug: 165910728
Bug: 162343845
Test: atest AudioTrackTest MediaPlayerTest
Test: start audio-coupled-haptic playback
Change-Id: I04b4711d11ab5f0f0716ea4c5e1c0f754fe834bb
Merged-In: I04b4711d11ab5f0f0716ea4c5e1c0f754fe834bb
The package name will be used when starting external vibration. The
package name will be sent to vibrator service to check if the
application has the permission to start vibration,
Bug: 165910728
Bug: 162343845
Test: atest AudioTrackTest MediaPlayerTest
Test: start audio-coupled-haptic playback
Change-Id: I04b4711d11ab5f0f0716ea4c5e1c0f754fe834bb
Merged-In: I04b4711d11ab5f0f0716ea4c5e1c0f754fe834bb
MediaProvider added a restriction in R for apps targeting SDK 30 to
not allow .tmp files in image file directories such as "Pictures" and
"DCIM". This CL renames the temp file to avoid this restriction.
Also added test to check for writing to FileDescriptor instances.
Bug: 160874777
Test: atest CtsMediaTestCases:android.media.cts.ExifInterfaceTest
Also tested with an image file inside /Pictures
Change-Id: Iedb548651c0048b0aecc4b34e9c94f778cf5d1e0
(cherry picked from commit 5abacddfc3)
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.
(cherry picked from commit 6239d7ee87)
Bug: 161358428
Test: make flash and boot
Change-Id: I0a39ffc49c0e7e5b36975656a33a2dd2946b60b7
Merged-In: I0a39ffc49c0e7e5b36975656a33a2dd2946b60b7
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)
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
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
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
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