Hi,
does somebody have idea how to create string to revoke the same action as happens when you go to Action menu -≥ Home -≥ Home button with Sony remote and it sends CEC command ''Home button'' to in my case Nvidia Shield ? That way we can create shortcut on Sony and map button on remote to revoke that shortcut and send command to connected device without going trough Action menu.
Here are logs from both Sony and Shield when I press Home in Action menu:
SONY:
12-04 10:04:38.438 1648 2215 I HdmiCecController: [S]:<User Control Pressed> src: 0, dst: 11, params: 09
12-04 10:04:38.439 3175 3175 I com.sony.dtv.braviasyncservice.BraviaSyncService: MSG_SEND_REMOTE_CONTROL_KEY keyCode:3 isPress:0 remoteControlKeyInfoXml:null
12-04 10:04:38.557 1648 2215 I HdmiCecController: [S]:<User Control Release> src: 0, dst: 11
Shield:
12-04 09:40:52.136 3348 3460 V TegraHDMICEC: cec_worker: 0b:44:09
12-04 09:40:52.137 3733 3733 D WindowManager: handleComboKeys keyCode: 3, keyAction: 0
12-04 09:40:52.137 3733 3733 D WindowManager: isOnHomeScreen mLastTopComponent: null, componentName: ComponentInfo{com.android.tv.settings/com.android.tv.settings.MainSettings}
12-04 09:40:52.137 3733 3733 D WindowManager: handleComboKeys isOnHomeScreen: false
12-04 09:40:52.235 3348 3460 V TegraHDMICEC: cec_worker: 0b:45
12-04 09:40:52.236 3733 3733 D WindowManager: handleComboKeys keyCode: 3, keyAction: 1
12-04 09:40:52.236 3733 3733 D WindowManager: isOnHomeScreen mLastTopComponent: null, componentName: ComponentInfo{com.android.tv.settings/com.android.tv.settings.MainSettings}
12-04 09:40:52.237 3733 3733 D WindowManager: handleComboKeys isOnHomeScreen: false
Here is example but we need to know string for our action:
www.reddit.com/r/AndroidTV/comments/95r1q5/remap_android_tv_remote_button_possible_sony/
I also checked here but I cannot find something ...: pro-bravia.sony.net/develop/
Maybe here ? www.reddit.com/r/shortcuts/comments/9oh4zh/control_sony_tv_power_offon_and_other_tv_commands/
Are you saying that the Sony Action menu lets you send Home key to the Shield? What we would want to do is replicate that action.
KeyCode 3 is KEYCODE_HOME I don't think that matters.
I believe we would have to trigger an Android Intent action, specifically:
com.sony.dtv.braviasyncservice.BraviaSyncService: MSG_SEND_REMOTE_CONTROL_KEY keyCode:3 isPress:0 remoteControlKeyInfoXml:null.Sony's Pro mode lets you call an application, or URL. All that application would need to do is invoke the same Android Intent action and it should theoretically work.
Alternatively, we can try to interact with the
HdmiCecControllerservice directly, but I believe it may be restricted to system apps. If it's not restricted, then sample code like this would be useful.