Merge "CEC: Filter certain message arguments from logging" into rvc-dev am: 3002b11fb6 am: c792f63443 am: 8460816431
Change-Id: I0de5cf9dcc9e5c6dd6bfcd5c72e3141088ffebc0
This commit is contained in:
@@ -115,8 +115,12 @@ public final class HdmiCecMessage {
|
|||||||
s.append(String.format("<%s> %X%X:%02X",
|
s.append(String.format("<%s> %X%X:%02X",
|
||||||
opcodeToString(mOpcode), mSource, mDestination, mOpcode));
|
opcodeToString(mOpcode), mSource, mDestination, mOpcode));
|
||||||
if (mParams.length > 0) {
|
if (mParams.length > 0) {
|
||||||
for (byte data : mParams) {
|
if (filterMessageParameters(mOpcode)) {
|
||||||
s.append(String.format(":%02X", data));
|
s.append(String.format(" <Redacted len=%d>", mParams.length));
|
||||||
|
} else {
|
||||||
|
for (byte data : mParams) {
|
||||||
|
s.append(String.format(":%02X", data));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return s.toString();
|
return s.toString();
|
||||||
@@ -270,5 +274,21 @@ public final class HdmiCecMessage {
|
|||||||
return String.format("Opcode: %02X", opcode);
|
return String.format("Opcode: %02X", opcode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean filterMessageParameters(int opcode) {
|
||||||
|
switch (opcode) {
|
||||||
|
case Constants.MESSAGE_USER_CONTROL_PRESSED:
|
||||||
|
case Constants.MESSAGE_USER_CONTROL_RELEASED:
|
||||||
|
case Constants.MESSAGE_SET_OSD_NAME:
|
||||||
|
case Constants.MESSAGE_SET_OSD_STRING:
|
||||||
|
case Constants.MESSAGE_VENDOR_COMMAND:
|
||||||
|
case Constants.MESSAGE_VENDOR_REMOTE_BUTTON_DOWN:
|
||||||
|
case Constants.MESSAGE_VENDOR_REMOTE_BUTTON_UP:
|
||||||
|
case Constants.MESSAGE_VENDOR_COMMAND_WITH_ID:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user