ProjectedAudioManager


public final class ProjectedAudioManager


Class providing Projected device-specific functionality for clients using the android.media.AudioManager.

This class provides a way to connect to and communicate with the ProjectedAudioManager, which is expected to be running in the host process.

Use create to create an instance of this class. The connection is managed automatically with the provided LifecycleOwner.

Summary

Public methods

static final @NonNull ProjectedAudioManager
create(@NonNull Context context, @NonNull LifecycleOwner lifecycleOwner)

Connects to the service providing features for Projected devices and returns the ProjectedAudioManager when the connection is established.

final @NonNull List<@NonNull ProjectedAudioConfig>

Retrieves the supported audio capture configurations for the Projected device.

Public methods

create

public static final @NonNull ProjectedAudioManager create(@NonNull Context context, @NonNull LifecycleOwner lifecycleOwner)

Connects to the service providing features for Projected devices and returns the ProjectedAudioManager when the connection is established.

Parameters
@NonNull Context context

The context to use for binding to the service.

@NonNull LifecycleOwner lifecycleOwner

The lifecycle owner to scope the service connection to.

getSupportedAudioCaptureConfigs

Added in 1.0.0-alpha01
public final @NonNull List<@NonNull ProjectedAudioConfiggetSupportedAudioCaptureConfigs()

Retrieves the supported audio capture configurations for the Projected device.

Returns
@NonNull List<@NonNull ProjectedAudioConfig>

A list of ProjectedAudioConfig objects containing the supported audio capture configurations.

Throws
kotlin.IllegalStateException

if the supported audio configs could not be retrieved.