OSDN Git Service

Do no send <Feature Abort> as response of <Feature Abort>
authorJungshik Jang <jayjang@google.com>
Thu, 17 Jul 2014 04:58:14 +0000 (13:58 +0900)
committerJungshik Jang <jayjang@google.com>
Thu, 17 Jul 2014 04:58:14 +0000 (13:58 +0900)
Cec service replies <Feature Abort> back to original device
if incoming message is not handled by any of feature action or device.
It's applied to <Feature Abort> message itself, but it can cause
weird sideeffect of it.
This change just ignore <Feature Abort> even though it's not handled
by any of local device or feature actions.

Bug: 16359564
Change-Id: I925e89ca4db49a637dd296447c04eee1ba679c6b

services/core/java/com/android/server/hdmi/HdmiCecController.java

index 72519f2..cbccc1d 100644 (file)
@@ -506,15 +506,20 @@ final class HdmiCecController {
                 && mService.handleCecCommand(message)) {
             return;
         }
-
-        if (message.getDestination() != Constants.ADDR_BROADCAST) {
-            int sourceAddress = message.getDestination();
-            // Reply <Feature Abort> to initiator (source) for all requests.
-            HdmiCecMessage cecMessage = HdmiCecMessageBuilder.buildFeatureAbortCommand(
-                    sourceAddress, message.getSource(), message.getOpcode(),
-                    Constants.ABORT_REFUSED);
-            sendCommand(cecMessage);
+        if (message.getDestination() == Constants.ADDR_BROADCAST) {
+            return;
         }
+        if (message.getOpcode() == Constants.MESSAGE_FEATURE_ABORT) {
+            Slog.v(TAG, "Unhandled <Feature Abort> message:" + message);
+            return;
+        }
+
+        int sourceAddress = message.getDestination();
+        // Reply <Feature Abort> to initiator (source) for all requests.
+        HdmiCecMessage cecMessage = HdmiCecMessageBuilder.buildFeatureAbortCommand(
+                sourceAddress, message.getSource(), message.getOpcode(),
+                Constants.ABORT_REFUSED);
+        sendCommand(cecMessage);
     }
 
     @ServiceThreadOnly