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

Commit 7ba631f8 authored by Joe Onorato's avatar Joe Onorato
Browse files

If there is no hdmi available, still record that hdmi is not plugged in.

Bug: 4321927
Change-Id: I583b75477914f6ec0d6cb8c3d6775063202e1dbe
parent 523ca2ba
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2217,11 +2217,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    void initializeHdmiState() {
        boolean plugged = false;
        // watch for HDMI plug messages if the hdmi switch exists
        if (new File("/sys/devices/virtual/switch/hdmi/state").exists()) {
            mHDMIObserver.startObserving("DEVPATH=/devices/virtual/switch/hdmi");

            boolean plugged = false;
            final String filename = "/sys/class/switch/hdmi/state";
            FileReader reader = null;
            try {
@@ -2243,12 +2243,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    }
                }
            }

        }
        // This dance forces the code in setHdmiPlugged to run.
        // Always do this so the sticky intent is stuck (to false) if there is no hdmi.
        mHdmiPlugged = !plugged;
        setHdmiPlugged(!mHdmiPlugged);
    }
    }

    /**
     * @return Whether music is being played right now.