Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Ringer mode changed to silent doesn't stop the phone vibrating

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.

like image 983
Flo Avatar asked Apr 13 '10 18:04

Flo


People also ask

How do I turn off silent mode on my Android?

Use the Settings menu. Select the "Settings" icon from the Android phone's home screen. Select "Sound Settings," then clear the "Silent Mode" check box.

Why does my Android phone ring on silent?

The first thing to do is to ensure that the Do Not Disturb mode is disabled. When enabled, this mode will silence your notifications and incoming calls by default. So, what you should do is disable it and check for improvements. Usually, there's a tile in the Quick Access menu where you can toggle the mode on or off.

Why does my phone keep going on silent mode?

There might be a number of reasons which cause the phone to go into silent mode. This may be because of DND mode, or some Google Assistant routine, or even because of some third-party app that you have recently installed.


1 Answers

Sorry, this is a known bug in the Phone app; it doesn't currently listen for AudioManager.RINGER_MODE_CHANGED_ACTION broadcasts (which would tell it to stop the ringer and vibration). I recommend filing a bug at b.android.com.

like image 125
dsandler Avatar answered Oct 12 '22 16:10

dsandler