Commit Graph

7543 Commits

Author SHA1 Message Date
TreeHugger Robot
e7979eb41f Merge "MediaPlayer2: address API council comments" 2019-03-04 20:08:38 +00:00
Jean-Michel Trivi
aca7f5ab7c Merge "AudioTrack.StreamEventCallback: fix missing annotation" 2019-03-04 16:38:25 +00:00
Jean-Michel Trivi
22b376cd60 AudioTrack.StreamEventCallback: fix missing annotation
Bug: 124301616
Test: m -j ; make api-stubs-docs-update-current-api ; m -j
Change-Id: I6e7dbe6130e57a2dfdc2ea0cdecbd5a23d565bab
2019-03-02 17:46:58 -08:00
Jean-Michel Trivi
fa0a6004ca Merge "Audio APIs: deprecate deprecateStreamTypeForPlayback method" 2019-03-03 00:24:02 +00:00
Jean-Michel Trivi
cc0e77b16d Merge "AudioTrack: moar annotations and getters" 2019-03-02 22:39:14 +00:00
Jean-Michel Trivi
16f0a6ac2d Audio APIs: deprecate deprecateStreamTypeForPlayback method
The method deprecateStreamTypeForPlayback() is inherited from
  android.media.PlayerBase, which is hidden. This method was never
  intended to be in the SDK, but somehow ended up in the public SDK.

Bug: 126701135
Bug: 126702126
Bug: 126702177
Test: make -j api-stubs-docs-update-current-api
Change-Id: Ibdd7898f18432c2179f81cd53b132164bcd4c670
2019-03-02 12:45:11 -08:00
Jean-Michel Trivi
deaf230d08 AudioTrack: moar annotations and getters
Bug: 126698363
Bug: 124301616
Test: m -j ; make api-stubs-docs-update-current-api ; m -j
Change-Id: I91ae70a57c367308ebe52ccc7c5e579821d65151
2019-03-02 11:40:12 -08:00
Wei Jia
2fc1654ab1 MediaPlayer2: address API council comments
Test: cts
Bug: 126700359
Bug: 126701061
Bug: 126701365
Bug: 126701652
Bug: 126701657
Bug: 126701901
Bug: 126702124
Bug: 126702181
Bug: 126702182
Change-Id: I3b33d7c1a403b6d2c13b93e5937a0f1a3e4d80a1
2019-03-01 17:45:31 -08:00
Dongwon Kang
436a76d1fa Merge "Use Uri.toSafeString() in MediaPlayer[2].java." 2019-03-01 17:10:08 +00:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
Dichen Zhang
f3e094ff1b Merge "revert "HLS seeking: call readAt() on new thread"" am: 00a4170c0c am: a97abe701c
am: c47b1fc295

Change-Id: I5db7a2fee3f1db87456d880606ab9caac024ceff
2019-02-28 17:02:34 -08:00
eunyoung.moon
db21cbae34 Use Uri.toSafeString() in MediaPlayer[2].java.
Bug: 123669012
Test: play HLS/RTSP streaming
      atest CtsNetTestCases:android.net.cts.UriTest
Signed-off-by: Eunyoung Moon <eunyoung.moon@lge.com>

Change-Id: I3695b0a6f28df3dfff981de2dcd6417d227965ae
2019-02-28 16:59:53 -08:00
Dichen Zhang
c47b1fc295 Merge "revert "HLS seeking: call readAt() on new thread"" am: 00a4170c0c
am: a97abe701c

Change-Id: I4266221c9d5ebca4b5c4cb6c05a371e9ae01cf16
2019-02-28 16:46:13 -08:00
Dichen Zhang
a97abe701c Merge "revert "HLS seeking: call readAt() on new thread""
am: 00a4170c0c

Change-Id: Ia2a3db95cc56e23252b0d9df28e5c3289c1a34e5
2019-02-28 16:35:39 -08:00
TreeHugger Robot
9423ec6ee6 Merge "AudioPresentation: Address API review comments" 2019-02-28 23:08:52 +00:00
Mikhail Naganov
d32ecddf4b AudioPresentation: Address API review comments
- Added explanation when AudioPresentation.Builder needs to be
  used.
- Add @NonNull to Builder.setLocale parameter.
- Complete parameters docs for Builder's methods.
- Use 'CharSequence' instead of 'String' in Builder.setLabels.
- Mark Builder class as final.

Bug: 125800702
Test: atest CtsMediaTestCases:AudioPresentationTest
Change-Id: Ib2c259439a0fde29612ce75b20f7f318d378d71f
2019-02-28 12:01:37 -08:00
Andrei-Valentin Onea
94bd7aac42 Merge "Add @UnsupportedAppUsage annotations" 2019-02-28 15:21:13 +00:00
Kevin Rocard
6efe144d48 Merge "Register policy with AudioManager" 2019-02-28 05:21:21 +00:00
Kevin Rocard
a9c3a3a47b Merge changes from topic "APC-PackageManagerNative"
* changes:
  Allow to project audio from a Screen capture MediaProjection
  Expose allowAudioPlaybackCapture to PackageManagerNative
  Introduce playback capture application manifest flag
2019-02-28 05:19:58 +00:00
François Gaffie
ebb67d0e77 Add Volume per Attributes setter/getters
This patch adds in AudioSystem setter/getter of volume index
and also getter on index min and max according to the given
audio attributes.

Bug: 124767636
Test: dumpsys media.audio_policy
Change-Id: Ia20fcfbf5e20c98de5eb07551c299dc99d678fb8
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-02-27 16:22:00 -08:00
François Gaffie
9c36210d29 Add Volume Groups API to AudioManager
-put in cache collection in AudioService
-add helper function in Strategies and volume groups

Bug: 124767636
Test: dumpsys media.audio_policy
Change-Id: I688abf79ce7dead927fbd021e48bf6460d6cdc85
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-02-27 16:21:51 -08:00
François Gaffie
adcd00a7c8 AudioVolumeGroup introspection & callback JAVA APIs
This CL adds introspection APIs for Audio Volume group
and callback notification on group volume change.
It allows to keep the same level of service available today
in CarAudioManager and is a starting point to get rid of Stream Alias
hard coded in AudioServer.

Bug: 124767636
Test: dumpsys media.audio_policy
Change-Id: I48909df93c146f071acd24cd3ecc608cb98b4d7e
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-02-27 16:21:27 -08:00
Kevin Rocard
be64d36ea3 Register policy with AudioManager
The policy was previously not registered. Resulting in a failure when
starting the recording.

Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 111453086
Change-Id: Ib0bbdfefd644c2f8e389baafdc1fc3ad548dcc4c
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-02-27 15:36:44 -08:00
Dichen Zhang
6593694f97 revert "HLS seeking: call readAt() on new thread"
This reverts commit Ie527aeaff91e1b82c7e707a6feaf79548c7ac380

Bug: 119900000
Test: go/ag/5140159

Change-Id: Ia8b2f3efc2f3551e749c16c6c8dfbc070f8bb980
2019-02-27 11:04:02 -08:00
Jean-Michel Trivi
848d66e074 Merge "AudioSystem: disable verbose volume logging" 2019-02-27 15:31:15 +00:00
Andrei Onea
da6e570f1e Add @UnsupportedAppUsage annotations
For packages:
  android.database
  android.hardware
  android.hardware.display
  android.hardware.input
  android.hardware.location
  android.location
  android.media
  android.media.tv
  android.media.projection

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I570c08292f8a9f512c96f9dce13f5337718f112c
2019-02-27 13:31:11 +00:00
Kevin Rocard
92488ea2b2 Allow to project audio from a Screen capture MediaProjection
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: I81d5f9b3af5ab47757b9075228ce07e30e6a0fcf
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-02-27 03:15:50 -08:00
Kevin Rocard
f91d50b620 Introduce playback capture application manifest flag
Allow apps to opt-out of their playback beeing recorded with an
application wide out-out.

Previously an application had to opt-out on each of its audio tracks.

Application targeting an SDK < Q are considered opt-out by default.
Application targeting an SDK >= Q are considered opt-in by default.

Test: adb shell audiorecorder --target /data/file1.raw &
      adb shell am start -a android.intent.action.VIEW -d file:///system/media/audio/ringtones/Lollipop.ogg -t audio/ogg
      adb dumpsys media.audio_policy # check playback is *not* recorded
      # change packages/apps/Music manifest to allowPlaybackCapture=true
      adb install out/target/product/walleye/system/product/app/Music/Music.apk
      adb shell am start -a android.intent.action.VIEW -d file:///system/media/audio/ringtones/Lollipop.ogg -t audio/ogg
      adb dumpsys media.audio_policy # check playback is recorded
      kill %1
      adb pull /data/file1.raw && sox -r 48000 -e signed -b 16 -c 2 file1.raw file.wav&& audacity file.wav
      # check that the audio file contains first silence then the ringtone after the manifest flag was added
Bug: 111453086
Change-Id: Ie617b15f481a7f148b6e9fc9d64e61acaa5ce71d
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-02-27 03:15:50 -08:00
François Gaffie
f4f3bfe747 Add API to retrieve Audio Product Strategy from a given Audio Attributes
In order to ensure only one matching algorithm is implemented in the
audio policy engine, we cannot use the list of audio product strategy
to let the client of this API inferring the product strategy to use.
It shall request the audio policy manager which product strategy shall be
followed by a given Audio Attributes.

Bug: 124767636
Test: dumpsys media.audio_policy
Change-Id: I372a47df4a35efd68a3ea327581af54823997dba
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-02-26 21:27:19 -08:00
François Gaffie
0699fecd47 AudioManager: add Audio Product Strategies introspection SystemAPI
Bug: 124767636
Test: dumpsys media.audio_policy
Change-Id: I31b970d7439f76604079d4cffc67bc9373df08e1
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-02-26 21:27:19 -08:00
Jean-Michel Trivi
44abe2cc7c AudioSystem: disable verbose volume logging
Test: adb shell dumpsys audio ; adb logcat
Change-Id: I79a7bb6f5547d1c0589ca0ce9d95830d60bfbe76
2019-02-26 18:12:54 -08:00
Jean-Michel Trivi
54beaa6c2a Merge "AudioPolicy API fixes" 2019-02-26 23:45:58 +00:00
Jean-Michel Trivi
25afee2f02 AudioPolicy API fixes
Do not hide default constructor for volume callback.
Use boolean to return status when only failure and success
  can be returned.

Bug: 113857008
Bug: 125800502
Test: same as for feature
Change-Id: I421d5c9b4ea1aeba897bef8b30006261c7b61e78
2019-02-26 13:37:24 -08:00
Toshikazu Saito
6aee256d92 Fix a dead lock for SubtitleTrack
Dead lock happens in notifyTrackData() and scheduleUpdate() of
TimeProvider. notifyTrackData() gets lock and calls SRTTrack.onData().
SRTTrack gets lock in addCue() but does not get lock in onData(). So
SRTTrack.setTimeProvider() can call before next addCue() is called.
When scheduleUpdate() is called from SRTTrack.setTimeProvider() in that
case, dead lock happens because following reason.

- TimeProvider is already gotten lock in notifyTrackData()
- scheduleUpdate() tries to get lock of TimeProvider but
  notifyTrackData() is not finished because SRTTrack.onData() waits for
  calling next addCue()
- SRTTrack waits for finishing setTimeProvider() to get lock
- setTimeProvider() is not finished because lock cannot be gotten in
  scheduleUpdate()

This fix changes the looper for SubtitleController to the looper used
in TimeProvider$EventHandler not to interrupt a message by
SubtitleController while running notifyTrackData().

Bug: 122051638
Test: check if subtitle works correctly with MediaPlayer

Change-Id: Ib77144c5adb811676899a8d7e7681045663de0d2
2019-02-25 14:20:34 -08:00
Kevin Rocard
2f9dd0aa80 Merge "Public Audio playback capture must have a valid projection" 2019-02-23 05:22:33 +00:00
Henry Fang
dd6eb81b19 Merge "Change framework to support both cas@1.0 and cas@1.1 hal" 2019-02-22 18:21:59 +00:00
Kevin Rocard
2fe8b8b6e7 Public Audio playback capture must have a valid projection
For privacy, require the app wanting to capture other app audio to have
a valid MediaProjection.

Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: I1323048fe308282d3719e38915818a0da17567de
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-02-22 09:48:44 -08:00
Hyundo Moon
280dd70418 Merge "Add MediaController#getSessionInfo()" 2019-02-22 11:18:48 +00:00
Hyundo Moon
5fc8db02e0 Add MediaController#getSessionInfo()
Bug: 125663825
Test: Passed MediaControllerTest
Change-Id: I458cfd94575dd2303ec2bdd8996205d765d31957
2019-02-22 20:08:29 +09:00
TreeHugger Robot
47aa1516f6 Merge "Audio: Allow registering DAP without context" 2019-02-22 05:52:14 +00:00
TreeHugger Robot
432b9640a6 Merge "Add annotations for ImageReader/ImageWriter factory methods" 2019-02-22 00:27:43 +00:00
Xin Li
b455c3a7f3 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: I2f9a524f2ba552de3f62e343075cf0abf400bbae
2019-02-21 16:02:06 -08:00
Henry Fang
a26835ece8 Change framework to support both cas@1.0 and cas@1.1 hal
Cas framework doesn't work with cas@1.0 hal after cas@1.1 hal was enabled.
Framework code should support all hal version with same major number.
Test: Manual
bug: 124132050

Change-Id: I24d4c87ec643702fd6e7bb3c347d7982a4d12f36
2019-02-21 15:54:53 -08:00
TreeHugger Robot
02f07eb143 Merge "Add a new reason for unavailable video, when there is no signal." 2019-02-21 11:08:37 +00:00
Robert Berry
73cee8c48a Audio: Allow registering DAP without context
Tests and command line interfaces do not have context, which
artificially prevented them to use the Dynamic Audio Policy API.

Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: I3f811f317f7de3282baca308bb5afa5334bf860b
Signed-off-by: Kevin Rocard <krocard@google.com>
Signed-off-by: Robert Berry <robertberry@google.com>
2019-02-20 22:32:32 -08:00
TreeHugger Robot
15b7740dce Merge "Introduce playback capture opt-out" 2019-02-21 05:36:36 +00:00
Kevin Rocard
9ce6e56c00 Introduce playback capture opt-out
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: Ie09f7161bf19b158e31f4a18e9c9a27c70382686
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-02-21 00:43:33 +00:00
Robert Berry
669be0445c Introduce audio playback capture API
This API allows an app to record what other apps are playing
with some privacy restrictions.

Test: CTS
Bug: 111453086
Change-Id: I98ed789afb792acf90876499aa5eb8a47359b265
2019-02-21 00:42:48 +00:00
Kristian Monsen
f3f2d4caac Add a new reason for unavailable video, when there is no signal.
Bug: 112860967
Test: NA
Change-Id: Ie7436c91260f96b398f300eef054a5377c89fcf6
2019-02-20 19:49:27 +00:00
Yin-Chia Yeh
e7c158f114 Add annotations for ImageReader/ImageWriter factory methods
Test: make update-api && make
Bug: 124766727
Change-Id: I7f7c5afd013370ab6e42c28b96b3cfa93e8dc615
2019-02-20 10:48:04 -08:00