Commit Graph

9068 Commits

Author SHA1 Message Date
Henry Fang
7112714a90 Set max frequency as Max_Value of integer if it's negative.
bug: 176097540
Test: Manual
Change-Id: I17cdd3b2861415b4812694d79aa97f3e7463e12a
2021-01-08 00:37:11 +00:00
Treehugger Robot
86b6f66d9f Merge "MTP: Update language to comply with Android's inclusive language guidance" 2021-01-07 15:23:53 +00:00
Henry Fang
c8af272fb6 Merge "TvProvider API standardization for ARIB and DVB TvProvider" 2021-01-07 00:30:05 +00:00
Henry Fang
8212f52f44 Merge "Don't open frontend device if it's a shared frontend" 2020-12-31 00:31:08 +00:00
Treehugger Robot
1d4bf166d4 Merge "Support blink scan" 2020-12-30 23:17:56 +00:00
Treehugger Robot
f8d7645571 Merge "Change resource claim to sync to avoid resource conflict" 2020-12-30 23:16:54 +00:00
Henry Fang
3d9490c218 Don't open frontend device if it's a shared frontend
bug: 175255961
Test: manual
Change-Id: Ib8c9704ebd1c518a84b8526172ca2fe3d087db87
Merged-In: Ib8c9704ebd1c518a84b8526172ca2fe3d087db87
2020-12-30 18:56:58 +00:00
Henry Fang
06eab7931a Add thread protection for Filter/Descrambler table
Use weak reference in the tables to allow objects released by caller

bug: 174685399
bug: 174711353
Test: manual
Change-Id: I760d0a77ad9efe2709a14f0fb8a669f8f16652e1
Merged-In: I760d0a77ad9efe2709a14f0fb8a669f8f16652e1
2020-12-30 18:50:58 +00:00
Henry Fang
49c7e865d7 Support blink scan
Allow scan again if callback and executor are same as before.

bug: 173239634
Test: atest -c TunerTest
Change-Id: Iec5ba453b3d3d40c0d96fda5c7288b79898d9aea
Merged-In: Iec5ba453b3d3d40c0d96fda5c7288b79898d9aea
2020-12-30 18:43:52 +00:00
Henry Fang
0dbb710556 Change resource claim to sync to avoid resource conflict
bug: 174544018
Test: manual
Change-Id: Ib2688da2a85cdad896f9f2814828ce7659c8a695
Merged-In: Ib2688da2a85cdad896f9f2814828ce7659c8a695
2020-12-30 18:41:13 +00:00
Treehugger Robot
eb709b6d88 Merge "Release resource before send MSG_RESOURCE_LOST message to TIS" 2020-12-30 11:38:59 +00:00
shubang
150c5afd80 Release resource before send MSG_RESOURCE_LOST message to TIS
Bug: 163397430
Test: mmm
Change-Id: I68e0c8704030e2a5713a5b63cffe8a1fb40873fc
Merged-In: I68e0c8704030e2a5713a5b63cffe8a1fb40873fc
2020-12-29 20:14:47 +00:00
Eric Laurent
d88b1e45b6 Audio: use preferred device for strategy for communication route
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
2020-12-23 08:36:39 +00:00
Eric Laurent
f39726f262 AudioManager: Add communication device management APIs
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
2020-12-23 08:36:12 +00:00
Jiabin Huang
a6421faaac Support set/clear/get preferred device for capture preset.
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
2020-12-22 18:54:15 +00:00
Eric Laurent
7f73ba815a Merge "Introduce device(s) role for strategy." 2020-12-22 17:11:45 +00:00
Eric Laurent
9c2bace739 audio: modify media JNI and audio service test OWNERS
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
2020-12-22 15:16:46 +01:00
jiabin
9bb4798296 Introduce device(s) role for strategy.
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
2020-12-21 17:01:20 +01:00
Junichiro.Homma
f56193551f TvProvider API standardization for ARIB and DVB TvProvider
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
2020-12-18 17:01:18 +09:00
Wonsik Kim
3fa9158be7 MediaCodecInfo: do not alter performance points for 32-bit processes
Bug: 173488434
Test: atest CtsMediaTestCases:MediaCodecListTest
Change-Id: Ie40557dc0401411cc51650ea42c0fd75f90c67ce
2020-12-17 10:51:17 -08:00
James Wei
bbf55a3fcd MTP: Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference


BUG=162536543

Change-Id: Ide3483e78ce66deb9bdda2a0d54feb8f70748832
2020-12-15 01:20:23 +00:00
Treehugger Robot
41ac3bae5f Merge "MediaCodecInfo: limit resolution to 4K for 32-bit processes" 2020-12-14 06:09:09 +00:00
Wonsik Kim
ef60b5fa00 MediaCodecInfo: limit resolution to 4K for 32-bit processes
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
2020-12-11 16:21:47 -08:00
Serik Beketayev
c6218f7977 Merge "[Mainline Migration] Migrate NetworkUtils" am: a086c295e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1498168

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc0a49e76f87a741f4410b53e9a40012e37fde36
2020-12-10 00:08:03 +00:00
Serik Beketayev
a086c295e7 Merge "[Mainline Migration] Migrate NetworkUtils" 2020-12-09 23:47:05 +00:00
Jeff Sharkey
c7c4a74a78 Improve OWNERS coverage across frameworks/base/. am: fab0ab3c9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519383

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0211462ecbcd9ad66f66af87e31cf12e1582fc65
2020-12-08 16:01:16 +00:00
Jeff Sharkey
c2793cf12b Merge changes from topic "dec5"
* changes:
  Improve OWNERS coverage across frameworks/base/.
  Improve OWNERS coverage across frameworks/base/.
  Improve OWNERS coverage across frameworks/base/.
2020-12-08 15:39:59 +00:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
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
2020-12-08 08:36:27 -07:00
Treehugger Robot
659f09f56f Merge "Adding AudioUsage converters to AudioAttributes" am: 87b5c6a2a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1518202

Change-Id: I6e84fcacbc45e667f592ef247ea1e87d9ae8e248
2020-12-07 19:08:24 +00:00
Serik Beketayev
9817226d99 [Mainline Migration] Migrate NetworkUtils
Migrating makeStrings(), numericToInetAddress() APIs

Bug: 173089079
Test: atest FrameworksNetTests
Change-Id: Ie914fd41bc3ce16d07f5d2768b89ce805b9245a9
2020-12-06 22:33:04 -08:00
Hayden Gomes
c164f6a4d1 Adding AudioUsage converters to AudioAttributes
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
2020-12-04 16:48:35 +00:00
Xin Li
d31ee38811 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
Aurimas Liutikas
e1bb600fc7 Merge "Remove legacy style metalava suppression" 2020-11-16 17:40:07 +00:00
Aurimas Liutikas
d23189b998 Suppress all hidden abstract methods in constructable classes.
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
2020-11-13 02:56:20 +00:00
Aurimas Liutikas
46a165215b Remove legacy style metalava suppression
@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
2020-11-12 18:30:12 -08:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
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
2020-11-04 09:45:53 +00:00
Snild Dolkow
2e686f164c Expose Image and Plane for testing
Test: cts builds
Test: the new cts tests run
Bug: 170981222
Reference: I39921ef80c62cc331bb2d72a8d614986d3166eb9
Change-Id: I82d9581c2892eff282de02ce5810cf819a35d1d4
2020-10-29 13:18:51 +01:00
Anton Hansson
dd7d52f963 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-19 16:41:01 +01:00
Treehugger Robot
aa2884ac69 Merge "Default compressed audio bytes per sample to 1" 2020-10-15 17:48:07 +00:00
Dean Wheatley
ede3f24c8d Default compressed audio bytes per sample to 1
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
2020-10-02 22:29:19 +00:00
Jean-Michel Trivi
0a2fb51a9e Merge "Use the try catch to deal with the StaleDataException." am: 1fa847ad64 am: 15698dd32d am: 4b16237ab7 am: d715c91c2a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433917

Change-Id: I910b327fba414ae7ce3574acc078a0af40756b87
2020-09-30 00:07:29 +00:00
guofei.xue
6695525f1b Use the try catch to deal with the StaleDataException.
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
2020-09-29 17:59:26 +00:00
Treehugger Robot
ab63bbb80e Merge changes I7907f0a3,Iec46c80b am: 4d233a83b7 am: 60d7707016 am: 0ca8b033dd am: 4b664e7ca0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433915

Change-Id: I34dc8b244777e39fe85a0a4a5a5d2d04ec66a10b
2020-09-29 17:32:29 +00:00
Treehugger Robot
4d233a83b7 Merge changes I7907f0a3,Iec46c80b
* changes:
  When the mUri is null,it will happen NullPointerException.
  Ringtone uri should add type query
2020-09-29 15:31:16 +00:00
guofei.xue
813857d851 When the mUri is null,it will happen NullPointerException.
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
2020-09-24 11:46:35 +00:00
TreeHugger Robot
2c70f81609 Merge "Add BIND_INCLUDE_CAPABILITIES flag when binding to the service." into rvc-qpr-dev am: 36019e12b2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12661665

Change-Id: I9f74ba4ee981620c72516ce4c4737990b7ce2b35
2020-09-23 22:07:29 +00:00
Arnaud Berry
76724683e3 Add BIND_INCLUDE_CAPABILITIES flag when binding to the service.
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
2020-09-23 16:21:50 +00:00
Treehugger Robot
c2fc48632c Merge changes from topic "exif-webp" am: b2356e4d98 am: 00ce3a3594 am: 67ddcd19b2 am: 24da2739c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1431429

Change-Id: Ia056bf1146ae7271f509eec998037857fbbf8718
2020-09-22 22:20:42 +00:00
Jin Seok Park
9df6c43029 Remove hidden API usage in ExifInterface am: 40b7a9f873 am: b2df4e05d8 am: 3162dab673 am: 3ba5d7eb2b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1431428

Change-Id: I039f99eb337683a164e41f0e94cca4ec5fb2c66c
2020-09-22 22:20:35 +00:00
wan.li
daf5e2a5b1 Ringtone uri should add type query
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
2020-09-18 19:32:40 +08:00