Use weak reference in the tables to allow objects released by caller
bug: 174685399
bug: 174711353
Test: manual
Change-Id: I760d0a77ad9efe2709a14f0fb8a669f8f16652e1
Merged-In: I760d0a77ad9efe2709a14f0fb8a669f8f16652e1
Allow scan again if callback and executor are same as before.
bug: 173239634
Test: atest -c TunerTest
Change-Id: Iec5ba453b3d3d40c0d96fda5c7288b79898d9aea
Merged-In: Iec5ba453b3d3d40c0d96fda5c7288b79898d9aea
Replaced use of forced usage for communication by set preferred device
for strategy to control communication route in audio policy manager.
Also do not use forced usage for record which was redundant with forced
usage for communication.
Bug: 161358428
Test: audio smoke tests
Change-Id: I665257fc5903b663096104b0424781d9799635a5
Merged-In: I665257fc5903b663096104b0424781d9799635a5
Add new APIs to manage the audio device used for communication
use cases (Cellular calls, VoIP and Video calls).
These APIs are meant to replace specific APIs like setSpeakerPhoneOn()
and provide a single generic way of configuring the audio device selected
for calls.
They will be used for newly added device types (e.g. BLE audio) instead
of adding new specific APIs.
They will also offer more options like for instance allowing to select the
earpiece (handset) device when a wired headset is connected.
The new APIs are:
- boolean setDeviceForCommunication(AudioDeviceInfo)
- void clearDeviceForCommunication()
- AudioDeviceInfo getDeviceForCommunication()
A listener is also added for applications to monitor current communication
device selection:
- OnCommunicationDeviceChangedListener
As well as listener registration and unregistration APIs:
- addOnCommunicationDeviceChangedListener()
- removeOnCommunicationDeviceChangedListener()
Bug: 161358428
Test: make && atest AudioCommunicationDeviceTest
Change-Id: I8028d842e4a8ca1abe0f87d03e3c5d57c46b9362
Merged-In: I8028d842e4a8ca1abe0f87d03e3c5d57c46b9362
Support set/clear/get preferrd device for capture preset. The preferred
device will be used for audio routing when it is availabled. The
preferred device doesn't need to be present when setting.
Bug: 160352965
Test: atest AudioServiceTest
Test: atest AudioServiceHostTest
Test: atest CarAudioZonesHelperTest
Change-Id: Ib7aa142ad4c56a8138c7b440e8efbbf7a7ee38a6
Merged-In: Ib7aa142ad4c56a8138c7b440e8efbbf7a7ee38a6
Add OWNERS file to services/tests/servicestests/src/com/android/server/audio
and add jmtrivi@google.com to media owners file.
Test: N/A
Change-Id: If446eb3f2de07ab1cb3e87715b964a9360ec684c
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
API standardization and customization for Digital Tuner TV
Input support.
(Channels.COLUMN_COLUMN_REMOTE_CONTROL_KEY_PRESET_NUMBER,
Channels.COLUMN_SCRAMBLED, Channels.COLUMN_VIDEO_RESOLUTION,
Channels.COLUMN_CHANNEL_LIST_ID, Channels.COLUMN_BROADCAST_GENRE)
Bug: 158236748
Test: Manual - confirm tv.db
Change-Id: Id0003b7312327de42a18352a7868eaaa3c1ebcc4
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