public static final class TvInputInfo.Builder extends Object
TvInputInfo
objects.Constructor and Description |
---|
Builder(Context context,
ComponentName component)
Constructs a new builder for
TvInputInfo . |
Builder(Context context,
ResolveInfo resolveInfo)
Constructs a new builder for
TvInputInfo . |
Modifier and Type | Method and Description |
---|---|
TvInputInfo |
build()
Creates a
TvInputInfo instance with the specified fields. |
TvInputInfo.Builder |
setCanRecord(boolean canRecord)
Sets whether this TV input can record TV programs or not.
|
TvInputInfo.Builder |
setExtras(Bundle extras)
Sets domain-specific extras associated with this TV input.
|
TvInputInfo.Builder |
setHdmiDeviceInfo(HdmiDeviceInfo hdmiDeviceInfo)
Sets the HdmiDeviceInfo.
|
TvInputInfo.Builder |
setIcon(Icon icon)
Sets the icon.
|
TvInputInfo.Builder |
setIcon(Icon icon,
int state)
Sets the icon for a given input state.
|
TvInputInfo.Builder |
setLabel(CharSequence label)
Sets the label.
|
TvInputInfo.Builder |
setLabel(int resId)
Sets the label.
|
TvInputInfo.Builder |
setParentId(String parentId)
Sets the parent ID.
|
TvInputInfo.Builder |
setTunerCount(int tunerCount)
Sets the tuner count.
|
TvInputInfo.Builder |
setTvInputHardwareInfo(TvInputHardwareInfo tvInputHardwareInfo)
Sets the TvInputHardwareInfo.
|
public Builder(Context context, ComponentName component)
TvInputInfo
.context
- A Context of the application package implementing this class.component
- The name of the application component to be used for the
TvInputService
.public Builder(Context context, ResolveInfo resolveInfo)
TvInputInfo
.resolveInfo
- The ResolveInfo returned from the package manager about this TV input
service.public TvInputInfo.Builder setIcon(Icon icon)
icon
- The icon that represents this TV input.public TvInputInfo.Builder setIcon(Icon icon, int state)
icon
- The icon that represents this TV input for the given state.state
- The input state. Should be one of the followings.
TvInputManager.INPUT_STATE_CONNECTED
,
TvInputManager.INPUT_STATE_CONNECTED_STANDBY
and
TvInputManager.INPUT_STATE_DISCONNECTED
.public TvInputInfo.Builder setLabel(CharSequence label)
label
- The text to be used as label.public TvInputInfo.Builder setLabel(@StringRes int resId)
resId
- The resource ID of the text to use.public TvInputInfo.Builder setHdmiDeviceInfo(HdmiDeviceInfo hdmiDeviceInfo)
hdmiDeviceInfo
- The HdmiDeviceInfo for a HDMI CEC logical device.public TvInputInfo.Builder setParentId(String parentId)
parentId
- The parent ID.public TvInputInfo.Builder setTvInputHardwareInfo(TvInputHardwareInfo tvInputHardwareInfo)
tvInputHardwareInfo
- public TvInputInfo.Builder setTunerCount(int tunerCount)
TvInputInfo.TYPE_TUNER
.tunerCount
- The number of tuners this TV input has.public TvInputInfo.Builder setCanRecord(boolean canRecord)
canRecord
- Whether this TV input can record TV programs.public TvInputInfo.Builder setExtras(Bundle extras)
extras
- Domain-specific extras associated with this TV input. Keys must be
a scoped name, i.e. prefixed with a package name you own, so that different
developers will not create conflicting keys.public TvInputInfo build()
TvInputInfo
instance with the specified fields. Most of the information
is obtained by parsing the AndroidManifest and TvInputService.SERVICE_META_DATA
for the TvInputService
this TV input implements.