Loading media/java/android/media/AudioAttributes.java +9 −10 Original line number Diff line number Diff line Loading @@ -716,24 +716,23 @@ public final class AudioAttributes implements Parcelable { } /** * Specifies weather the audio may or may not be captured by other apps or the system. * Specifies whether the audio may or may not be captured by other apps or the system. * * The default is {@link AudioAttributes#ALLOW_CAPTURE_BY_ALL}. * * There are multiple ways to set this policy: * - for each tracks independently, with this method * - application wide at runtime, with {@link AudioManager#setAllowedCapturePolicy(int)} * - application wide at build time, see {@code allowAudioPlaybackCapture} in the * application manifest. * <ul> * <li> for each track independently, with this method </li> * <li> application-wide at runtime, with * {@link AudioManager#setAllowedCapturePolicy(int)} </li> * <li> application-wide at build time, see {@code allowAudioPlaybackCapture} in the * application manifest. </li> * </ul> * The most restrictive policy is always applied. * * See {@link AudioPlaybackCaptureConfiguration} for more details on the restrictions * See {@link AudioPlaybackCaptureConfiguration} for more details on * which audio signals can be captured. * * @param capturePolicy one of * {@link #ALLOW_CAPTURE_BY_ALL}, * {@link #ALLOW_CAPTURE_BY_SYSTEM}, * {@link #ALLOW_CAPTURE_BY_NONE}. * @return the same Builder instance * @throws IllegalArgumentException if the argument is not a valid value. */ Loading media/java/android/media/AudioManager.java +9 −7 Original line number Diff line number Diff line Loading @@ -1484,20 +1484,22 @@ public class AudioManager { } /** * Specifies wheather the audio played by this app may or may not be captured by other apps or * Specifies whether the audio played by this app may or may not be captured by other apps or * the system. * * The default is {@link AudioAttributes#ALLOW_CAPTURE_BY_ALL}. * * There are multiple ways to set this policy: * - for each tracks independently, see * {@link AudioAttributes.Builder#setAllowedCapturePolicy(int)} * - application wide at runtime, with this method * - application wide at build time, see {@code allowAudioPlaybackCapture} in the application * manifest. * <ul> * <li> for each track independently, see * {@link AudioAttributes.Builder#setAllowedCapturePolicy(int)} </li> * <li> application-wide at runtime, with this method </li> * <li> application-wide at build time, see {@code allowAudioPlaybackCapture} in the application * manifest. </li> * </ul> * The most restrictive policy is always applied. * * See {@link AudioPlaybackCaptureConfiguration} for more details on the restrictions * See {@link AudioPlaybackCaptureConfiguration} for more details on * which audio signals can be captured. * * @param capturePolicy one of Loading media/java/android/media/AudioPlaybackCaptureConfiguration.java +21 −18 Original line number Diff line number Diff line Loading @@ -34,21 +34,23 @@ import java.util.function.ToIntFunction; * When capturing audio signals played by other apps (and yours), * you will only capture a mix of the audio signals played by players * (such as AudioTrack or MediaPlayer) which present the following characteristics: * - the usage value MUST be {@link AudioAttributes#USAGE_UNKNOWN} or * <ul> * <li> the usage value MUST be {@link AudioAttributes#USAGE_UNKNOWN} or * {@link AudioAttributes#USAGE_GAME} * or {@link AudioAttributes#USAGE_MEDIA}. All other usages CAN NOT be captured. * - AND the capture policy set by their app (with ${@link AudioManager#setAllowedCapturePolicy}) * or on each player (with ${@link AudioAttributes.Builder#setAllowedCapturePolicy}) is * {@link AudioAttributes#ALLOW_CAPTURE_BY_ALL}, whichever is the most strict. * - AND their app attribute allowAudioPlaybackCapture in their manifest * MUST either be: * * set to "true" * * not set, and their {@code targetSdkVersion} MUST be equal or higher to * or {@link AudioAttributes#USAGE_MEDIA}. All other usages CAN NOT be captured. </li> * <li> AND the capture policy set by their app (with {@link AudioManager#setAllowedCapturePolicy}) * or on each player (with {@link AudioAttributes.Builder#setAllowedCapturePolicy}) is * {@link AudioAttributes#ALLOW_CAPTURE_BY_ALL}, whichever is the most strict. </li> * <li> AND their app attribute allowAudioPlaybackCapture in their manifest * MUST either be: <ul> * <li> set to "true" </li> * <li> not set, and their {@code targetSdkVersion} MUST be equal to or greater than * {@link android.os.Build.VERSION_CODES#Q}. * Ie. Apps that do not target at least Android Q must explicitly opt-in to be captured by a * MediaProjection. * - AND their apps MUST be in the same user profile as your app * (eg work profile can not capture user profile apps and vice-versa). * Ie. Apps that do not target at least Android Q must explicitly opt-in to be captured * by a MediaProjection. </li></ul> * <li> AND their apps MUST be in the same user profile as your app * (eg work profile cannot capture user profile apps and vice-versa). </li> * </ul> * * <p>An example for creating a capture configuration for capturing all media playback: * Loading @@ -64,7 +66,8 @@ import java.util.function.ToIntFunction; * .build(); * </pre> * * @see MediaProjectionManager#getMediaProjection(int, Intent) * @see Builder * @see android.media.projection.MediaProjectionManager#getMediaProjection(int, Intent) * @see AudioRecord.Builder#setAudioPlaybackCaptureConfig(AudioPlaybackCaptureConfiguration) */ public final class AudioPlaybackCaptureConfiguration { Loading @@ -80,7 +83,7 @@ public final class AudioPlaybackCaptureConfiguration { /** * @return the {@code MediaProjection} used to build this object. * @see {@code Builder.Builder} * @see Builder#Builder(MediaProjection) */ public @NonNull MediaProjection getMediaProjection() { return mProjection; Loading Loading
media/java/android/media/AudioAttributes.java +9 −10 Original line number Diff line number Diff line Loading @@ -716,24 +716,23 @@ public final class AudioAttributes implements Parcelable { } /** * Specifies weather the audio may or may not be captured by other apps or the system. * Specifies whether the audio may or may not be captured by other apps or the system. * * The default is {@link AudioAttributes#ALLOW_CAPTURE_BY_ALL}. * * There are multiple ways to set this policy: * - for each tracks independently, with this method * - application wide at runtime, with {@link AudioManager#setAllowedCapturePolicy(int)} * - application wide at build time, see {@code allowAudioPlaybackCapture} in the * application manifest. * <ul> * <li> for each track independently, with this method </li> * <li> application-wide at runtime, with * {@link AudioManager#setAllowedCapturePolicy(int)} </li> * <li> application-wide at build time, see {@code allowAudioPlaybackCapture} in the * application manifest. </li> * </ul> * The most restrictive policy is always applied. * * See {@link AudioPlaybackCaptureConfiguration} for more details on the restrictions * See {@link AudioPlaybackCaptureConfiguration} for more details on * which audio signals can be captured. * * @param capturePolicy one of * {@link #ALLOW_CAPTURE_BY_ALL}, * {@link #ALLOW_CAPTURE_BY_SYSTEM}, * {@link #ALLOW_CAPTURE_BY_NONE}. * @return the same Builder instance * @throws IllegalArgumentException if the argument is not a valid value. */ Loading
media/java/android/media/AudioManager.java +9 −7 Original line number Diff line number Diff line Loading @@ -1484,20 +1484,22 @@ public class AudioManager { } /** * Specifies wheather the audio played by this app may or may not be captured by other apps or * Specifies whether the audio played by this app may or may not be captured by other apps or * the system. * * The default is {@link AudioAttributes#ALLOW_CAPTURE_BY_ALL}. * * There are multiple ways to set this policy: * - for each tracks independently, see * {@link AudioAttributes.Builder#setAllowedCapturePolicy(int)} * - application wide at runtime, with this method * - application wide at build time, see {@code allowAudioPlaybackCapture} in the application * manifest. * <ul> * <li> for each track independently, see * {@link AudioAttributes.Builder#setAllowedCapturePolicy(int)} </li> * <li> application-wide at runtime, with this method </li> * <li> application-wide at build time, see {@code allowAudioPlaybackCapture} in the application * manifest. </li> * </ul> * The most restrictive policy is always applied. * * See {@link AudioPlaybackCaptureConfiguration} for more details on the restrictions * See {@link AudioPlaybackCaptureConfiguration} for more details on * which audio signals can be captured. * * @param capturePolicy one of Loading
media/java/android/media/AudioPlaybackCaptureConfiguration.java +21 −18 Original line number Diff line number Diff line Loading @@ -34,21 +34,23 @@ import java.util.function.ToIntFunction; * When capturing audio signals played by other apps (and yours), * you will only capture a mix of the audio signals played by players * (such as AudioTrack or MediaPlayer) which present the following characteristics: * - the usage value MUST be {@link AudioAttributes#USAGE_UNKNOWN} or * <ul> * <li> the usage value MUST be {@link AudioAttributes#USAGE_UNKNOWN} or * {@link AudioAttributes#USAGE_GAME} * or {@link AudioAttributes#USAGE_MEDIA}. All other usages CAN NOT be captured. * - AND the capture policy set by their app (with ${@link AudioManager#setAllowedCapturePolicy}) * or on each player (with ${@link AudioAttributes.Builder#setAllowedCapturePolicy}) is * {@link AudioAttributes#ALLOW_CAPTURE_BY_ALL}, whichever is the most strict. * - AND their app attribute allowAudioPlaybackCapture in their manifest * MUST either be: * * set to "true" * * not set, and their {@code targetSdkVersion} MUST be equal or higher to * or {@link AudioAttributes#USAGE_MEDIA}. All other usages CAN NOT be captured. </li> * <li> AND the capture policy set by their app (with {@link AudioManager#setAllowedCapturePolicy}) * or on each player (with {@link AudioAttributes.Builder#setAllowedCapturePolicy}) is * {@link AudioAttributes#ALLOW_CAPTURE_BY_ALL}, whichever is the most strict. </li> * <li> AND their app attribute allowAudioPlaybackCapture in their manifest * MUST either be: <ul> * <li> set to "true" </li> * <li> not set, and their {@code targetSdkVersion} MUST be equal to or greater than * {@link android.os.Build.VERSION_CODES#Q}. * Ie. Apps that do not target at least Android Q must explicitly opt-in to be captured by a * MediaProjection. * - AND their apps MUST be in the same user profile as your app * (eg work profile can not capture user profile apps and vice-versa). * Ie. Apps that do not target at least Android Q must explicitly opt-in to be captured * by a MediaProjection. </li></ul> * <li> AND their apps MUST be in the same user profile as your app * (eg work profile cannot capture user profile apps and vice-versa). </li> * </ul> * * <p>An example for creating a capture configuration for capturing all media playback: * Loading @@ -64,7 +66,8 @@ import java.util.function.ToIntFunction; * .build(); * </pre> * * @see MediaProjectionManager#getMediaProjection(int, Intent) * @see Builder * @see android.media.projection.MediaProjectionManager#getMediaProjection(int, Intent) * @see AudioRecord.Builder#setAudioPlaybackCaptureConfig(AudioPlaybackCaptureConfiguration) */ public final class AudioPlaybackCaptureConfiguration { Loading @@ -80,7 +83,7 @@ public final class AudioPlaybackCaptureConfiguration { /** * @return the {@code MediaProjection} used to build this object. * @see {@code Builder.Builder} * @see Builder#Builder(MediaProjection) */ public @NonNull MediaProjection getMediaProjection() { return mProjection; Loading