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

Commit abe773f7 authored by Amy Zhang's avatar Amy Zhang Committed by Android (Google) Code Review
Browse files

Merge "Set with local device info when TV sends out <System Audio Mode...

Merge "Set with local device info when TV sends out <System Audio Mode Request> with the current device's physical address"
parents 6d1661d6 0b6c0bae
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -846,12 +846,22 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
            if (sourcePhysicalAddress != getActiveSource().physicalAddress) {
                // If the Active Source recorded by the current device is not synced up with TV,
                // update the Active Source internally.
                if (sourcePhysicalAddress == mService.getPhysicalAddress()) {
                    // If the active path is the current device itself, update with local info
                    if (mService.playback() != null) {
                        setActiveSource(mService.playback().mAddress, sourcePhysicalAddress);
                    } else {
                        setActiveSource(mAddress, sourcePhysicalAddress);
                    }
                } else {
                    // If it's not the current device, look for the device info from the list
                    for (HdmiDeviceInfo info : HdmiUtils.sparseArrayToList(mDeviceInfos)) {
                        if (info.getPhysicalAddress() == sourcePhysicalAddress) {
                            setActiveSource(info.getLogicalAddress(), info.getPhysicalAddress());
                            break;
                        }
                    }
                }
                // If the Active path from TV's System Audio Mode request does not belong to any
                // device in the local device list, record the new Active physicalAddress with an
                // unregistered logical address first. Then query the Active Source again.