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

Commit 291a2a3c authored by Amy's avatar Amy Committed by shubang
Browse files

Keep the device info when power status/OSD is unknown.

ag/5454246

This is useful when some device does not support set OSD name.
Or when it's not ready to report power status.

Test: manual
Bug: 113071437
Change-Id: I9e87273cfe887b3cca0b6d4ac7b26508356e649a
parent 47fe0b16
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -333,6 +333,7 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction {
        current.mPhysicalAddress = HdmiUtils.twoBytesToInt(params);
        current.mPhysicalAddress = HdmiUtils.twoBytesToInt(params);
        current.mPortId = getPortId(current.mPhysicalAddress);
        current.mPortId = getPortId(current.mPhysicalAddress);
        current.mDeviceType = params[2] & 0xFF;
        current.mDeviceType = params[2] & 0xFF;
        current.mDisplayName = HdmiUtils.getDefaultDeviceName(current.mDeviceType);


        // TODO(amyjojo): check if non-TV device needs to update cec switch info.
        // TODO(amyjojo): check if non-TV device needs to update cec switch info.
        // This is to manager CEC device separately in case they don't have address.
        // This is to manager CEC device separately in case they don't have address.
@@ -511,7 +512,10 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction {
        }
        }
        mTimeoutRetry = 0;
        mTimeoutRetry = 0;
        Slog.v(TAG, "Timeout[State=" + mState + ", Processed=" + mProcessedDeviceCount);
        Slog.v(TAG, "Timeout[State=" + mState + ", Processed=" + mProcessedDeviceCount);
        if (mState != STATE_WAITING_FOR_POWER) {
        if (mState != STATE_WAITING_FOR_POWER && mState != STATE_WAITING_FOR_OSD_NAME) {
            // We don't need to remove the device info if the power status is unknown.
            // Some device does not have preferred OSD name and does not respond to Give OSD name.
            // Like LG TV. We can give it default device name and not remove it.
            removeDevice(mProcessedDeviceCount);
            removeDevice(mProcessedDeviceCount);
        } else {
        } else {
            increaseProcessedDeviceCount();
            increaseProcessedDeviceCount();