There are probably a lot of ways to determine it. One way I figured out myself is to take a screenshot with the screencap binary, then feed that to graphicsmagick or imagemagick and check the image for markers. You can then add more conditions or actions depending upon if the marker(s) are there or not. You do need root for the screencap binary to work though.
Even in android the power of the command line is truly awesome.
---------- Post added at 07:10 PM ---------- Previous post was at 07:02 PM ----------
@ktoonsez
I've been running your 7-14 kernel for about a week and it is rock solid!
I've only come across 2 issues while using it.
Sometimes the screen will stop responding to touch every once in awhile. But if you turn it on with the power button and let the screen go dark it fixes it.
And almost all the time s2w and dt2s don't work while you're in a call. Maybe it's radio or firmware-related.
Both are very minor issues, so I wouldn't be too concerned with them.
---------- Post added at 07:29 PM ---------- Previous post was at 07:10 PM ----------
Oooooo new 7-18 kernel! I'll flash it after I finish up a few projects...
Thanks for the feed back. s2w and dt2s are always disabled when in a call so it doesnt wake the phone when its at your ear