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

Commit 066db152 authored by Amy's avatar Amy Committed by shubang
Browse files

Atom: initPortInfo when receive hotplug from tx for audiosystem device[1/3]

ag/5190487

BUG=115782816, 113608041
PD# 174288

Test: local tested
Change-Id: I7bfdcbaf28dbe7cf9538c0eadbf751b376fb8404
(cherry picked from https://partner-android-review.git.corp.google.com/c/platform/frameworks/base/+/1152062)
parent d932cb51
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -270,7 +270,6 @@ public class SettingsBackupTest {
                    Settings.Global.GNSS_SATELLITE_BLACKLIST,
                    Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS,
                    Settings.Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED,
                    Settings.Global.HDMI_CONTROL_AUTO_TV_OFF_ENABLED,
                    Settings.Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED,
                    Settings.Global.HDMI_CONTROL_ENABLED,
                    Settings.Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED,
+9 −0
Original line number Diff line number Diff line
@@ -1008,6 +1008,10 @@ public class HdmiControlService extends SystemService {
        assertRunOnServiceThread();

        if (connected && !isTvDevice()) {
            if (getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT && isSwitchDevice()) {
                initPortInfo();
                HdmiLogger.debug("initPortInfo for switch device when onHotplug from tx.");
            }
            ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>();
            for (int type : mLocalDevices) {
                if (type == HdmiDeviceInfo.DEVICE_PLAYBACK
@@ -2124,6 +2128,11 @@ public class HdmiControlService extends SystemService {
        return mLocalDevices.contains(HdmiDeviceInfo.DEVICE_PLAYBACK);
    }

    boolean isSwitchDevice() {
        return SystemProperties.getBoolean(
            Constants.PROPERTY_HDMI_IS_DEVICE_HDMI_CEC_SWITCH, false);
    }

    boolean isTvDeviceEnabled() {
        return isTvDevice() && tv() != null;
    }