Sample code from The Auto Screen Turn On & Off  Android app