Commit Graph

16 Commits

Author SHA1 Message Date
Andrew Sapperstein
4c4aa41272 Update inner class constructor refs to use proper syntax.
Previously, we generally required fully qualified names for referring
to inner class constructors (like #Notification.Builder()) despite that
not being valid javadoc. Now, we properly support #Builder() syntax and
the old syntax will error.

Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
2020-04-29 13:16:02 -07:00
Andrew Sapperstein
e0624c7a40 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
2020-04-28 12:37:15 -07:00
Oscar Azucena
4e4d6e3b85 Remove user id based audio captured API.
Removed recently added user id based routing for audio playback capture.
The original goal of the user id based routing was for the routing to be
controlled by audio policy and to controll where audio from a user
could play. The audio playback capture was added to match similar API
provided for audio playback capture based on application's uid.
Currently, there is no appropiate use case for capturing based on user
id. While this could prove useful in the future the appropiate use case
research must be completed. Updated comments for audio policy user id
based routing.

Bug: 149419551
Test: atest AudioPlaybackCaptureTest
Test: atest
com.google.android.gts.audio.AudioHostTest#testUserIdDeviceAffinity

Change-Id: I174cba618c4f66d11185e7ab5630094b4a8cb35b
2020-02-14 20:59:38 -08:00
Oscar Azucena
76788f0bd0 Added Android user id based audio routing.
Added Android user id based routing. Added API to defined and removed
user id based routing. The APIs are based on the applications uid based
routing. The logic for user id based routing also largely resembles the
application's uid based routing.

Bug: 139365417
Test: atest
com.google.android.gts.audio.AudioHostTest#testUserIdDeviceAffinity
Test: atest AudioPlaybackCaptureTest
Change-Id: I1f458680c96439f047829d5b2a5d1f0d37be60bd
2020-01-23 00:41:59 +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
Kevin Rocard
4bea465dbb Merge "Add getters to AudioPlaybackCaptureConfiguration" into qt-dev 2019-04-15 16:02:07 +00:00
Kevin Rocard
de5cc3c8c1 Add getters to AudioPlaybackCaptureConfiguration
Unfortunately AudioMixingRule being in a different package,
some of its members had to be made public @hide to be used
by AudioPlaybackCaptureConfiguration.

Bug: 129948989
Test: atest AudioAttributesTest
Change-Id: Ie8cdf67aee9ff7cf9144a66d47c301712516cf87
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-04-15 08:35:29 -07:00
Kevin Rocard
654b3cb1c7 Add documentation for the APC feature
Test: m offline-sdk-docs
Bug: 111453086
Bug: 128454790
Change-Id: Ibeef672b1e3090bb83304cce4b58f0ffab7a9cdc
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-04-12 21:09:02 +00:00
Kevin Rocard
7919c2acc9 Add application wide capture policy
Apps were previously forced to set their allowed capture policy from
either their manifest which is not flexible or from each track which is
a very fine grain but difficult when using libraries like exoplayer.

Thus add an application level policy set with AudioManager.

Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 111453086
Change-Id: Id360f1c3f3157c60694c039e51ff16e71d8f93cd
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-03-22 15:28:51 -07:00
Kevin Rocard
a3a4bbba98 Introduce a system APC with its corresponding opt-out
For system application with the new permission CAPTURE_MEDIA_OUTPUT, or
CAPTURE_AUDIO_OUTPUT, allow to capture the audio of playing apps that
allow it.

Test: adb shell audiorecorder --target /data/file1.raw
Test: atest android.media.cts.AudioPlaybackCaptureTest
Bug: 111453086
Change-Id: I5bfca51e48992234508897c595a076d066db26b2
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-03-22 15:28:51 -07:00
Kevin Rocard
048c3888bc Add getter to AudioPlaybackCaptureConfiguration
As requested by the API concil.

Test: atest android.media.cts.AudioPlaybackCaptureTest
Bug: 128454287
Change-Id: I205fe03d1d23d67ecf3e4590b62bde24f56e4e83
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-03-21 05:50:48 +00:00
Kevin Rocard
613d6121a0 Improve Audio Playback Capture API
The API too closely resembled the underlying system API, in forcing the
client to construct a full AudioAttribute when only the usage was
useful.

Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 111453086
Change-Id: Ic3944120ab4d5dc7b85e5baf7718a39a171a4333
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-03-19 14:51:09 -07:00
Kevin Rocard
15ed4c360a Add @NonNull to Audio Playback Capture functions
That allows better integration with tools and Kotlin.

Test: atest android.media.cts.AudioPlaybackCaptureTest
Bug: 126700282
Change-Id: I921d0b5580ad861c732f7b076142968e4da9989c
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-03-04 23:07:38 +00: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
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
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