SuggestedDeviceInfo.Builder


public static final class SuggestedDeviceInfo.Builder
extends Object

java.lang.Object
   ↳ android.media.SuggestedDeviceInfo.Builder


Builder for SuggestedDeviceInfo.

Summary

Public constructors

Builder(String deviceDisplayName, String routeId, int type)

Constructor.

Public methods

SuggestedDeviceInfo build()

Creates a new SuggestedDeviceInfo.

SuggestedDeviceInfo.Builder setExtras(Bundle extras)

Sets the extras.

Inherited methods

Public constructors

Builder

public Builder (String deviceDisplayName, 
                String routeId, 
                int type)

Constructor.

Parameters
deviceDisplayName String: The display name. This value cannot be null.

routeId String: The route ID. This value cannot be null.

type int: The route type. Value is MediaRoute2Info.TYPE_UNKNOWN, MediaRoute2Info.TYPE_BUILTIN_SPEAKER, MediaRoute2Info.TYPE_WIRED_HEADSET, MediaRoute2Info.TYPE_WIRED_HEADPHONES, MediaRoute2Info.TYPE_BLUETOOTH_A2DP, MediaRoute2Info.TYPE_HDMI, MediaRoute2Info.TYPE_HDMI_ARC, MediaRoute2Info.TYPE_HDMI_EARC, MediaRoute2Info.TYPE_LINE_DIGITAL, MediaRoute2Info.TYPE_LINE_ANALOG, MediaRoute2Info.TYPE_AUX_LINE, MediaRoute2Info.TYPE_USB_DEVICE, MediaRoute2Info.TYPE_USB_ACCESSORY, MediaRoute2Info.TYPE_DOCK, MediaRoute2Info.TYPE_USB_HEADSET, MediaRoute2Info.TYPE_HEARING_AID, MediaRoute2Info.TYPE_BLE_HEADSET, MediaRoute2Info.TYPE_REMOTE_TV, MediaRoute2Info.TYPE_REMOTE_SPEAKER, MediaRoute2Info.TYPE_REMOTE_AUDIO_VIDEO_RECEIVER, MediaRoute2Info.TYPE_REMOTE_TABLET, MediaRoute2Info.TYPE_REMOTE_TABLET_DOCKED, MediaRoute2Info.TYPE_REMOTE_COMPUTER, MediaRoute2Info.TYPE_REMOTE_GAME_CONSOLE, MediaRoute2Info.TYPE_REMOTE_CAR, MediaRoute2Info.TYPE_REMOTE_SMARTWATCH, MediaRoute2Info.TYPE_REMOTE_SMARTPHONE, or MediaRoute2Info.TYPE_GROUP

Public methods

build

public SuggestedDeviceInfo build ()

Creates a new SuggestedDeviceInfo. The device display name, route ID, and type must be set. The extras cannot be null, but default to an empty Bundle.

Returns
SuggestedDeviceInfo

setExtras

public SuggestedDeviceInfo.Builder setExtras (Bundle extras)

Sets the extras.

The default value is an empty Bundle.

Do not mutate the given Bundle after passing it to this method. You can use Bundle.deepCopy() to keep a mutable copy.

Parameters
extras Bundle: This value cannot be null.

Returns
SuggestedDeviceInfo.Builder This value cannot be null.

Throws
NullPointerException if the extras are null.