Commit Graph

9169 Commits

Author SHA1 Message Date
hkuang
3eb57dc580 TranscodingAPI: Expose MediaTranscodeManager as System API.
Bug: 160260102
Test: Unit test
Change-Id: I38e9efc46e23fe1aafe65100bbc7f72eb200720f
2020-08-27 22:20:18 +00:00
Colin Cross
082aec6c84 Revert "Snap for 6793014 from bbbccc3c2b7fc7c5780f6c415c4223e1d0..."
Revert "Snap for 6793014 from 44725f06b7f7d6407b5ee82d989bdd6c7a..."

Revert "Snap for 6793014 from f22ad3164937a8f2e309965c102b6366d5..."

Revert "Snap for 6793014 from 11467102abddb6026aaa164c1361439c2d..."

Revert "Snap for 6793014 from 265280bf5cb4bc14e132c3a35ae5f7ae65..."

Revert "Snap for 6793014 from f2989f9c65556d5155dbd57f82f0c93a16..."

Revert "Snap for 6793014 from 8b8bf0a07b0521bbe8483fbbab1222ffd6..."

Revert "Snap for 6793014 from 3777d883a3857b1a1589181c436d9018d7..."

Revert "Snap for 6793014 from 3157b4ee4325286f0c2ab0f26528460c8b..."

Revert "Snap for 6793014 from a43295d1825da62af038d345a7a861ed7a..."

Revert "Snap for 6793014 from 2076be4d27078d6ebc0a6b5e5ceb386109..."

Revert "Snap for 6793014 from d0e31526c62b2aeb35c293ac96feb180fc..."

Revert "Snap for 6793014 from 7a3a8c6351d5167a6ae0b33bc376efabd2..."

Revert "Snap for 6793014 from 41471cb21bb16b5c3bcc92f84293b79684..."

Revert "Snap for 6793014 from 42e5cca3cfb829690c9d8c6aca57a8e7d5..."

Revert "Snap for 6793014 from 4f81304963d19f4511b1e8e7d0aad87a67..."

Revert "Snap for 6793014 from 07602cdacf5bcc835db41f7eaa24af9964..."

Revert "Snap for 6793014 from 14cb57e107a3abce8b14937b1f92c28d18..."

Revert "Snap for 6793014 from ab1e4a81d09a540a5f927059e5bc03a606..."

Revert "Snap for 6793014 from 8c65adad0bcdfb3acc561063b4048dca24..."

Revert "Snap for 6793014 from b3061942700265e2bf04af9997775dcbbb..."

Revert "Snap for 6793014 from 551c5953fc62e339e4ee884ec2cd0ac3be..."

Revert "Snap for 6793014 from 4919273b2ac5c6347a18e17c5ec70d8da6..."

Revert "Snap for 6793014 from 988d4244914e0c749655e8cb6db18ba44f..."

Revert submission 12465146-release-request-6b259cbc-1f45-4b05-bc7e-c9b893b79d68-for-git_main-busytown-release-6793014

Reason for revert: b/166531456
Reverted Changes:
I5ff7a6c0d:Snap for 6793014 from f2989f9c65556d5155dbd57f82f0...
I77bdff943:Snap for 6793014 from a43295d1825da62af038d345a7a8...
I2ac5c520a:Snap for 6793014 from c3f124cca05579acf0a6cb589ebd...
I023b9702f:Snap for 6793014 from 98756d6d3e2bb0ba28eb125caa7a...
Ibc7893d72:Snap for 6793014 from fd1ad6750ef332d3f50f218f4d5d...
Ic27847bee:Snap for 6793014 from 8c65adad0bcdfb3acc561063b404...
If20bc9352:Snap for 6793014 from 7a3a8c6351d5167a6ae0b33bc376...
I6542d17e8:Snap for 6793014 from 3777d883a3857b1a1589181c436d...
I66e6bb8a9:Snap for 6793014 from 8b8bf0a07b0521bbe8483fbbab12...
I3cd190b6b:Snap for 6793014 from 424180bdc4aa18249e678daebfd0...
If92db7402:Snap for 6793014 from ab1e4a81d09a540a5f927059e5bc...
Iaced03c87:Snap for 6793014 from d0e31526c62b2aeb35c293ac96fe...
I5d28c6b4b:Snap for 6793014 from 4f81304963d19f4511b1e8e7d0aa...
I30d07bea3:Snap for 6793014 from 7594ec6384c4da320726def34f47...
I473205f48:Snap for 6793014 from 551c5953fc62e339e4ee884ec2cd...
I0656b41af:Snap for 6793014 from 44725f06b7f7d6407b5ee82d989b...
I0f9796067:Snap for 6793014 from 4919273b2ac5c6347a18e17c5ec7...
I9a38cda8f:Snap for 6793014 from 2076be4d27078d6ebc0a6b5e5ceb...
I876a82f51:Snap for 6793014 from 11467102abddb6026aaa164c1361...
I749d7d023:Snap for 6793014 from 41471cb21bb16b5c3bcc92f84293...
I038daea41:Snap for 6793014 from 07602cdacf5bcc835db41f7eaa24...
I47aa3131c:Snap for 6793014 from 14cb57e107a3abce8b14937b1f92...
I32dba8a95:Snap for 6793014 from 3157b4ee4325286f0c2ab0f26528...
I2ebc9f9db:Snap for 6793014 from 988d4244914e0c749655e8cb6db1...
Iae7c3370f:Snap for 6793014 from 9ffb8852294e06e2d387dc1fb868...
I6467a7f1b:Snap for 6793014 from 42e5cca3cfb829690c9d8c6aca57...
I8c6375203:Snap for 6793014 from b3061942700265e2bf04af999777...
I843b2e1f3:Snap for 6793014 from 265280bf5cb4bc14e132c3a35ae5...
Ie254f7079:Snap for 6793014 from f22ad3164937a8f2e309965c102b...
I01e0974ed:Snap for 6793014 from bbbccc3c2b7fc7c5780f6c415c42...

Change-Id: I9160aa1ae5523d8e92c618ae1922576bb70a7ac8
2020-08-27 04:12:26 +00:00
Kyunglyul Hyun
5883f98064 Merge "MediaSession: Add documentation for FLAG_EXCLUSIVE_GLOBAL_PRIORITY" 2020-08-23 09:57:50 +00:00
Hangyu Kuang
90d477f392 Merge "TranscodingAPI: Handling Transcding service crash." 2020-08-21 21:34:16 +00:00
Kyunglyul Hyun
ff9f58abfd MediaSession: Add documentation for FLAG_EXCLUSIVE_GLOBAL_PRIORITY
Bug: 163453223
Test: N/A
Change-Id: I0471bc24c2109da7a40fa996a68bbfba1a75ba71
2020-08-21 17:04:56 +09:00
hkuang
ef9108a1de TranscodingAPI: Handling Transcding service crash.
Upon receiving a binder died event of the client
due to service crash, we will do the following:
 1) For the job that is running, notify the client
    that the job is failed with error code, so client
    could choose to retry the job or not.
 2) For the jobs that is still pending or paused,
    we will resubmit the job internally once we
    successfully reconnect to the service and
    register a new client.
 3) When trying to connect to the service and register
    a new client. The service may need time to reboot
    or never boot up again. So we will retry for a number
    of times. If we still could not connect, we will notify
    client job failure for the pending and paused jobs.

Bug: 161469320
Bug: 160260102
Test: Run the test with long clip and kill the service.
Change-Id: Idfd8dd0aae60b1dfd6c766552c71f07c60663918
2020-08-20 15:06:30 -07:00
Gyumin Sim
45fb6fe0a0 Merge "Avoid blocking outgoing binder call for setQueue" 2020-08-18 10:57:27 +00:00
Jin Seok Park
4cf6f1faea Merge "Make APIs that dispatch KeyEvent as system service @SystemApi" 2020-08-18 02:39:08 +00:00
TreeHugger Robot
8a062c0c9e Merge "Release resource before send MSG_RESOURCE_LOST message to TIS" 2020-08-14 21:44:09 +00:00
Gyumin Sim
35d7cd4771 Avoid blocking outgoing binder call for setQueue
There has been a blocking binder call out of system_server for
MediaSession#setQueue because ParceledListSlice internally creates
another binder on the caller side and calls the binder from callee
if the list is too large to fit in a single IPC transaction.

It introduces ParcelableListBinder to do multiple transactions in the
same direction, so that the binder call doesn't block system_server.

Bug: 147703076
Test: atest CtsMediaTestCases:android.media.cts.MediaSessionTest
Change-Id: I5623c20d615d25c88999d80615958d6cb6e51a77
2020-08-14 18:55:14 +09:00
Gyumin Sim
2503bf242d Merge "Limit size of initial Parcel for async binder call" 2020-08-14 09:43:58 +00:00
Jin Seok Park
a729a81a3a Make APIs that dispatch KeyEvent as system service @SystemApi
Bug: 160577019
Test: m update-api
Change-Id: Iea6096d68ede324006e939495dcff2a01c9c21a6
2020-08-14 14:15:39 +09:00
Gyumin Sim
68a3e7a0fb Limit size of initial Parcel for async binder call
It limits the size of the initial Parcel of ParceledListSlice for async
binder call in MediaSessionRecord and MediaBrowserService. The binder
buffer might be full if multiple large Parcels are sent through async
transaction. ParceledListSlice sends the first part of the list via the
initial Parcel and the rest of the list via another synchronous
transaction in the other direction.

The added CTS tests are supposed to be flaky before this change, but
are stable after this change. It was hard to reproduce failures for the
test added in MediaSessionTest because MediaSession#setQueue is
synchronous binder call to system_server so series of setQueue runs
too slowly to overflow the buffer on the process who is listening
onQueueChanged, while the test added in MediaBrowserServiceTest was
very flaky.

Bug: 37493677
Test: atest CtsMediaTestCases:android.media.cts.MediaSessionTest \
  CtsMediaTestCases:android.media.cts.MediaBrowserServiceTest
Change-Id: I24268637792015dac604550a333d4829d1f0e0a0
2020-08-13 12:59:11 +09:00
TreeHugger Robot
6fb23b6d8a Merge changes from topics "devicesRoleForStrategy", "useAudioDevicesTypeAddrVector"
* changes:
  Introduce device(s) role for strategy.
  Use AudioDeviceTypeAddrVector instead of Vector<AudioDeviceTypeAddr>
2020-08-13 02:24:06 +00:00
jiabin
f40141ddbc 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
2020-08-12 14:44:28 -07:00
shubang
9e0e1fb6ae Release resource before send MSG_RESOURCE_LOST message to TIS
Bug: 163397430
Test: mmm
Change-Id: I68e0c8704030e2a5713a5b63cffe8a1fb40873fc
2020-08-12 11:14:39 -07:00
hkuang
4ccf29836e TranscodingApi: Update job status upon receiving callback.
Bug: 160260102
Test: Unit test.

Change-Id: Ib3727889a102f64d76794703e085e73feeabe34e
2020-08-11 09:56:46 -07:00
Eric Laurent
ca94af0528 audio: add missing audio device type enums
Add internal audio device types in AudioSystem
and AudioManager that were not added in JAVA when
the native types were created.

Test: make, flash and boot
Change-Id: Ib81b7b3405c846cf873b51cfff800c75c5d8a7a6
2020-08-10 21:27:51 +00:00
Eric Laurent
7be5b55bcc Merge "audio: add device definitions for BLE Audio" 2020-08-10 21:25:56 +00:00
TreeHugger Robot
9185c90af2 Merge "Transcoding API: Add support for progress update." 2020-08-10 20:28:35 +00:00
hkuang
be355a317c Transcoding API: Add support for progress update.
Bug: 160260102
Test: Unit test.
Change-Id: I2203b10e330ea31463d73d1248acb3c3f54f4d64
2020-08-10 09:42:56 -07:00
Eric Laurent
6239d7ee87 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
2020-08-10 15:11:40 +00:00
TreeHugger Robot
6d9b03e79d Merge "AudioPolicy: better logs in AudioService history" 2020-08-07 18:33:26 +00:00
Jean-Michel Trivi
948f10fe46 AudioPolicy: better logs in AudioService history
Improve logs for AudioPolicy lifecycle as seen by AudioService,
for register, unregister and death.

Test: run ap2f, check history with adb shell dumpsys audio
Change-Id: Ifd0eb7a4f5472bc0224b0f52f680cb74d7be84dc
2020-08-07 09:45:11 -07:00
Kyunglyul Hyun
8855e78ad8 Merge "Add @SystemApi to MediaSession.FLAG_EXCLUSIVE_GLOBAL_PRIORITY" 2020-08-07 01:20:47 +00:00
Hyundo Moon
c44a3147c9 Merge "Remove hidden RemoteControlClient constant usages in MediaRouter" 2020-08-07 01:00:19 +00:00
Hyundo Moon
94e8e810cc Remove hidden RemoteControlClient constant usages in MediaRouter
Bug: 161331794
Test: Ran MediaRouterTest (CTS)
Change-Id: I116946d3940d6f39ca61edf1c0c0e237115650d4
2020-08-06 23:54:49 +09:00
Kyunglyul Hyun
c9857cff1c Add @SystemApi to MediaSession.FLAG_EXCLUSIVE_GLOBAL_PRIORITY
Bug: 161327893
Test: build successful
Change-Id: Id35295601a61c5f589c5b677c8b41969d76ff7b3
2020-08-05 23:30:03 +09:00
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