Adding interface for set/remove/getDevicesRoleForStrategy. This will be
used for setting device(s) role, such as preferred, for strategy.
Set/remove/getPreferreDeviceForStrategy are reimplemented by calling
the new interfaces.
Test: atest AudioHostTest
Test: atest AudioServiceHostTest
Test: atest AudioServiceTest
Test: atest audiopolicy_tests
Bug: 160352965
Change-Id: I2ba02c6b50af80846a25010ead05c4ae364868de
Merged-In: I2ba02c6b50af80846a25010ead05c4ae364868de
Due to the limited virtual memory address space it is not practical
to advertise support for more than 4K for 32-bit processes.
Bug: 173488434
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: Ibcd7f70f4efd8d696d831769bafe932207640830
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.
Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas. Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:
-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage
Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance. With this extensive
effort, we've now improved our coverage as follows:
-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage
This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.
Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
audio_policy_configuration.xsd defines strings used by HAL
to represent audio usages. This adds converters between
those strings and the AudioAttributes#attributeUsage values
Bug: 171572311
Test: atest AudioAttributesTest
Change-Id: I5301276ebd6ea1539182e9925a1e19f515e80597
Merged-In: I5301276ebd6ea1539182e9925a1e19f515e80597
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.
Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Merged-In: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
no-op in terms of behavior
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.
sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java
Test: make
Exempt-From-Owner-Approval: No-op change
Merged-In: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
Test: cts builds
Test: the new cts tests run
Bug: 170981222
Reference: I39921ef80c62cc331bb2d72a8d614986d3166eb9
Change-Id: I82d9581c2892eff282de02ce5810cf819a35d1d4
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)