Commit Graph

9020 Commits

Author SHA1 Message Date
Treehugger Robot
32039640df Merge "Default compressed audio bytes per sample to 1" am: aa2884ac69 am: ce94c11c87 am: 313ffe6d31
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1444316

Change-Id: I944e555922d1c1acdd2f196cb4e11b532fe8a507
2020-10-15 18:19:27 +00: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
Eric Laurent
148c8bc210 Merge "AudioService: Add metrics for audio mode" into rvc-dev 2020-07-19 16:46:20 +00:00
Henry Fang
0b7ea54a86 Merge "Fix MediaCas CTS failure TRM is checking input parameters and won't allow null executor. Use context main executor to call Tuner Resource Manager (TRM)" into rvc-dev am: bdc05af123
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12162120

Change-Id: Icdb03ffdb5056b7023a491424c24996fe31ba69b
2020-07-16 19:07:36 +00:00
Eric Laurent
6915e2ff50 AudioService: Add metrics for audio mode
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
2020-07-16 08:39:22 -07:00
Henry Fang
f0e3e4f470 Fix MediaCas CTS failure
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
2020-07-15 19:06:25 -07:00
TreeHugger Robot
bc6f7b7b4f Merge "Add FEATURE_REMOTE_GROUP_PLAYBACK" into rvc-dev am: c0fcd758c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12043613

Change-Id: I7e9e9371b7108f2fa2179bf99f7f21f7670594c9
2020-07-02 01:08:02 +00:00
TreeHugger Robot
c0fcd758c4 Merge "Add FEATURE_REMOTE_GROUP_PLAYBACK" into rvc-dev 2020-07-02 00:47:56 +00:00
TreeHugger Robot
0511013257 Merge "media: clarify keys used for CodecCapabilities.isFormatSupported" into rvc-dev am: db6e11150c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12062381

Change-Id: Ifbc857cb095e937234dc8567137863f2e6a2e054
2020-07-01 23:49:50 +00:00
Lajos Molnar
e167804b42 media: clarify keys used for CodecCapabilities.isFormatSupported
Bug: 159281744
Change-Id: Id93dd2529e468b76bdd01e2a8ebe14b8435a54d7
2020-07-01 14:56:30 -07:00
Kyunglyul Hyun
e44b5a2641 Add FEATURE_REMOTE_GROUP_PLAYBACK
Can be used to distinguish a group route from single device routes

Bug: 160113560
Test: N/A
Change-Id: Id65aded4ce396bbfaec7040fc2227b769f8c5794
2020-07-01 14:07:39 +08:00
TreeHugger Robot
882446d79c Merge "Camera: Clarify timestamp behavior for VIDEO_RECORD usage flag" into rvc-dev am: 26bf8c7aa0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12002522

Change-Id: I2f33806d11d7b7ac91a00a045cc4b420a3e438f1
2020-06-26 16:21:15 +00:00
TreeHugger Robot
26bf8c7aa0 Merge "Camera: Clarify timestamp behavior for VIDEO_RECORD usage flag" into rvc-dev 2020-06-26 16:09:09 +00:00
Jean-Michel Trivi
0039734e58 Merge "AudioAttributes: fix setter for flags" into rvc-dev am: a750903b42
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12003758

Change-Id: I02580d1da80e38850721268ad75a1840bec8c263
2020-06-26 03:50:24 +00:00
Jean-Michel Trivi
a750903b42 Merge "AudioAttributes: fix setter for flags" into rvc-dev 2020-06-26 03:49:30 +00:00
Jean-Michel Trivi
b097d9e1cd AudioAttributes: fix setter for flags
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
2020-06-26 03:48:35 +00:00
Kyunglyul Hyun
0bfba9c369 Merge "Don't check selectedRoutes of created sesions" into rvc-dev am: bc41b14c58
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11997601

Change-Id: I7e91ac9a422d29ca5be052c6b2929d65e6538be3
2020-06-26 01:53:46 +00:00
Shuzhen Wang
f09a4cdbd6 Camera: Clarify timestamp behavior for VIDEO_RECORD usage flag
Test: make docs and read the doc
Bug: 143240912
Change-Id: I64032c7e2644680888979696968bdebd772530cc
2020-06-25 16:31:14 -07:00
Kyunglyul Hyun
f19e811c88 Don't check selectedRoutes of created sesions
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
2020-06-25 19:16:45 +09:00
Makoto Onuki
d9bdedcf5b Merge "Remove unnecessarily @System/TestApi annotations" into rvc-dev-plus-aosp 2020-06-24 18:02:52 +00:00