When running on a device that includes an infrared (IR) transmitter, you can now transmit IR signals using theConsumerIrManager APIs. To get an instance of ConsumerIrManager, call getSystemService() withCONSUMER_IR_SERVICE as the argument. You can then query the device's supported IR frequencies withgetCarrierFrequencies() and transmit signals by passing your desired frequency and signal pattern withtransmit().
You should always first check whether a device includes an IR transmitter by calling hasIrEmitter(), but if your app is compatible only with devices that do have one, you should include a <uses-feature> element in your manifest for"android.hardware.consumerir" (FEATURE_CONSUMER_IR).