Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
548 views
in Technique[技术] by (71.8m points)

android - HTC ONE M8 IR Blaster after Lollipop Update not working

I need to use the infrared transmitter on an HTC One device. Before the lolipop update I could do this no problem, but now my code does not work.

    ConsumerIrManager mCIR = (ConsumerIrManager)getSystemService(Context.CONSUMER_IR_SERVICE);
    mCIR.transmit(freq, pat);

where freq and pattern are the required values to power on my TV (from the manufacturer)

I do not get any errors running this code, the only problem is that the infrared transmitter does not light up on HTC one devices. ( looking at ir blaster through camera ). I dont understand, the exact same code works on galaxy s5 devices. I would appreciate any help from someone who can get infrared to work on HTC one devices.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes, this issue seems to have been reported on the official bug tracker for Android.

I am developing an App which uses the official Consumer IR API introduced in Android 4.4 KitKat. Since the Lollipop rollouts for popular devices like the HTC One M8 or Samsung Galaxy S5 I am getting many reports from users of said devices that my App is not working on Lollipop. I do not own a Lollipop device myself, but I borrowed an M8 and did some tests.

It seems like the method ConsumerIrManager.transmit() is a no-op on Lollipop. No matter was pattern is given, it returns instantly.

Before discovering that Galaxy S5 users have the same problem, I contacted the HTC support on that matter and was told to contact the Google support.

It would seem S5 devices are getting the same issue as well, although it's hard to tell because developers are getting contradictory reports from S5 owners.

Here is an HTC-only fix that someone found for his M7 after it stopped working because of a Lollipop update. He basically reverted to an earlier version of the IR HTC API before they had switched to the official Google's api.

Otherwise, you should star the issue on the bug tracker, and perhaps point your own users to do the same. The more people star this issue, the higher priority it will be given.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...