Commit Graph

9038 Commits

Author SHA1 Message Date
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
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
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
Jin Seok Park
c6cf32b623 Add function for adding EXIF to WebP files
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
2020-09-17 16:43:34 -07:00
Jin Seok Park
40b7a9f873 Remove hidden API usage in ExifInterface
Copying over util class methods
ArrayUtils#startsWith(byte[], byte[])
Streams#copy(InputStream, OutputStream)
IoUtils#closeQuietly(AutoCloseable)

Bug: 159569080, Bug: 159569444, Bug: 159569092
Test: atest CtsMediaTestCases:android.media.cts.ExifInterfaceTest
Change-Id: I5f7f3387e88728809b55a0049fb1937a458d02cb
Merged-In: I5f7f3387e88728809b55a0049fb1937a458d02cb
2020-09-17 16:42:02 -07:00
Ivan Chiang
3788ac124b Merge "Revert "Ringtone uri should add type query"" am: 56da278127 am: 7a5e865a80 am: b145311a8d am: 3bff601a8a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1429968

Change-Id: I3df68434989ee8231db6adf41a203526be5027ab
2020-09-17 22:10:57 +00:00
Lev Proleev
689ff54e86 Revert "Ringtone uri should add type query"
This reverts commit 3b25df9ad3.

Reason for revert: potential culprit for test breakage: b/168789394

Change-Id: Ie042b91c189c026079b040f6609df4c22c70f2cf
2020-09-17 13:47:54 +00:00
Robert Chou
7a38d00bc7 Merge "Ringtone uri should add type query" am: 96d98a9fad am: caf558ecdc am: 8e9f6c8db1 am: 53aa756a06
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426651

Change-Id: I02b2f6d4c39c93d1c3b4be6583b58fa5c0f00060
2020-09-17 05:35:22 +00:00
wan.li
3b25df9ad3 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.

Bug: 168431815

Change-Id: Ic37f879a658379179dc53715fa016631bb7309d9
2020-09-16 02:50:23 +00:00
jiabin
fcd4cbf4f4 Add package name when creating AudioTrack.
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
2020-09-16 00:14:43 +00:00
jiabin
6e9cabd95e Add package name when creating AudioTrack.
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
2020-09-15 18:03:17 +00:00
Gyumin Sim
4d52c486fb Merge "Comply with inclusive language guidance in media session and browser" am: 93a807bcf7 am: 75fa27a100 am: aa1edf9312 am: 0a0c1ce8bb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1425508

Change-Id: I09c48ce04d58651ad3a71cb43f6202553ad783af
2020-09-11 06:34:06 +00:00
Gyumin Sim
71133463f7 Comply with inclusive language guidance in media session and browser
See https://source.android.com/setup/contribute/respectful-code for
reference.

Bug: 161896447
Change-Id: I9c48b7d835821691d37f4f1c866569071feb8cb7
Test: N/A
2020-09-11 01:38:34 +00:00
Jin Seok Park
3d095a896d DO NOT MERGE: Rename temp file to use a valid image file extension am: bb6d38615e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12455083

Change-Id: I9d51a70a19d429c5a8491fdcf3084f826e0f8e28
2020-09-02 06:25:54 +00:00
Xin Li
ff2ffe48ac Merge "Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)" into stage-aosp-master 2020-09-01 20:04:08 +00:00
Treehugger Robot
9760c42784 Merge "Simplify synchronized code and add comments" am: 9791b54b88 am: b57f32e68a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1416212

Change-Id: Id16962965443fbe8d5e885dcc48ce17502d3c896
2020-09-01 20:02:04 +00:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Glenn Kasten
18a1f535aa Simplify synchronized code and add comments
Test: N/A, by inspection
Change-Id: Ie08ce51ee6736a6c1df18783dd5ed064288907e1
2020-08-31 12:56:26 -07:00
Jin Seok Park
bb6d38615e DO NOT MERGE: Rename temp file to use a valid image file extension
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)
2020-08-26 02:47:51 +00:00
Eric Laurent
f976180608 audio: add device definitions for BLE Audio
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
2020-08-18 06:03:21 +00:00
Eric Laurent
d77752dbf2 audio: add device definitions for BLE Audio
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)
2020-08-14 01:09:51 +00:00
Eric Laurent
e502c6aa15 Merge "AudioService: Add metrics for audio mode" into rvc-dev am: 148c8bc210
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12065323

Change-Id: I0c64ec09a72ccf1c781b5652a1cc36508062083c
2020-07-19 17:08:41 +00:00