Fix eARC log description

Logs for eARC status always shows true. eg. eARC state change [old:true new true]
The reason why is because the original design is integer but it use %b (boolean) for it.

Bug: 280546652
Test: atest
Change-Id: I81cee5b42ae9ff240fcb2647f3545aa692ee8656
This commit is contained in:
Winni Chang
2023-05-18 16:07:50 +08:00
parent b0646803a7
commit fc8090e7f8

View File

@@ -44,6 +44,12 @@ public class HdmiEarcLocalDeviceTx extends HdmiEarcLocalDevice {
// How long to wait for the audio system to report its capabilities after eARC was connected
static final long REPORT_CAPS_MAX_DELAY_MS = 2_000;
// Array containing the names of the eARC states. The integer value of the eARC state
// corresponds to the index in the array.
private static final String earcStatusNames[] = {"HDMI_EARC_STATUS_IDLE",
"HDMI_EARC_STATUS_EARC_PENDING", "HDMI_EARC_STATUS_ARC_PENDING",
"HDMI_EARC_STATUS_EARC_CONNECTED"};
// eARC Capability Data Structure parameters
private static final int EARC_CAPS_PAYLOAD_LENGTH = 0x02;
private static final int EARC_CAPS_DATA_START = 0x03;
@@ -77,11 +83,17 @@ public class HdmiEarcLocalDeviceTx extends HdmiEarcLocalDevice {
mReportCapsRunnable = new ReportCapsRunnable();
}
private String earcStatusToString(int status) {
return earcStatusNames[status];
}
protected void handleEarcStateChange(@Constants.EarcStatus int status) {
int oldEarcStatus;
synchronized (mLock) {
HdmiLogger.debug("eARC state change [old:%b new %b]", mEarcStatus,
status);
HdmiLogger.debug("eARC state change [old: %s(%d) new: %s(%d)]",
earcStatusToString(mEarcStatus), mEarcStatus,
earcStatusToString(status), status);
oldEarcStatus = mEarcStatus;
mEarcStatus = status;
}