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

Commit b3aeb3ec authored by Joe Onorato's avatar Joe Onorato Committed by Android (Google) Code Review
Browse files

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

parents 48a880bc 7ba631f8
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.