Automatically exported from code.google.com/p/silenceringer This code is for Android Only. Tested on 2.3.6 phone.
This code shows how to mute the phone when you receive a call from someone who is not in the contact list.
The code does not just turn off the sound and vibration when a call comes in, but takes account of any audio configuration different from the default, saving values โโof sound and vibration prior to muting the phone.