Added in API level 19

ConsumerIrManager


class ConsumerIrManager
kotlin.Any
   ↳ android.hardware.ConsumerIrManager

Class that operates consumer infrared on the device.
Requires the PackageManager#FEATURE_CONSUMER_IR feature which can be detected using PackageManager.hasSystemFeature(String).

Summary

Nested classes

Represents a range of carrier frequencies (inclusive) on which the infrared transmitter can transmit

Public methods
Array<ConsumerIrManager.CarrierFrequencyRange!>!

Query the infrared transmitter's supported carrier frequencies

Boolean

Check whether the device has an infrared emitter.

Unit
transmit(carrierFrequency: Int, pattern: IntArray!)

Transmit an infrared pattern

Public methods

getCarrierFrequencies

Added in API level 19
fun getCarrierFrequencies(): Array<ConsumerIrManager.CarrierFrequencyRange!>!

Query the infrared transmitter's supported carrier frequencies

Return
Array<ConsumerIrManager.CarrierFrequencyRange!>! an array of android.hardware.ConsumerIrManager.CarrierFrequencyRange objects representing the ranges that the transmitter can support, or null if there was an error communicating with the Consumer IR Service.

hasIrEmitter

Added in API level 19
fun hasIrEmitter(): Boolean

Check whether the device has an infrared emitter.

Return
Boolean true if the device has an infrared emitter, else false.

transmit

Added in API level 19
fun transmit(
    carrierFrequency: Int,
    pattern: IntArray!
): Unit

Transmit an infrared pattern

This method is synchronous; when it returns the pattern has been transmitted. Only patterns shorter than 2 seconds will be transmitted.

Parameters
carrierFrequency Int: The IR carrier frequency in Hertz.
pattern IntArray!: The alternating on/off pattern in microseconds to transmit.