Builder
class Builder
kotlin.Any | |
↳ | android.media.AudioPlaybackCaptureConfiguration.Builder |
Builder for creating AudioPlaybackCaptureConfiguration
instances.
Summary
Public constructors | |
---|---|
Builder(projection: MediaProjection) |
Public methods | |
---|---|
AudioPlaybackCaptureConfiguration.Builder |
addMatchingUid(uid: Int) Only capture audio output by app with the matching |
AudioPlaybackCaptureConfiguration.Builder |
addMatchingUsage(usage: Int) Only capture audio output with the given |
AudioPlaybackCaptureConfiguration |
build() Builds the configuration instance. |
AudioPlaybackCaptureConfiguration.Builder |
excludeUid(uid: Int) Only capture audio output by apps that do not have the matching |
AudioPlaybackCaptureConfiguration.Builder |
excludeUsage(usage: Int) Only capture audio output that does not match the given |
Public constructors
Builder
Builder(projection: MediaProjection)
Parameters | |
---|---|
projection |
MediaProjection: A MediaProjection that supports audio projection. This value cannot be null . |
Public methods
addMatchingUid
fun addMatchingUid(uid: Int): AudioPlaybackCaptureConfiguration.Builder
Only capture audio output by app with the matching uid
.
If called multiple times, will capture audio output by apps whose uid is any of the given uids.
Return | |
---|---|
AudioPlaybackCaptureConfiguration.Builder |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if called in conjunction with excludeUid(int) . |
addMatchingUsage
fun addMatchingUsage(usage: Int): AudioPlaybackCaptureConfiguration.Builder
Only capture audio output with the given AudioAttributes
.
If called multiple times, will capture audio output that matches any of the given attributes.
Return | |
---|---|
AudioPlaybackCaptureConfiguration.Builder |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if called in conjunction with excludeUsage(int) . |
build
fun build(): AudioPlaybackCaptureConfiguration
Builds the configuration instance.
Return | |
---|---|
AudioPlaybackCaptureConfiguration |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
if the parameters set are incompatible. |
excludeUid
fun excludeUid(uid: Int): AudioPlaybackCaptureConfiguration.Builder
Only capture audio output by apps that do not have the matching uid
.
If called multiple times, will capture audio output by apps whose uid is not any of the given uids.
Return | |
---|---|
AudioPlaybackCaptureConfiguration.Builder |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if called in conjunction with addMatchingUid(int) . |
excludeUsage
fun excludeUsage(usage: Int): AudioPlaybackCaptureConfiguration.Builder
Only capture audio output that does not match the given AudioAttributes
.
If called multiple times, will capture audio output that does not match any of the given attributes.
Return | |
---|---|
AudioPlaybackCaptureConfiguration.Builder |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if called in conjunction with addMatchingUsage(int) . |