ConsumerIrManager
public
final
class
ConsumerIrManager
extends Object
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 | |
|---|---|
class |
ConsumerIrManager.CarrierFrequencyRange
Represents a range of carrier frequencies (inclusive) on which the infrared transmitter can transmit |
Public methods | |
|---|---|
CarrierFrequencyRange[]
|
getCarrierFrequencies()
Query the infrared transmitter's supported carrier frequencies |
boolean
|
hasIrEmitter()
Check whether the device has an infrared emitter. |
void
|
transmit(int carrierFrequency, int[] pattern)
Transmit an infrared pattern This method is synchronous; when it returns the pattern has been transmitted. |
Inherited methods | |
|---|---|
Public methods
getCarrierFrequencies
public CarrierFrequencyRange[] getCarrierFrequencies ()
Query the infrared transmitter's supported carrier frequencies
| Returns | |
|---|---|
CarrierFrequencyRange[] |
an array of
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
public boolean hasIrEmitter ()
Check whether the device has an infrared emitter.
| Returns | |
|---|---|
boolean |
true if the device has an infrared emitter, else false. |
transmit
public void transmit (int carrierFrequency,
int[] pattern)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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-08-03 UTC.
