AudioPlaybackCaptureConfiguration.Builder
public
static
final
class
AudioPlaybackCaptureConfiguration.Builder
extends Object
Builder for creating AudioPlaybackCaptureConfiguration
instances.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
public Builder (MediaProjection projection)
Parameters |
projection |
MediaProjection : A MediaProjection that supports audio projection.
This value cannot be null . |
Public methods
addMatchingUid
public AudioPlaybackCaptureConfiguration.Builder addMatchingUid (int uid)
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.
addMatchingUsage
public AudioPlaybackCaptureConfiguration.Builder addMatchingUsage (int usage)
Only capture audio output with the given AudioAttributes
.
If called multiple times, will capture audio output that matches any of the given
attributes.
Parameters |
usage |
int : Value is AudioAttributes.USAGE_UNKNOWN , AudioAttributes.USAGE_MEDIA , AudioAttributes.USAGE_VOICE_COMMUNICATION , AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING , AudioAttributes.USAGE_ALARM , AudioAttributes.USAGE_NOTIFICATION , AudioAttributes.USAGE_NOTIFICATION_RINGTONE , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_REQUEST , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_DELAYED , AudioAttributes.USAGE_NOTIFICATION_EVENT , AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY , AudioAttributes.USAGE_ASSISTANCE_NAVIGATION_GUIDANCE , AudioAttributes.USAGE_ASSISTANCE_SONIFICATION , AudioAttributes.USAGE_GAME , AudioAttributes.USAGE_ASSISTANT , android.media.AudioAttributes.USAGE_CALL_ASSISTANT, android.media.AudioAttributes.USAGE_EMERGENCY, android.media.AudioAttributes.USAGE_SAFETY, android.media.AudioAttributes.USAGE_VEHICLE_STATUS, android.media.AudioAttributes.USAGE_ANNOUNCEMENT, or android.media.AudioAttributes.USAGE_SPEAKER_CLEANUP |
excludeUid
public AudioPlaybackCaptureConfiguration.Builder excludeUid (int uid)
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.
excludeUsage
public AudioPlaybackCaptureConfiguration.Builder excludeUsage (int usage)
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.
Parameters |
usage |
int : Value is AudioAttributes.USAGE_UNKNOWN , AudioAttributes.USAGE_MEDIA , AudioAttributes.USAGE_VOICE_COMMUNICATION , AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING , AudioAttributes.USAGE_ALARM , AudioAttributes.USAGE_NOTIFICATION , AudioAttributes.USAGE_NOTIFICATION_RINGTONE , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_REQUEST , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_DELAYED , AudioAttributes.USAGE_NOTIFICATION_EVENT , AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY , AudioAttributes.USAGE_ASSISTANCE_NAVIGATION_GUIDANCE , AudioAttributes.USAGE_ASSISTANCE_SONIFICATION , AudioAttributes.USAGE_GAME , AudioAttributes.USAGE_ASSISTANT , android.media.AudioAttributes.USAGE_CALL_ASSISTANT, android.media.AudioAttributes.USAGE_EMERGENCY, android.media.AudioAttributes.USAGE_SAFETY, android.media.AudioAttributes.USAGE_VEHICLE_STATUS, android.media.AudioAttributes.USAGE_ANNOUNCEMENT, or android.media.AudioAttributes.USAGE_SPEAKER_CLEANUP |