Commit Graph

7199 Commits

Author SHA1 Message Date
Michael Chan
2de156d15f Add AudioTrack.isDirectPlaybackSupported method
The method checks whether the provided AudioFormat can be played
via currently connected output devices w/o SRC or downmixing
by the framework.

Bug: 120044865
Test: atest CtsMediaTestCases:AudioTrackTest#testIsDirectPlaybackSupported
Change-Id: I63e8334a60d48c17999f500d87360f9c71185dfb
2018-12-06 14:41:03 -08:00
Jakub Pawlowski
15a81d7f78 JavaDoc fix
Test: make offline-sdk-docs
Change-Id: I0ae64b0b7c2d46d6b196ae98beecd4cf4e910db2
2018-12-05 13:47:29 +00:00
Jakub Pawlowski
b0b3a64a37 Java doc fix: @throw -> @throws
Test: compile javadoc
Change-Id: I243b824d0573470455d297c6d45a14e1b503e8ff
2018-12-05 10:58:28 +01:00
Hyundo Moon
8d2cfac24a Merge "AML: Make MediaSessionManager.createSession() as @SystemApi" 2018-12-05 06:48:30 +00:00
Jeff Sharkey
9246fc7616 Merge "Stop indexing location metadata." 2018-12-05 05:46:18 +00:00
Dongwon Kang
11ed9e33c9 Merge "MediaPlayer2: have a CloseGuard copy for media mainline as package-private." 2018-12-05 00:30:51 +00:00
Lajos Molnar
8d57b6ca54 Merge "MediaFormat: add more getters, setters as well as iterators" 2018-12-05 00:10:54 +00:00
Eric Laurent
171dba2c12 Merge "Audio: add getters for port ID in AudioTrack and AudioRecord JNI" 2018-12-04 21:22:16 +00:00
Jeff Sharkey
33e70bd6d2 Stop indexing location metadata.
The new ACCESS_MEDIA_LOCATION permission is designed to protect
the location metadata of items the caller doesn't own, but we can't
easily perform partial filtering of metadata from returned Cursor
objects based on per-row ownership, so we're forced to outright stop
indexing and returning location metadata via queries.

Apps can still easily obtain location metadata using ExifInterface.

Bug: 111892141
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I4d99e6aa7d94bb0e7a50ce86eb1ab0f1ed142d4a
2018-12-04 13:17:09 -07:00
TreeHugger Robot
50f3bbde56 Merge "Update and fix Visualizer class docs" 2018-12-04 19:59:51 +00:00
Mikhail Naganov
ca6a9f8fef Update and fix Visualizer class docs
1) Fix the formula for the 'kth frequency' in getFft method:
   since the 'fft' array holds n / 2 frequencies ranging from
   0 to Fs / 2, the correct formula is k*Fs/n.
   Also fix the last frequency index in the table.

2) Move the sample code for calculating magnitudes and phases
   from the fft array from 'onFftDataCapture' to 'getFft', provide
   a link.

3) Fix the sample code which wasn't taking into account that
   fft[0] is the real part of FFT at DC, and fft[1] is the real part
   of FFT at Fs / 2. Improve the sample code by linking the variable
   names closer to the variable names in the documentation.

Bug: 113790190
Test: atest CtsMediaTestCases:VisualizerTest
Change-Id: I07cc9cfcda5b8c44aae2742a26173e7a9475120a
2018-12-04 17:36:40 +00:00
Jeff Sharkey
f660c012b0 Merge "Add support for "Audiobooks"." 2018-12-04 16:58:17 +00:00
Dongwon Kang
94eaad6470 MediaPlayer2: have a CloseGuard copy for media mainline as package-private.
Test: build
Bug: 112766913, Bug: 120419300
Change-Id: I3da443b0742a8459beab9860342ec8164aaa303b
2018-12-04 08:45:47 -08:00
Hyundo Moon
0852ebab41 AML: Make MediaSessionManager.createSession() as @SystemApi
Bug: 119749862
Test: make update-api
Change-Id: Ic3df0c3312c789130624fc42efc77ea3e1e01ad0
2018-12-04 16:52:46 +09:00
Chong Zhang
c13bfd871d Merge "Fix ExifInterface for .heic when meta is at the end" am: 98c9cd7b20 am: 17fc70b1ee
am: 79fa7d39c3

Change-Id: I33880ecff74ecdc2a60b0857b3cb8e8164232030
2018-12-03 19:37:53 -08:00
Chong Zhang
79fa7d39c3 Merge "Fix ExifInterface for .heic when meta is at the end" am: 98c9cd7b20
am: 17fc70b1ee

Change-Id: Ib3073cfac59888d707583efd9a9fda1d3731f103
2018-12-03 19:24:28 -08:00
TreeHugger Robot
3af0f3a7c3 Merge "Specify AudioTrack HWAVSync timestamp units as nanoseconds" 2018-12-04 02:49:33 +00:00
Eric Laurent
2dc5483936 Audio: add getters for port ID in AudioTrack and AudioRecord JNI
Add JNI functions to retrieve unique port IDs allocated by audio policy
manager for AudioTrack and AudioRecord clients.

Test: basic manual playback and capture tests
Bug: 111438757
Change-Id: I41f2679329b76b7b28cf506c64b6ffa9192d940a
2018-12-03 16:28:33 -08:00
Dean Wheatley
bff3dae809 Specify AudioTrack HWAVSync timestamp units as nanoseconds
Clarify the documentation by specifying the units of
the timestamp for the HWAVSync case

Bug: 63901775
Test: make
Change-Id: Ida39a3ee5e6b4b0d3255bfef95601890afd80709
2018-12-03 09:29:47 -08:00
TreeHugger Robot
5b101d1348 Merge "RingtoneManager: add @Nullable to openDefaultRingtoneUri()." 2018-12-03 15:00:39 +00:00
Robert Shih
cd0ee52248 Merge "MediaPlayer2: Move Drm APIs into DrmHandle subclass" 2018-12-01 04:29:34 +00:00
Dongwon Kang
0d8fe14ad7 RingtoneManager: add @Nullable to openDefaultRingtoneUri().
Bug: 120072398
Test: make update-api
Change-Id: I9fd43ac80f643fe81b4ed16d84b4253f19899c1c
2018-11-30 16:18:44 -08:00
Chong Zhang
317316fb2b Fix ExifInterface for .heic when meta is at the end
available() bytes is counted after the last read position,
after the seek to new position, size should be compared
with the avaliable directly (without adding position).

bug: 120086693
test: Open .heic files in Downloads/Photos that's either
very small (b/117625929, b/111897855), or with the meta
at the very end (b/120086693). There shouldn't be error
in ExifInterface.
Change-Id: I37ac57823b26f03bb0ba555ee6213cf999942d21
2018-11-30 15:37:03 -08:00
Lajos Molnar
ad9814849a MediaFormat: add more getters, setters as well as iterators
Add getters with default value.
Add numeric getters for arbitrary numeric format.
Add ability to enumerate and remove keys and feature keys.
Add copy constructor.
Add nullable annotations.

Bug: 112369509
Change-Id: Ifcb4ab7c4b3599aae5f6bf49001e9e8bb24b0a33
2018-11-30 13:32:00 -08:00
Jeff Sharkey
10887d5e5a Add support for "Audiobooks".
Bug: 113356944
Test: manual
Change-Id: Ifed54c41a533ed2d556dc6561ea498ec293991a6
2018-11-30 13:53:19 -07:00
Hyundo Moon
9a908db9f4 Rename KeyEvent.isMediaKey() to isMediaSessionKey()
Since not all KEYCODE_MEDIA_* keycodes return true in isMediaKey(),
the naming can give confusion. This CL renames the method to
isMediaSessionKey() and revises its Javadoc.

Bug: 119789707
Test: make -j
Change-Id: I36786ccf5606977e6d971c13d77d950356561bda
2018-11-30 13:54:32 +09:00
Robert Shih
488be992a4 MediaPlayer2: Move Drm APIs into DrmHandle subclass
Bug: 119675660
Test: MediaPlayer2DrmTest
Change-Id: I7a48ec1c2b4ba86752b12935b275140f03978495
2018-11-29 20:42:03 -08:00
TreeHugger Robot
5f0c9331cc Merge "Make AudioManager.FLAG_FROM_KEY as @SystemApi" 2018-11-30 04:03:30 +00:00
TreeHugger Robot
83fc1328d7 Merge "Commenting exit condition from read thread." 2018-11-30 00:16:14 +00:00
Paul McLean
0d8753073a Commenting exit condition from read thread.
Silence spurious exception error reporting.

Test: Run CTS and CTSVerifier Midi tests.
Bug: 114123487
Bug: 120225301

Change-Id: I82b13e563c30ba42e02625cfe57bd27897cb8035
2018-11-29 13:43:22 -07:00
TreeHugger Robot
04eaec037e Merge "MediaPlayer2: rename Media2DataSource to DataSourceCallback" 2018-11-29 16:27:21 +00:00
Hyundo Moon
888b791f29 Make AudioManager.FLAG_FROM_KEY as @SystemApi
Bug: 119790339
Test: make update-api
Change-Id: I649cd5cbf64274e5fe840eb773a450c3c581b210
2018-11-29 13:35:51 +09:00
Wei Jia
073e1b11b3 MediaPlayer2: rename Media2DataSource to DataSourceCallback
Test: cts
Bug: 112549021
Change-Id: I4f623d2c94e855f7af51f20a207db05b6da4b221
2018-11-28 16:54:57 -08:00
TreeHugger Robot
1dbe2b2092 Merge "AudioService: monitor assistant and accessibility services" 2018-11-28 23:38:13 +00:00
TreeHugger Robot
7f0503a4c9 Merge "MediaPlayer2: use ParcelFileDescriptor" 2018-11-28 22:34:13 +00:00
Eric Laurent
1c9c1d53b2 AudioService: monitor assistant and accessibility services
Add monitoring of voice interaction service, assistant and
accessibility services changes and communicate corresponding UIDs
to audio policy service.
Those are needed to implement the concurrent audio capture policy.

Test: enable and disable Google Assistant and Voice Access.
Bug: 111438757

Change-Id: Ia20b54a70c0445113bd53b03b04a325dcf7940fb
2018-11-28 09:18:26 -08:00
Wei Jia
da21c3d3df MediaPlayer2: use ParcelFileDescriptor
Test: cts
Bug: 112549021
Change-Id: Ic1644e82558cc47fcba1152d8a1c7c10b6f7ef8c
2018-11-28 09:06:46 -08:00
Jeff Sharkey
c583071b97 Merge changes from topic "exifz"
* changes:
  Track attribute ranges, parse additional times.
  Sane undefined behaviors for XmlUtils.
2018-11-28 16:03:04 +00:00
Dongwon Kang
328d44264c Merge "MediaPlayer2: replace external constant annonations with local ones" 2018-11-28 01:13:55 +00:00
Dongwon Kang
9a38e474e8 Merge "Media2HTTPConnection: remove hidden API usage, NetworkUtils.numericToInetAddress()" 2018-11-28 01:13:12 +00:00
TreeHugger Robot
07f69e6616 Merge "MediaPlayer2: replace Preconditions (internal api) with Media2Utils." 2018-11-28 01:08:34 +00:00
Dongwon Kang
4c7fc50795 MediaPlayer2: replace external constant annonations with local ones
Test: build
Bug: 112766913
Change-Id: I94f110caed01b5aa8ec56bff2d9da8a7d5dcc4b9
2018-11-27 16:58:06 -08:00
Dongwon Kang
dfd0ca889f Media2HTTPConnection: remove hidden API usage, NetworkUtils.numericToInetAddress()
Test: build
Bug: 112766913
Change-Id: Id383a06460034aa51654987249119e6bff3b7dde
2018-11-27 16:58:06 -08:00
Paul McLean
b3ae6d9490 Move JNI init for OpenSLES audio routing to system startup.
Moved AudioTrack.CHANNEL_COUNT_MAX and AudioTrack.native_get_FCC_8() to AudioSystem.

Bug: 115560661
Test: build/install/run native audio routing CTS
Change-Id: I03b14a0302aa0d6a1bc78f4daf5a521446042f66
2018-11-27 14:00:34 -07:00
Jeff Sharkey
dffaa69997 Track attribute ranges, parse additional times.
An upcoming privacy feature is interesting in knowing the exact
offset and length of specific Exif tags, similar to how the thumbnail
range is already being returned.  Detect the case where we've modified
the underlying file, meaning ranges are no longer valid.

Add constructor to accept best-practices File object.  Add method to
ask if a given tag has been defined.  Add methods to parse additional
timestamp values.

Bug: 115377970, 111892141
Test: atest android.media.cts.ExifInterfaceTest
Change-Id: Iac35bb65ff7b3605d6c32ec3ca3d29b17e65cff8
2018-11-27 13:39:03 -07:00
Dongwon Kang
0c0e939d59 MediaPlayer2: replace Preconditions (internal api) with Media2Utils.
Also setting sdk_verion for mediaplayer2.proto

Test: build
Bug: 112766913
Change-Id: I537ee296d9e1a0b127567943a68dc985a48ad86f
2018-11-26 20:16:54 -08:00
TreeHugger Robot
e48305da06 Merge "Hook up MediaExtractor getAudioPresentations to native impl" 2018-11-27 01:49:18 +00:00
Dichen Zhang
898dd65029 Merge "Revert "Make AudioManager.generateAudioSessionId() static"" 2018-11-26 23:34:18 +00:00
Sampath Shetty
08e7706d92 Hook up MediaExtractor getAudioPresentations to native impl
Adds interface to MediaExtractor JNI to retrieve AudioPresentations

Test: Manual test
Bug: 119312182
Change-Id: I5802ff20b8221aeede25148cb3213b0e9e74f270
2018-11-26 15:24:41 -08:00
Dichen Zhang
f50b236b95 Revert "Make AudioManager.generateAudioSessionId() static"
This reverts commit 2d767d2f8b.

Bug: 119775358
Test: MediaPlayer2Test, androidx media2 integration
Change-Id: I1ea474a6fd02f54e8fa983edf7e188cc732fa7cc
2018-11-26 13:30:46 -08:00