I'm developing a simple phoning application for Android, but I'm having trouble implementing an important functionality.
When I make a call in an Android's default phone app, if I place the phone next to my ear, the screen goes black and it gets temporarily disabled so the user don't accidentally press the virtual buttons.
I already know how to use the proximity sensor, but how can I temporarily disable the screen?