Language

AudioAttributes.Builder.SetAllowedCapturePolicy(CapturePolicies) Method

Definition

Specifies whether the audio may or may not be captured by other apps or the system.

[Android.Runtime.Register("setAllowedCapturePolicy", "(I)Landroid/media/AudioAttributes$Builder;", "GetSetAllowedCapturePolicy_IHandler", ApiSince=29)]
public virtual Android.Media.AudioAttributes.Builder SetAllowedCapturePolicy(Android.Media.CapturePolicies capturePolicy);
[<Android.Runtime.Register("setAllowedCapturePolicy", "(I)Landroid/media/AudioAttributes$Builder;", "GetSetAllowedCapturePolicy_IHandler", ApiSince=29)>]
abstract member SetAllowedCapturePolicy : Android.Media.CapturePolicies -> Android.Media.AudioAttributes.Builder
override this.SetAllowedCapturePolicy : Android.Media.CapturePolicies -> Android.Media.AudioAttributes.Builder

Parameters

capturePolicy
CapturePolicies

Value is one of the following: AudioAttributes.ALLOW_CAPTURE_BY_ALL AudioAttributes.ALLOW_CAPTURE_BY_SYSTEM AudioAttributes.ALLOW_CAPTURE_BY_NONE

Returns

the same Builder instance. This value cannot be null.

Attributes

Remarks

Specifies whether the audio may or may not be captured by other apps or the system. The default is AudioAttributes.ALLOW_CAPTURE_BY_ALL. There are multiple ways to set this policy: for each track independently, with this method application-wide at runtime, with AudioManager.setAllowedCapturePolicy(int) application-wide at build time, see allowAudioPlaybackCapture in the application manifest. The most restrictive policy is always applied. See AudioPlaybackCaptureConfiguration for more details on which audio signals can be captured.

Android reference for android.media.AudioAttributes.Builder.setAllowedCapturePolicy.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to