Loading services/core/java/com/android/server/hdmi/SendKeyAction.java +22 −2 Original line number Original line Diff line number Diff line Loading @@ -17,8 +17,10 @@ package com.android.server.hdmi; import static com.android.server.hdmi.HdmiConfig.IRT_MS; import static com.android.server.hdmi.HdmiConfig.IRT_MS; import android.hardware.tv.cec.V1_0.SendMessageResult; import android.util.Slog; import android.util.Slog; import android.view.KeyEvent; import android.view.KeyEvent; import com.android.server.hdmi.HdmiControlService.SendMessageCallback; /** /** * Feature action that transmits remote control key command (User Control Press/ * Feature action that transmits remote control key command (User Control Press/ Loading Loading @@ -146,9 +148,27 @@ final class SendKeyAction extends HdmiCecFeatureAction { if (cecKeycodeAndParams == null) { if (cecKeycodeAndParams == null) { return; return; } } // Devices that are not directly connected with audio system device can't detect if the // audio system device is still plugged in. Framework checks if the volume key forwarding is // successful or not every time to make sure the System Audio Mode status is still updated. if (mTargetAddress == Constants.ADDR_AUDIO_SYSTEM && localDevice().mAddress != Constants.ADDR_TV) { sendCommand(HdmiCecMessageBuilder.buildUserControlPressed(getSourceAddress(), mTargetAddress, cecKeycodeAndParams), new SendMessageCallback() { @Override public void onSendCompleted(int error) { if (error != SendMessageResult.SUCCESS) { HdmiLogger.debug( "AVR did not respond to <User Control Pressed>"); localDevice().mService.setSystemAudioActivated(false); } } }); } else { sendCommand(HdmiCecMessageBuilder.buildUserControlPressed(getSourceAddress(), sendCommand(HdmiCecMessageBuilder.buildUserControlPressed(getSourceAddress(), mTargetAddress, cecKeycodeAndParams)); mTargetAddress, cecKeycodeAndParams)); } } } private void sendKeyUp() { private void sendKeyUp() { sendCommand(HdmiCecMessageBuilder.buildUserControlReleased(getSourceAddress(), sendCommand(HdmiCecMessageBuilder.buildUserControlReleased(getSourceAddress(), Loading Loading
services/core/java/com/android/server/hdmi/SendKeyAction.java +22 −2 Original line number Original line Diff line number Diff line Loading @@ -17,8 +17,10 @@ package com.android.server.hdmi; import static com.android.server.hdmi.HdmiConfig.IRT_MS; import static com.android.server.hdmi.HdmiConfig.IRT_MS; import android.hardware.tv.cec.V1_0.SendMessageResult; import android.util.Slog; import android.util.Slog; import android.view.KeyEvent; import android.view.KeyEvent; import com.android.server.hdmi.HdmiControlService.SendMessageCallback; /** /** * Feature action that transmits remote control key command (User Control Press/ * Feature action that transmits remote control key command (User Control Press/ Loading Loading @@ -146,9 +148,27 @@ final class SendKeyAction extends HdmiCecFeatureAction { if (cecKeycodeAndParams == null) { if (cecKeycodeAndParams == null) { return; return; } } // Devices that are not directly connected with audio system device can't detect if the // audio system device is still plugged in. Framework checks if the volume key forwarding is // successful or not every time to make sure the System Audio Mode status is still updated. if (mTargetAddress == Constants.ADDR_AUDIO_SYSTEM && localDevice().mAddress != Constants.ADDR_TV) { sendCommand(HdmiCecMessageBuilder.buildUserControlPressed(getSourceAddress(), mTargetAddress, cecKeycodeAndParams), new SendMessageCallback() { @Override public void onSendCompleted(int error) { if (error != SendMessageResult.SUCCESS) { HdmiLogger.debug( "AVR did not respond to <User Control Pressed>"); localDevice().mService.setSystemAudioActivated(false); } } }); } else { sendCommand(HdmiCecMessageBuilder.buildUserControlPressed(getSourceAddress(), sendCommand(HdmiCecMessageBuilder.buildUserControlPressed(getSourceAddress(), mTargetAddress, cecKeycodeAndParams)); mTargetAddress, cecKeycodeAndParams)); } } } private void sendKeyUp() { private void sendKeyUp() { sendCommand(HdmiCecMessageBuilder.buildUserControlReleased(getSourceAddress(), sendCommand(HdmiCecMessageBuilder.buildUserControlReleased(getSourceAddress(), Loading