summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Amy Zhang <amyjojo@google.com> 2019-07-02 00:14:24 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-07-02 00:14:24 +0000
commit9dd7fe76e7e10f7dc47ca441018fe3d09cc18894 (patch)
treec4d968935bf8712f5c2b0f8c26a71b221e5f9035
parent89d9b2f5e247540eebad0c6e84013c49db079441 (diff)
parente55d3d47276e867c11289c2017567df7b4cb43fa (diff)
Merge "cec: message buffered before logical addr allocated [1/1]"
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiCecController.java4
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiControlService.java9
2 files changed, 12 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecController.java b/services/core/java/com/android/server/hdmi/HdmiCecController.java
index 86be585e5d23..6174e5418caf 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecController.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecController.java
@@ -580,7 +580,9 @@ final class HdmiCecController {
@ServiceThreadOnly
private void onReceiveCommand(HdmiCecMessage message) {
assertRunOnServiceThread();
- if (isAcceptableAddress(message.getDestination()) && mService.handleCecCommand(message)) {
+ if ((isAcceptableAddress(message.getDestination())
+ || !mService.isAddressAllocated())
+ && mService.handleCecCommand(message)) {
return;
}
// Not handled message, so we will reply it with <Feature Abort>.
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index df4674c958b0..9aaf33c90df2 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -380,6 +380,9 @@ public class HdmiControlService extends SystemService {
case Constants.MESSAGE_TEXT_VIEW_ON:
bufferImageOrTextViewOn(message);
return true;
+ case Constants.MESSAGE_SYSTEM_AUDIO_MODE_REQUEST:
+ bufferSystemAudioModeRequest(message);
+ return true;
// Add here if new message that needs to buffer
default:
// Do not need to buffer messages other than above
@@ -412,6 +415,12 @@ public class HdmiControlService extends SystemService {
}
}
+ private void bufferSystemAudioModeRequest(HdmiCecMessage message) {
+ if (!replaceMessageIfBuffered(message, Constants.MESSAGE_SYSTEM_AUDIO_MODE_REQUEST)) {
+ mBuffer.add(message);
+ }
+ }
+
// Returns true if the message is replaced
private boolean replaceMessageIfBuffered(HdmiCecMessage message, int opcode) {
for (int i = 0; i < mBuffer.size(); i++) {