Using this code I was able to determine whether the Android device I'm writing for (a "Ugoos" appliance) thinks a monitor is attached. The code works, reasonably well.
However, if the monitor is powered-off, the code still reports that the HDMI device is connected. I've tried everything I can think of, but can't find code to determine whether the monitor is turned off or not.
I even did a "before and after" ls -lR of the /proc and /sys directories and compared them, to no avail.
Any ideas?