Commit Graph

7797 Commits

Author SHA1 Message Date
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
Hyundo Moon
1348399885 Merge "Do not allow adding custom Parcelable in Bundles" into qt-dev 2019-06-24 04:26: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
Lajos Molnar
9a5a383d9e media: clarify frame dropping behavior for decoder output
Bug: 135390389
Change-Id: Ie1b83e2db85703ea6fb03483b0ce08924de93e4f
2019-06-19 23:37:43 +00: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
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
Jean-Michel Trivi
58dfb9816a AudioService: remove dead BT code
Remove dead BT code that supported the implementation of
AudioManager.handleBluetoothA2dpActiveDeviceChange() but
was made obsolete with d7c9598 ("Restructure A2DP active device
change").

Bug: 132416679
Test: m -j (no functional changes)

Change-Id: Iedca8a5225548f205920ef50bb3ad8865eb99d1d
2019-05-24 10:59:52 -07:00
Kyunglyul Hyun
5644a46b3c Merge "Media: Add group id for media router to sync" into qt-dev 2019-05-24 02:32:17 +00:00
Jin Seok Park
8a2a706e17 Prevent file descriptor leak
Bug: 133251455
Test: atest CtsMediaTestCases:android.media.cts.ExifInterfaceTest;
Change-Id: I9f27e1dd44908921f1a46d8bcdd8ad8090158d18
2019-05-24 09:11:33 +09:00
Kyunglyul Hyun
cd18ace571 Media: Add group id for media router to sync
This CL adds MediaRouter.setRouterGroupId() methods to set the "group id"
of a media router.

Media routers that have the same group id synchronize their
selected route.

For example, if System UI and Settings use the group id, you can see
"connected" status from System UI even if the cast begins from Settings
, and vice versa.

Bug: 112826114
Bug: 131385091
Bug: 130345243

Test: manually w/ setting the same group id for Settings and System UI.
Change-Id: I9d4e061b57f52d7b2bec622b5f02068f3d11c133
2019-05-23 21:56:47 +09:00
Ivan Chiang
d580b03f3f Merge "Fix thumbnail's orienation issue" into qt-dev 2019-05-22 02:10:52 +00:00
TreeHugger Robot
111a49ba97 Merge changes I256e6ed1,I97d41ed0,I6b4177e4 into qt-dev
* changes:
  System apps are not allowed to record better then 16kHz mono
  Fix permission check when registering an audio policy
  Refactor security checks to register policies
2019-05-21 00:15:56 +00:00
Kevin Rocard
e5b29c98ee System apps are not allowed to record better then 16kHz mono
This privacy requirement was documented but was not implemented.

Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 129948989
Change-Id: I256e6ed1965263416a893393d5462ec73099751e
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-05-20 15:31:00 -07:00
Ivan Chiang
8214d58d2c Fix thumbnail's orienation issue
- If we do full file decoding, we should not handle orientation by
  ourselves.
- If we decode the thumbnail from ExifInterface.getThumbnailBytes()
  or MediaMetadataRetriever, we should handle the orientation.

Change-Id: I632b0b0ed41710401192dfb12f407eaf74c480ba
Fix: 130446058
Test: manual
2019-05-20 19:38:42 +08:00
TreeHugger Robot
e827932a9c Merge "Change warning logs to debug logs" into qt-dev 2019-05-20 07:19:29 +00:00
Jeff Sharkey
0da5bd1845 Compare ringtones using IDs.
Comparing by constructing full Uris doesn't work when one of the
values has been canonicalized.

Bug: 132816653
Test: atest android.media.cts.RingtoneManagerTest#testAccessMethods
Change-Id: Id4b26820e76ec3d1d56ba6cf3c76375dafcf92c0
2019-05-16 13:39:29 -06:00
Jin Seok Park
8492ade199 Change warning logs to debug logs
Bug: 120077644
Test: N/A
Change-Id: I2cf4265b92d0d23564a92b8600733f6ba3920e0a
(cherry picked from commit d9be5e0cc7)
2019-05-15 01:21:26 +00:00
Jeff Sharkey
4cf4a8b0ec Missing thumbnails should throw.
Bug: 132248209
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Iac17eaa17c25041de13069f1e73a70006051ab8b
2019-05-14 11:25:49 -06:00
Jeff Sharkey
6b8a715861 Merge "Parse Exif OffsetTime in MediaScanner" into qt-dev 2019-05-12 14:12:11 +00:00
Ken Narita
fd1323e73f Parse Exif OffsetTime in MediaScanner
MediaScanner parses Exif OffsetTime value to use UTC time
for DATE_TAKEN value.

Bug: 62856173
Change-Id: Iffb7e0ae296b73ce6fb6515246871f0dcfe42bb0
2019-05-11 18:34:31 -06:00
TreeHugger Robot
1b62363005 Merge "MediaPLayer: remove unused code" into qt-dev 2019-05-10 23:33:28 +00:00
Kevin Rocard
db0ff41675 Fix APC documentation
Bug: 129948989
Test: m -j offline-sdk-docs
Change-Id: I0205979e37f397794e0dc4f390ad4aad5c74c630
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-05-10 11:09:01 -07:00
Hyundo Moon
d1cbccb628 Merge changes I0a5c576b,I54fcf97b into qt-dev
* changes:
  Remove MediaParceledListSlice
  Remove MediaSessionServiceImpl
2019-05-10 03:42:49 +00:00
Eric Laurent
9d7df41b17 MediaPLayer: remove unused code
remove mBypassInterruptionPolicy unused since
app ops are managed by PlayerBase.

Bug: 131873101
Test: make
Change-Id: Ifb07fd0f4e5a14384b71ac010a35614969b9761e
2019-05-09 17:14:12 -07:00
TreeHugger Robot
1ef70c3781 Merge "AudioService: implement de-registration (release) of recorders" into qt-dev 2019-05-09 18:26:30 +00:00
TreeHugger Robot
8af653e8b2 Merge "Fix AudioRecordingConfiguration.anonymizedCopy method" into qt-dev 2019-05-09 16:28:30 +00:00
Mikhail Naganov
cfe4c2627e AudioService: implement de-registration (release) of recorders
Clients must unregister themselves when client-side AudioRecord
goes away. This allows removing the tracking record sooner than
the client app goes away.

"DEATH" event has been renamed to "RELEASE". Client death is handled
the same way as regular release.

Bug: 123312504
Test: start and stop audio recording, check "dumpsys audio"
Change-Id: I6a9578b29ab3c41bac2bf4c823224276efbe1beb
2019-05-09 09:25:45 -07:00
Hyundo Moon
bb07e9bc5c Remove MediaParceledListSlice
Bug: 132233794
Test: 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: I0a5c576b3fc9d2e236256d8f9f4e992914b147be
2019-05-09 17:11:44 +09:00
Kevin Rocard
b14fdecc4e Do not try to unregister APC multiple time
If audioRecord.release() is called explicitly, APC DP is released.
When the AudioRecord.finalizer() is called by the JVM, the APC DP would
be released again, leading to misleading error message.

Bug: 131064451
Test: call AudioRecord release and check that the finalizer do not log a
      release failure
Change-Id: Ia7092274ea8ac8e0a6754dfe2541f823f650384d
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-05-08 23:37:31 +00:00
Mikhail Naganov
fc27a5cf69 Fix AudioRecordingConfiguration.anonymizedCopy method
Client port ID must not be anonymized as it is used by
AudioRecord class to filter out the corresponding
recording configuration.

Bug: 123312504
Bug: 131756086
Test: atest CtsMediaTestCases:AudioRecordTest#testAudioRecordInfoCallback
      atest CtsMediaTestCases:AudioRecordTest#testGetActiveRecordingConfiguration

Change-Id: I3e32395e9df107db76cfc940fecda8d066c05d97
2019-05-08 17:21:50 +00:00
Winson Chiu
8197beee18 Merge "Call MediaStore#scanFile directly in RingtoneManager" into qt-dev 2019-05-07 17:21:16 +00:00
Hyundo Moon
fefe5c7ff1 Merge "Enhance Javadoc of playback speed related APIs" into qt-dev 2019-05-07 05:13:24 +00:00
Winson
295336f6e8 Call MediaStore#scanFile directly in RingtoneManager
Reproduced the failing case, even without thread pool changes.
Since RingtoneManager was blocking on the call anyways, changing it
to use the synchronous scanFile method directly should be fine.

Bug: 131882699

Test: manual add MP3 with RingtonePickerActivity

Change-Id: I53b49ed17403cda93ecfefb6985133b161a96983
2019-05-06 17:06:02 -07:00
Robert Shih
c9b5dfcf80 Merge "MediaCodec: save MediaCrypto ref until reset/release" into qt-dev 2019-05-03 18:20:16 +00:00
Hyundo Moon
7d8de6909a Enhance Javadoc of playback speed related APIs
This CL also makes throw IllegalArgumentException when controller
tries to set the speed to zero.

Bug: 131873534
Test: atest CtsMediaTestCases:android.media.cts.MediaSessionTest;
      atest CtsMediaTestCases:android.media.cts.MediaControllerTest;
      atest CtsMediaTestCases:android.media.cts.MediaBrowserTest;
      atest CtsMediaTestCases:android.media.cts.MediaSessionManagerTest;
Change-Id: I78f775df369de48b1ebda66fdb6e251b6e0865c1
2019-05-03 14:19:58 +09:00
TreeHugger Robot
b037feb130 Merge "Fix can't create thumbnail and wrong orientation issue" into qt-dev 2019-05-02 05:01:15 +00:00