I have an application which makes VoIp call. During those call, I would like the screen to react exactly as it does during a normal call. That is, i want the screen to disable all events and turn off when the user triggers the proximity sensor. Of course, when the user moves away his ear from the phone, I want the phone to turn the screen on and enable back all events. I tried before to turn off and on the screen myself. Never worked. So I thought i'd used this solution.
There is a similar question I found which gives some great info on the Proximity Sensor using samples from the Android Phone app.