Commit Graph

9141 Commits

Author SHA1 Message Date
Marvin Ramin
b4e4013707 Merge "Make AudioManager device volume behavior APIs SystemApi" 2020-08-04 09:33:31 +00:00
Eric Laurent
5af1dda5b7 Merge "AudioManager: Add getAudioHwSyncForSession() API" 2020-08-03 19:14:21 +00:00
Eric Laurent
43a78de270 AudioManager: Add getAudioHwSyncForSession() API
Add a public API to get a HW A/V sync ID for a given
audio session.

Bug: 161929047
Test: atest AudioManagerTest#testGetAudioHwSyncForSession
Change-Id: I71d838adb7cd1b655f8daa9c1594f9f83cb89f6b
2020-08-03 15:25:01 +00:00
Jin Seok Park
1dd3a5f757 Merge "Make AudioManager.FLAG_FROM_KEY @SystemApi for Module" 2020-08-03 12:43:10 +00:00
Clément Julliard
94eb6ae80a Merge "Pass WRITE usage flag to the mapper if ImageReader was created with a WRITE usage flag." 2020-08-01 00:21:55 +00:00
Clément Julliard
cc217e3b8c Pass WRITE usage flag to the mapper if ImageReader was created with a
WRITE usage flag.

Since some producers rely on these buffers being unchanged (eg. for
partial rendering), this feature should be used with caution. A warning
to this effect was added in the Javadoc.

Bug: 162287616
Test: built emulator, confirmed no SIGSEGV anymore (b/162287616 fixed).
Change-Id: Ia1f8b8754b0d6ae75a2af33147645e744d593d82
2020-07-31 21:44:35 +00:00
TreeHugger Robot
4fc108418a Merge "AudioService: enable reusing an AudioPolicy" 2020-07-31 15:55:16 +00:00
Marvin Ramin
5495cc9b9b Make AudioManager device volume behavior APIs SystemApi
Allow privileged applications to control volume behavior of audio
devices.

Bug: 161878484
Test: atest AudioServiceHostTest

Change-Id: Ic6206369a69b4103f715565f387f652626b832d4
2020-07-31 09:51:42 +02:00
Jean-Michel Trivi
f5f3e68947 AudioService: enable reusing an AudioPolicy
Enable registering/unregistering an AudioPolicy, and then
registering it again later.
Doing so was failing before as when a policy was re-registered,
its mix count didn't restart at 0 on the client side, causing
the mix to have an invalid registration string not in sync with
the policy configuration on the server side.

Bug: 161491896
Test: atest AudioHostTest#testAudioPolicyReuse
Change-Id: I51fc41c46817791de4ce3a4f9d36c38d9466602e
2020-07-30 11:22:03 -07:00
Jin Seok Park
4abc23e798 Make AudioManager.FLAG_FROM_KEY @SystemApi for Module
Bug: 160682430
Test: m update-api
Change-Id: Ibce0ee78713cef698a188d2218189dbf871b9472
2020-07-31 02:18:06 +09:00
Jin Seok Park
7a6667d617 Merge "Rename temp file to use a valid image file extension" 2020-07-30 06:04:28 +00:00
Jin Seok Park
7111b47eb1 Merge "Add function for adding EXIF to WebP files" 2020-07-29 03:29:42 +00:00
Jin Seok Park
5abacddfc3 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
2020-07-27 12:43:19 +09:00
Jin Seok Park
c987165d86 Merge "Set default locale to US" 2020-07-23 10:22:54 +00:00
Gyumin Sim
3e9bfcf84f Merge changes I6aebd812,I0dc6a99a
* changes:
  Remove obsolete method in IMediaBrowserServiceCallbacks
  Remove an import in MediaBrowser
2020-07-23 07:58:54 +00:00
Jin Seok Park
f247c76020 Set default locale to US
SimpleDateFormat will use the default locale value if not explicitly
set. If the default locale is Arabic, SimpleDateFormat#format will
return a string that does not conform to the given pattern.

In ExifInterface, if setDateTime is called on a device with an Arabic
locale, it will write a string value that will not follow the EXIF
standard "YYYY:MM:DD HH:MM:SS" format. Thus, we need to set the
locale to Locale.US at all times.

Bug: 160674042
Test: N/A
Change-Id: I2ad42f73742fd8ceeeeae47eafea69015f50814d
2020-07-23 15:08:08 +09:00
TreeHugger Robot
f806c211b3 Merge "AudioDeviceInfo: make TYPE_REMOTE_SUBMIX public" 2020-07-23 00:48:26 +00:00
Gyumin Sim
7bf786f574 Remove obsolete method in IMediaBrowserServiceCallbacks
It removes onLoadChildren because onLoadChildren is not used anymore
that is identical to onLoadChildrenWithOptions with null options. It
also renames onLoadChildrenWithOptions to onLoadChildren for simpler
name.

Test: atest CtsMediaTestCases:android.media.cts.MediaBrowserTest \
  CtsMediaTestCases:android.media.cts.MediaBrowserServiceTest
Change-Id: I6aebd812249cd3a717aa6d2f48e4a40601ef1063
2020-07-22 17:43:06 +09:00
Gyumin Sim
9d211b7460 Remove an import in MediaBrowser
The repo hook complains about unused imports because MediaController is
not used in code but javadoc.

Test: m offline-sdk-docs
Change-Id: I0dc6a99a77f344e326c4bbe0c216c4f0f44be696
2020-07-22 17:43:06 +09:00
TreeHugger Robot
1241c8709f Merge "Add HapticGenerator." 2020-07-20 20:07:20 +00:00
jiabin
2ea6a26b4d Add HapticGenerator.
Add HapticGenertor, which is an audio effect that can generate haptic
data from audio data.

Bug: 136490803
Test: atest HapticGeneratorTest
Change-Id: Ib677f0ad82ae4a164546300c7a86760cdb6a52b4
2020-07-20 18:00:26 +00:00
Jin Seok Park
2018d2bd3c 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
2020-07-21 00:05:39 +09:00
Eric Laurent
e1c32391fa Merge "AudioService: Add metrics for audio mode" into rvc-dev am: 148c8bc210 am: e502c6aa15 am: f332fc9ccd am: b9ea818a3e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12065323

Change-Id: Ie80eb7907762bf17b9014b34f30720afcfbf6a66
2020-07-19 17:51:09 +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
6603012e2e 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 am: 1278c0bcaf am: af0636a39f am: ed58a415ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12162120

Change-Id: I3c7c593eae3ac01da9d3f5bc668d0f8334ece88c
2020-07-16 19:59:50 +00:00
Henry Fang
ed58a415ec 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 am: 1278c0bcaf am: af0636a39f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12162120

Change-Id: I26a7c280520196e33df3df25b844d965ec649ea1
2020-07-16 19:42:24 +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
Jean-Michel Trivi
c17a2423de AudioDeviceInfo: make TYPE_REMOTE_SUBMIX public
SUBMIX type can be returned by routing query APIs such as
MediaPlayer.getRoutedDevice(), make it public.

Bug: 160819170
Test: atest AudioHostTest#testTwoChannelCapturingCheckSubmixDevice
Change-Id: Ie5854ad86464c40137d0a1b10420116bc5cc270e
2020-07-16 09:58:41 -07: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
Jin Seok Park
431f3af83b Remove using hidden API: MediaSessionManager(Context)
Replace with SystemServiceRegistry.registerContextAwareService,
which is a @SystemApi. See ag/9734296 for reference.

Bug: 160380016
Test: atest
    CtsMediaTestCases:android.media.cts.MediaSessionManagerTest
Change-Id: I9b6da97e0e0f5181ce8681a399ca090e67f6fd4e
2020-07-06 15:33:47 +09:00
Jin Seok Park
8f79003bec Remove using ServiceManager API in MediaSessionManager
MediaSessionManager calls ServiceManager#getService(string) to get
ISessionManager, but it is a hidden API that will not be made into
@SystemApi (ag/6329675).

Instead, create a wrapper class that can only retrieve specified
media service binders. (ag/10123575 for reference)

Bug: 159955826
Test: atest
    CtsMediaTestCases:android.media.cts.MediaSessionManagerTest
Change-Id: I1ab89d1217e8e3d071b38da772ee96889e9859b1
2020-07-05 16:09:14 +09:00
TreeHugger Robot
22f020ff4b Merge "Add FEATURE_REMOTE_GROUP_PLAYBACK" into rvc-dev am: c0fcd758c4 am: be48f1591e am: 0d1eeaad63 am: 9e43adeba0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12043613

Change-Id: Iec331368f55cb9e9b02d5a4e42a7437e504f23c7
2020-07-02 01:48:10 +00:00
TreeHugger Robot
9e43adeba0 Merge "Add FEATURE_REMOTE_GROUP_PLAYBACK" into rvc-dev am: c0fcd758c4 am: be48f1591e am: 0d1eeaad63
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12043613

Change-Id: I8a9d244ed6b0341eea13357546935dc1d48f0e82
2020-07-02 01:34:35 +00: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
Automerger Merge Worker
843a4b4063 Merge "Merge "media: clarify keys used for CodecCapabilities.isFormatSupported" into rvc-dev am: db6e11150c am: 0511013257 am: 24f269e6b0" into rvc-qpr-dev-plus-aosp am: 0399ad72dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12062381

Change-Id: Ie105c54f4bbe5f4ba931b147c7e7b8c791a2eb7e
2020-07-02 00:30:44 +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
e9c247146d Merge "Camera: Clarify timestamp behavior for VIDEO_RECORD usage flag" into rvc-dev am: 26bf8c7aa0 am: 2f875cc89d am: 3bdc9277bb am: e10c1f3fb0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12002522

Change-Id: If769c3885cad4818faaaf03778f486957e4f9606
2020-06-27 02:44:20 +00:00
Jean-Michel Trivi
189701475f Merge "AudioAttributes: fix setter for flags" into rvc-dev am: a750903b42 am: 78d37b71d5 am: 2054ade6a7 am: 41a0ab2f2d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12003758

Change-Id: If8aa425017c865170bc1652c6c7b22ef053c8feb
2020-06-27 02:34:32 +00:00
Kyunglyul Hyun
cc8f8c7fa3 Merge "Don't check selectedRoutes of created sesions" into rvc-dev am: bc41b14c58 am: 0bfba9c369 am: c0b5e67b11 am: f67dbafd59
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11997601

Change-Id: I861f68cc93f8add9f4fae670972b4e91cd5e8ac5
2020-06-27 02:33:32 +00:00
TreeHugger Robot
3bdc9277bb Merge "Camera: Clarify timestamp behavior for VIDEO_RECORD usage flag" into rvc-dev am: 26bf8c7aa0 am: 2f875cc89d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12002522

Change-Id: Iae9cb2e3d06e8f4f65f841780a36040f4bf22dcb
2020-06-26 16:35:36 +00: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
2054ade6a7 Merge "AudioAttributes: fix setter for flags" into rvc-dev am: a750903b42 am: 78d37b71d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12003758

Change-Id: I04eb33330a4e5277b164adc2604d52993c780750
2020-06-26 04:04:42 +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