Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e55d3d47 authored by Jinping Wang's avatar Jinping Wang Committed by Amy Zhang
Browse files

cec: message buffered before logical addr allocated [1/1]



BUG=130199965

Problem:
when atom received <System Audio Mode Request> after hotplug
befor logical address have not allocated, if response
<Feature Abort>, it may trigger tv send <Request ARC Termination>,
it may lead arc connect fail

Solution:
buffer <System Audio Mode Request> when received at the time
between hotplug-in and  logical address allocated

Test: test ok using atom

Change-Id: I4de6b74ed2c1f115097f950332bbc3d7c7a1f417
Signed-off-by: default avatarJinping Wang <jinping.wang@amlogic.com>

Cherry-pick: https://partner-android-review.git.corp.google.com/c/platform/frameworks/base/+/1343982/
(cherry picked from commit 3b1e136817f96eea0d548cc4262065564e02e619)

Change-Id: I9cd7524a491d6c56832b14cc6e620429c82b738c
parent 78dc908e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -580,7 +580,9 @@ final class HdmiCecController {
    @ServiceThreadOnly
    private void onReceiveCommand(HdmiCecMessage message) {
        assertRunOnServiceThread();
        if (isAcceptableAddress(message.getDestination()) && mService.handleCecCommand(message)) {
        if ((isAcceptableAddress(message.getDestination())
            || !mService.isAddressAllocated())
            && mService.handleCecCommand(message)) {
            return;
        }
        // Not handled message, so we will reply it with <Feature Abort>.
+9 −0
Original line number Diff line number Diff line
@@ -380,6 +380,9 @@ public class HdmiControlService extends SystemService {
                case Constants.MESSAGE_TEXT_VIEW_ON:
                    bufferImageOrTextViewOn(message);
                    return true;
                case Constants.MESSAGE_SYSTEM_AUDIO_MODE_REQUEST:
                    bufferSystemAudioModeRequest(message);
                    return true;
                    // Add here if new message that needs to buffer
                default:
                    // Do not need to buffer messages other than above
@@ -412,6 +415,12 @@ public class HdmiControlService extends SystemService {
            }
        }

        private void bufferSystemAudioModeRequest(HdmiCecMessage message) {
            if (!replaceMessageIfBuffered(message, Constants.MESSAGE_SYSTEM_AUDIO_MODE_REQUEST)) {
                mBuffer.add(message);
            }
        }

        // Returns true if the message is replaced
        private boolean replaceMessageIfBuffered(HdmiCecMessage message, int opcode) {
            for (int i = 0; i < mBuffer.size(); i++) {