Questions about CEC

Hi,
I have some questions about CEC. I am on android.

How to map remote control ?

When i switch off tv, vim go in suspend mod but when I restart tv, vim don’t weakup.
How to weakup vim when tv start or how to disable suspend mod on vim ?

Thanks

I have resolve the second question.
I have edited HdmiControlService.java in framworks/base/services/core/java/com/android/server/hdmi
to disable standby.

Now i whant to map the tv remote command but i don’t know how to do this.
I see remote command on log but how to handle this command ?