0

How does the native call disable the alarm ringing and vibration when a call is ringing and vibrating?

And after the call disconnection the alarm is resuming again in native behaviour.

I tried :

mAudioManager.setStreamMute(AudioManager.STREAM_ALARM, true);

But of no use. Please help here. I need a similar requirement

Ajitha
  • 717
  • 1
  • 7
  • 30
  • do you initialize your AudioManager properly ? – Sree Dec 23 '15 at 08:49
  • yes , the other methods in alarm manager is working. – Ajitha Dec 23 '15 at 08:50
  • can i show the code how you initialize ? – Sree Dec 23 '15 at 08:54
  • http://stackoverflow.com/a/7929139 – Sree Dec 23 '15 at 08:56
  • mAudioManager = (AudioManager) getApplicationContext().getInstance().getSystemService(Context.AUDIO_SERVICE); – Ajitha Dec 23 '15 at 09:16
  • audioManager.setStreamVolume(AudioManager.STREAM_ALARM, maxVolume,AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE); what about this ? – Sree Dec 23 '15 at 09:25
  • no, doesn't work either.... – Ajitha Dec 23 '15 at 09:42
  • then what about stop the alarm and start ? – Sree Dec 23 '15 at 09:43
  • http://stackoverflow.com/questions/13909040/set-android-alarm-clock-programmatically. hope it helps. – Rahul Hawge Dec 23 '15 at 09:47
  • Since the alarm is set in the native application, we are not having sufficient data to start/stop the application :( – Ajitha Dec 23 '15 at 09:54
  • But what I see is, Alarms are priority interruptions and can never be stopped.... I am able to stop the alarm's ringing tone by using : mAudioManager.setStreamSolo(stream, state); ..... but not the vibration.... – Ajitha Dec 23 '15 at 09:58
  • But am pretty not sure how does the alarm vibration stop in native calls , but not third party calling applications.. even in watsapp call or viber call, when the alarm vibration is on, and when it rings, the vibration continuously rings. – Ajitha Dec 23 '15 at 10:43

0 Answers0