Commit Graph

14539 Commits

Author SHA1 Message Date
Shuzhen Wang
e375ee8f8a Camera: Add new hidden API for camera open/close callback
The hidden API is used by SystemUI process to adjust the system UI based
on when a certain camera is opened or closed.

Test: Manually observe callbacks in SystemUI when running camera CTS
Bug: 150540299
Change-Id: I04cae782d96f0e32be8ef588dcd328f84b32887a
Merged-In: I04cae782d96f0e32be8ef588dcd328f84b32887a
2020-03-10 11:34:26 -07:00
jiabin
55e8fd2352 Set/get allowed capture policy via AudioService.
Do not call AudioSystem.setAllowedCapturePolicy directly in
AudioManager. Instead, send the request to AudioService and calling the
function in AudioService. In that case, AudioService can cached the
request so that it benefits returning correct playback configuration.

When querying capture policy, AudioManager will query AudioService first
to see if there is cached capture policy. If there is exception, return
cached capture policy in AudioManager.

Test: dumpsys audio, query active audio playback configuration
Test: atest AudioManagerTest, AudioAttributesTest
Test: atest AudioPlaybackCaptureTest, AudioPlaybackConfigurationTest
Bug: 145115448
Change-Id: I170571d8a67839bc5a53991d6c89127b99b5c794
Merged-In: I170571d8a67839bc5a53991d6c89127b99b5c794
(cherry picked from commit b33f36971d)
2020-03-03 07:38:38 +00:00
Automerger Merge Worker
03bdd73cca Merge "Fix MediaCodec FLAC Javadoc" into oc-mr1-dev am: 546c644f27 am: af521c4ced am: 98274d96f5 am: 9868e4c737
Change-Id: I60a049225fd042ee6c559c0a1dcbc99b4b49d92e
2020-01-02 21:50:42 +00:00
Automerger Merge Worker
98274d96f5 Merge "Fix MediaCodec FLAC Javadoc" into oc-mr1-dev am: 546c644f27 am: af521c4ced
Change-Id: Id28175d26ec9910e184d5520cdf280e3ab831cf4
2020-01-02 21:11:32 +00:00
Automerger Merge Worker
af521c4ced Merge "Fix MediaCodec FLAC Javadoc" into oc-mr1-dev am: 546c644f27
Change-Id: I511da6d59c3b525cb678d6bb08a6cfa8e4e5a94f
2020-01-02 20:47:01 +00:00
Jean-Michel Trivi
5e851cf9d8 AudioService: setMasterMute protected by MODIFY_AUDIO_ROUTING
Require MODIFY_AUDIO_ROUTING system permission to exercise
hidden (non-SDK, non-SystemApi) method setMasterMute

Bug: 141622311
Test: see bug for POC app
Change-Id: I4ee93276daa1285c55c4c838e2b43833135d76f6
2019-12-18 13:24:16 -08:00
Automerger Merge Worker
e5151f8012 [DO NOT MERGE] Return correct offsets for getAttributeRange() am: 013afc4daf am: 3d2b94bd5b
Change-Id: Id28d26d99b0e2df0a43ef6f6e8034957343271f8
2019-12-04 02:41:19 +00:00
Jin Seok Park
013afc4daf [DO NOT MERGE] Return correct offsets for getAttributeRange()
Cherry-picked from ag/9745767

Currently, the offset value returned from getAttributeRange() does
not take into account the offset to the EXIF data within the image
file. This CL fixes the code to return the correct offsets.

The existing test code could not detect this issue because it does
not explicitly seek to the given offset and retrieve/compare the
data. This CL also adds test code to do this. Make tag information
is also added because all test files have this information, while only
a select few have thumbnail/GPS tag information.

This CL also fixes a bug where the thumbnail offset was not being
updated if the data was passed with StripOffsets tag.

Bug: 143118731, Bug: 143663411
Test: atest ExifInterfaceTest
Change-Id: Ia147cdcacf4699c5e7efc43f52e58b945032a51f
2019-11-20 13:30:22 +09:00
Joshua Baxter
bcc7d237a6 Merge "docs: fix typo" into qt-dev am: 49357cbf9e
am: 01b5ee8eca

Change-Id: I449250128879b14a4cf9da7c43f8d40af765c4d6
2019-11-06 14:05:27 -08:00
Joshua Baxter
e14bb68ce1 docs: fix typo
Change-Id: Ia0dab15920fdbead1842ff5a20ec6d4988f11fbe
test: make ds-docs
bug: 79355169
Exempt-From-Owner-Approval: docs-only change
2019-11-06 21:20:37 +00:00
Shuzhen Wang
db1322fab1 ImageWriter: Do not override UNKNOWN format twice
Currently when application calls ImageWriter.newInstance(Surface, int,
int), the default format of UNKNOWN is overridden to surface format in
Java side before being overridden again to user specified format (from
RGBA to IMPLEMENTATION_DEFINED). This breaks backward compatibility with
certain gralloc implementations.

Do not override UNKNOWN format in Java side.

Test: testWriterFormatOverride
Bug: 143637345
Change-Id: Ie61157bca11f623eff2b8c0ed2a988c86da07cb2
2019-10-30 21:17:48 +00:00
Kim Van Den Eeckhaut
38012613c9 Fix MediaCodec FLAC Javadoc
Make the Javadoc about the data expected in CSD buffer #0 for FLAC
consistent with the code.

Bug: 140613717
Test: javadoc-only fix
Change-Id: Ic2a35c6bd308a4f79215d920a88ccc2dd6f8cd12
2019-10-17 13:42:35 +01:00
Kun Niu
1e3288d6d1 Merge "add java_api_finder plugin to mainline module Media to generate java APIs used by Media." into qt-dev am: 01dfc10948
am: d122386e45

Change-Id: I679c0d4342a639abbe81af9d4351ccd0aa9f62f8
2019-10-07 13:32:00 -07:00
Kun Niu
66a5871d68 add java_api_finder plugin to mainline module Media to generate java APIs used by Media.
Bug: 129294170
Test: m updatable-media RUN_ERROR_PRONE=true |& tee media_error_prone.out
Change-Id: I3cdfe5e00394c6ff7b9c857f63a5e45ac79f8d24
(cherry picked from commit 6eff1d439b)
Merged-In: I3cdfe5e00394c6ff7b9c857f63a5e45ac79f8d24
2019-10-04 00:45:18 +00:00
Eric Laurent
38dceceaf2 Merge "AudioTrack: fix default low power mode selection" into qt-qpr1-dev 2019-09-13 19:28:16 +00:00
Eric Laurent
40f7e04f74 AudioTrack: fix default low power mode selection
Fix AudioAttributes flags checking logic in
shouldEnablePowerSaving() to take into account
flags that are compatible with deep buffer.

Bug: 140899988
Test: check that playback with Spotify goes to deep buffer
Change-Id: I492410b7837b15e248d61ec50dbb468e78e04524
2019-09-13 09:23:54 -07:00
Andy Hung
3ce301c6f3 SoundPool: Do not sleep on stop for USAGE_GAME or on BUFFER_END
Test: SoundPoolApplication, SoundPoolOggTest, Games
Bug: 139787914
Bug: 139788416
Bug: 140579743
Bug: 140779732
Merged-In: I83b9b1d61b65dcc4a73d676e1f8be1e022c70302
Change-Id: I83b9b1d61b65dcc4a73d676e1f8be1e022c70302
(cherry picked from commit a527524356)
2019-09-12 22:37:22 +00:00
TreeHugger Robot
f5fa3cf7cf Merge "ImageWriter: configure surface to use user specified format" into qt-qpr1-dev 2019-08-06 17:55:19 +00:00
Yin-Chia Yeh
6dc192efc9 ImageWriter: configure surface to use user specified format
Test: new CTS test
Bug: 136667655
Change-Id: I104b5c13c262fe82fb56c752b0129eca1fd844e7
2019-08-02 19:06:03 +00:00
Yin-Chia Yeh
edace1ab76 ImageWriter: increase timeout for BufDetachThread
To make the thread less busy.

Test: partner testing
Bug: 138352615
Change-Id: I1fe247ee33687bde450a819ace484653cf073a07
2019-07-30 13:02:59 -07:00
TreeHugger Robot
d1a84cb578 Merge "Media2: Make Javadoc consistent for recommending use of AndroidX" into qt-dev 2019-07-03 21:59:30 +00:00
Jaewan Kim
db90afdb78 Media2: Make Javadoc consistent for recommending use of AndroidX
Bug: 136602530
Test: Build docs offline and checked manually.
Change-Id: I70df7b05a6749b9ba492ac03cd3b9179a7416b9c
2019-07-03 14:55:55 +09:00
Mathew Inwood
36292fc9e2 Restore some greylist entries.
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
  information added

So they are being moved back to the greylist for Q.

Test: Treehugger
Bug: 136102585
Change-Id: I6518440a7b0de8292ad05b4df9f0f9580d18b2a5
2019-06-28 09:21:36 +00:00
TreeHugger Robot
c56f3bbfba Merge "Revert "libmedia_jni pulls in libsfplugin_ccodec"" into qt-dev 2019-06-24 19:52:28 +00:00
Mikhail Naganov
03bb294e57 Revert "libmedia_jni pulls in libsfplugin_ccodec"
This reverts commit 16c0c46f20.

Reason for revert: causes b/135763139 (volume adjustment for music does not work)

There is no clear explanation how this change breaks volume adjustment, but by bisection and by reverting the change locally it does somehow.

Bug: 133186424
Bug: 135763139
Change-Id: If6eed10f23c6b6006a6468c2a793230cd98c0501
2019-06-24 18:48:51 +00:00
Hyundo Moon
1348399885 Merge "Do not allow adding custom Parcelable in Bundles" into qt-dev 2019-06-24 04:26:17 +00:00
Lajos Molnar
cfb6f93443 Merge "media: clarify frame dropping behavior for decoder output" into qt-dev 2019-06-21 19:38:17 +00:00
Hyundo Moon
6cddbe14e1 Do not allow adding custom Parcelable in Bundles
This CL prevents the API users from passing any Bundles with
custom Parcelable to following APIs:
 - MediaSession2.Builder#setExtras()
 - MediaController2.Builder#setConnectionHints()
 - MediaSession constructor

Bug: 135572812
Test: Passed followings tests
  atest CtsMediaTestCases:android.media.cts.MediaSessionTest;
  atest CtsMediaTestCases:android.media.cts.MediaControllerTest;
  atest CtsMediaTestCases:android.media.cts.MediaBrowserTest;
  atest CtsMediaTestCases:android.media.cts.MediaSessionManagerTest;
  atest CtsMediaTestCases:android.media.cts.MediaSession2Test;
  atest CtsMediaTestCases:android.media.cts.MediaController2Test;
  atest CtsMediaTestCases:android.media.cts.MediaSession2ServiceTest;
Change-Id: I703c9fc0b180fb7bb3bf9bbec677f01a2a128c7a
2019-06-21 15:21:07 +09:00
TreeHugger Robot
1c0b6aa767 Merge "libmedia_jni pulls in libsfplugin_ccodec" into qt-dev 2019-06-20 20:27:22 +00:00
Steven Moreland
303a891220 Merge changes from topic "combine-libhidlbase-libhwbinder" into qt-dev
* changes:
  libhwbinder users use libhidlbase
  libmedia2_jni: remove libhwbinder_noltopgo ref
2019-06-20 19:09:01 +00:00
Ray Essick
16c0c46f20 libmedia_jni pulls in libsfplugin_ccodec
libmedia_jni now pulls in libsfplugin_ccodec instead of deferring it
until an actual reference. This eliminates some codec startup latency
later. this is only "load it", there is no actual use of
libsfplugin_ccodec by libmedia_jni.

Bug: 133186424
Test: boot, logcat, forrest startup timing measurements
Change-Id: Iacf8783cb45d33f5cec67863d4bf89da6dff9c2d
2019-06-20 09:35:54 -07:00
Lajos Molnar
9a5a383d9e media: clarify frame dropping behavior for decoder output
Bug: 135390389
Change-Id: Ie1b83e2db85703ea6fb03483b0ce08924de93e4f
2019-06-19 23:37:43 +00:00
Wonsik Kim
eaed9f519e media: keep JMediaCodec::mCodec reference until destruction
Releasing mCodec prematurely at release() sometimes causes double
free on MediaCodec objects.

Bug: 134770912
Test: atest CtsMediaTestCases:MediaCodecTest#testAsyncRelease (20 times)
Change-Id: Ieb265c9c4d74bd6bd3b34f0a713c8fa7dd2dedd1
2019-06-19 10:44:36 -07:00
Steven Moreland
e5da40639c libmedia2_jni: remove libhwbinder_noltopgo ref
No longer needed, these symbols are in libhidlbase.

Bug: 134961554
Test: boot
Change-Id: I79f0fd6edd329012929b7cbd161ed6b7202995d4
2019-06-18 17:20:06 -07:00
Eric Laurent
6acdc094d6 audioservice: add RTT mode observer
Add content observer for RTT mode: when RTT is ON during a call,
The assistant is allowed to capture audio similarly to when an
accessibility service is in the foreground.

Bug: 132976361
Test: use voice input during a call with RTT enabled.
Change-Id: Ief04d886370b50ae3dac0a72dbd1a4ea5f2c66a3
2019-06-11 15:01:45 -07:00
TreeHugger Robot
811c8a06e0 Merge "Move two audio APIs back the the greylist." into qt-dev 2019-05-31 22:07:49 +00:00
Jesse Evans
fabc1ad011 Fix documentation bug with METADATA_KEY_LOCATION
MPEG4Writer::writeGeoDataBox() has always written latitude
before longitude since it was introduced. And the ISO-6709
is also to have +-{latitude}+-{longitude}/ so we should have
the correct information here.

This is likely to be important for Q since lat/long are no
longer accessible via MediaStore.

Bug: 134100244
Test: documentation change only
Change-Id: If157e3b0a639da9e012c0dd23fcfacfa0a59c28e
2019-05-31 18:02:05 +00:00
Jeff Sharkey
6f574c4d3a Merge "video files with mimetype “video/x-ms-asf” can't scan to Gallery" into qt-dev 2019-05-31 00:10:04 +00:00
Vineet Jhunjhunwala
5a7b1183a3 video files with mimetype “video/x-ms-asf” can't scan to Gallery
video files with mimetype  “video/x-ms-asf”  are considered as PlayList
file type due to below check in MediaFile.Java
Do not consider it as playlist file and remove case of “video/x-ms-asf”

Bug: 133940458
Test: The video is show in gallery
Change-Id: I6af45b597d9b8d9b277e1ae89f2afe019ee2eead
2019-05-30 15:54:37 -06:00
TreeHugger Robot
3de2438d5c Merge "AudioService: remove dead BT code" into qt-dev 2019-05-30 18:36:34 +00:00
Mathew Inwood
5e757204d3 Move two audio APIs back the the greylist.
These APIs are used by older versions of the unity game engine, and many
of these games are not in a position where they are able to update
unity. To keep these games working now and in the future, leave these
APIs on the derestricted greylist.

Bug: 134049522
Test: m
Change-Id: I541ed6fbacfc1e405a319af5c2ff785625afb26a
2019-05-30 15:26:56 +01:00
Jin Seok Park
f66a0737ca Merge "Catch OutOfMemoryError and log warning" into qt-dev 2019-05-30 09:40:57 +00:00
Jin Seok Park
6e3113302f Catch OutOfMemoryError and log warning
Bug: 133827762
Test: atest CtsMediaTestCases:android.media.cts.ExifInterfaceTest
Change-Id: I5c6e247136e033968f418a50276971a8a686e021
2019-05-30 14:26:11 +09:00
TreeHugger Robot
0c1f41d303 Merge "Fix MediaHTTPConnection.disconnect() blocking for a long time." into qt-dev 2019-05-29 22:51:36 +00:00
TreeHugger Robot
e83c7779c0 Merge "MediaFrameworkTest: Fix storage path" into qt-dev 2019-05-29 19:01:06 +00:00
Shuzhen Wang
f2d1172f48 MediaFrameworkTest: Fix storage path
Test: Run mediaframeworktest
Bug: 133767357
Change-Id: If2930dffff0582a6a1b33a7de15c3008aaf923bd
2019-05-29 09:50:00 -07:00
Beverly
1feff71387 Change suppresible type of voice comm signalling
USAGE_VOICE_COMMUNICATION_SIGNALLING shouldn't be considered
SUPPRESSIBLE_SYSTEM. It includes the ring tone sound when in a call.
Instead, it should not be suppressible like USAGE_VOICE_COMMUNICATION.

Test: manual
Fixes: 131756661
Change-Id: Ide8aafafe58c421f3b699e6de9358b4e73ad01c5
2019-05-29 13:36:12 +00:00
Tobias Thierer
7dc093c08b Fix MediaHTTPConnection.disconnect() blocking for a long time.
MediaHTTPConnection.seek() was creating new connections in a while
loop without checking whether another thread was busy concurrently
disconnecting.

When a new connection was created between the time the disconnect()ing
thread had disconnected the old one and acquired the synchronized
block, the new connection wouldn't be disconnected and therefore
seek() would not encounter an IOException; therefore, seek() would
not return quickly, leaving the disconnecting thread waiting to
acquire the synchronized block for a long time.

This CL fixes this by making seek() throw IOException quickly if
it discovers that another thread is trying to disconnect. This
is checked shortly before and after the new connection is created,
to avoid a race based on the order between the new connection
being created and the disconnecting thread reading the old
connection value. Note that this still doesn't stop a new
connection being created shortly after the previous one was torn
down - it only stops the disconnecting thread waiting for a long
time to acquire the synchronized lock.

Fixes: 131894499
Test: The following command hang 3/3 times before this CL, but
      succeeded 3/3 times afterwards:
      atest android.media.cts.NativeDecoderTest#testAMediaDataSourceClose

Change-Id: I3862a4367d0e46c64c0cbf7bcaa369aca5692871
2019-05-29 01:17:43 +01:00
TreeHugger Robot
1c66d4c716 Merge "AudioTrack: implement gapless transition for offload mode" into qt-dev 2019-05-28 19:11:28 +00:00
Eric Laurent
bb23d7c8b5 AudioTrack: implement gapless transition for offload mode
Bug: 119775911
Test: test track transition with offload playback cmd line app
Change-Id: Ib105f65eb62845feceff45fbda9bec165e219841
2019-05-28 08:33:18 -07:00