I'm trying to change the ringer mode of the phone to RINGER_MODE_SILENT when a call is incoming by using the following lines of code.
AudioManager am = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
am.setRingerMode(AudioManager.RINGER_MODE_SILENT);
While the phone stops ringing it continue to vibrate although the documentation of RINGER_MODE_SILENT says it should also stop vibrating.
I'm using the SDK 1.6
UPDATE:
As I didn't find a solution yet, I tried to deactivate the vibration settings manually.
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF );
But this also doesn't prevent the phone form vibrating when a call is incoming.
Any ideas?
UPDATE 2:
Today I tried to solve the problem by canceling the vibration via a Vibration object.
Vibrator vib = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
vib.cancel();
Again, without success. Now I'm running out of ideas and asking myself if it is possible to stop the vibration at all.
UPDATE 3:
I've discovered another interesting fact when I've reread the documentation of the Vibrator class. The documentation says:
"If your process exits, any vibration you started with will stop."
This sounds to me as if the vibration is linked to the process that started it and cannot be accessed form another process.