Add the constants for the callback result of SendCecCommand().
- Move the send failure warning messages into HdmiCecController.sendCommand()
from each Actions.
- Stringfy with more detail messages for some opcodes.
Change-Id: Ib7ce24dd2a1f290e6c3a0b26738772ef1d4a9630
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecController.java b/services/core/java/com/android/server/hdmi/HdmiCecController.java
index 662159d..4792c55 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecController.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecController.java
@@ -20,6 +20,7 @@
import android.hardware.hdmi.HdmiCecDeviceInfo;
import android.hardware.hdmi.HdmiCecMessage;
import android.os.Handler;
+import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseIntArray;
@@ -55,9 +56,6 @@
private static final int NUM_LOGICAL_ADDRESS = 16;
- // TODO: define other constants for errors.
- private static final int ERROR_SUCCESS = 0;
-
// Handler instance to process synchronous I/O (mainly send) message.
private Handler mIoHandler;
@@ -210,7 +208,7 @@
// it as logical address of the device.
int error = nativeSendCecCommand(mNativePtr, curAddress, curAddress,
EMPTY_BODY);
- if (error != ERROR_SUCCESS) {
+ if (error != HdmiControlService.SEND_RESULT_SUCCESS) {
logicalAddress = curAddress;
break;
}
@@ -405,6 +403,9 @@
byte[] body = buildBody(cecMessage.getOpcode(), cecMessage.getParams());
final int error = nativeSendCecCommand(mNativePtr, cecMessage.getSource(),
cecMessage.getDestination(), body);
+ if (error != HdmiControlService.SEND_RESULT_SUCCESS) {
+ Slog.w(TAG, "Failed to send " + cecMessage);
+ }
if (callback != null) {
runOnServiceThread(new Runnable() {
@Override