am fb020862: Merge "CEC: Set the parameter of <System Audio Mode Request> right" into lmp-mr1-dev
* commit 'fb020862e0d8740d31ead217fd4d308450b4170d': CEC: Set the parameter of <System Audio Mode Request> right
This commit is contained in:
@@ -186,6 +186,7 @@ final class Constants {
|
|||||||
|
|
||||||
static final int INVALID_PORT_ID = HdmiDeviceInfo.PORT_INVALID;
|
static final int INVALID_PORT_ID = HdmiDeviceInfo.PORT_INVALID;
|
||||||
static final int INVALID_PHYSICAL_ADDRESS = HdmiDeviceInfo.PATH_INVALID;
|
static final int INVALID_PHYSICAL_ADDRESS = HdmiDeviceInfo.PATH_INVALID;
|
||||||
|
static final int PATH_INTERNAL = HdmiDeviceInfo.PATH_INTERNAL;
|
||||||
|
|
||||||
// Send result codes. It should be consistent with hdmi_cec.h's send_message error code.
|
// Send result codes. It should be consistent with hdmi_cec.h's send_message error code.
|
||||||
static final int SEND_RESULT_SUCCESS = 0;
|
static final int SEND_RESULT_SUCCESS = 0;
|
||||||
|
|||||||
@@ -90,10 +90,9 @@ abstract class SystemAudioAction extends HdmiCecFeatureAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendSystemAudioModeRequestInternal() {
|
private void sendSystemAudioModeRequestInternal() {
|
||||||
int avrPhysicalAddress = tv().getAvrDeviceInfo().getPhysicalAddress();
|
|
||||||
HdmiCecMessage command = HdmiCecMessageBuilder.buildSystemAudioModeRequest(
|
HdmiCecMessage command = HdmiCecMessageBuilder.buildSystemAudioModeRequest(
|
||||||
getSourceAddress(),
|
getSourceAddress(),
|
||||||
mAvrLogicalAddress, avrPhysicalAddress, mTargetAudioStatus);
|
mAvrLogicalAddress, getSystemAudioModeRequestParam(), mTargetAudioStatus);
|
||||||
sendCommand(command, new HdmiControlService.SendMessageCallback() {
|
sendCommand(command, new HdmiControlService.SendMessageCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSendCompleted(int error) {
|
public void onSendCompleted(int error) {
|
||||||
@@ -108,6 +107,20 @@ abstract class SystemAudioAction extends HdmiCecFeatureAction {
|
|||||||
addTimer(mState, mTargetAudioStatus ? ON_TIMEOUT_MS : OFF_TIMEOUT_MS);
|
addTimer(mState, mTargetAudioStatus ? ON_TIMEOUT_MS : OFF_TIMEOUT_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getSystemAudioModeRequestParam() {
|
||||||
|
// <System Audio Mode Request> takes the physical address of the source device
|
||||||
|
// as a parameter. Get it from following candidates, in the order listed below:
|
||||||
|
// 1) physical address of the active source
|
||||||
|
// 2) active routing path
|
||||||
|
// 3) physical address of TV
|
||||||
|
if (tv().getActiveSource().isValid()) {
|
||||||
|
return tv().getActiveSource().physicalAddress;
|
||||||
|
}
|
||||||
|
int param = tv().getActivePath();
|
||||||
|
return param != Constants.INVALID_PHYSICAL_ADDRESS
|
||||||
|
? param : Constants.PATH_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
private void handleSendSystemAudioModeRequestTimeout() {
|
private void handleSendSystemAudioModeRequestTimeout() {
|
||||||
if (!mTargetAudioStatus // Don't retry for Off case.
|
if (!mTargetAudioStatus // Don't retry for Off case.
|
||||||
|| mSendRetryCount++ >= MAX_SEND_RETRY_COUNT) {
|
|| mSendRetryCount++ >= MAX_SEND_RETRY_COUNT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user