Helpful Information
 
 
Category: BlackBerry Development
Code to block the calls

:) :confused: Hi, I have written code to block the calls. I m automatically invoking the key event to cut the call when the call arrives. The call is blocked as expected but I m getting one ring before the call blocks. I try to minimize the master volume to 'zero' and set the same after the call ends.



int master_volume= net.rim.device.api.system.Alert.getVolume();
//net.rim.device.api.notification.NotificationsManager.getMasterNotificationVolume();
System.out.println("Master Volume "+master_volume);
net.rim.device.api.system.Alert.setVolume(0);
System.out.println("Master Volume after setting "+net.rim.device.api.system.Alert.getVolume());
System.out.println("Master Volume 1 after setting "+net.rim.device.api.notification.NotificationsManager.getMasterNotificationVolume());
EventInjector.KeyCodeEvent ev1 = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN, ((char) Keypad.KEY_END), KeypadListener.STATUS_ALT, 100);
EventInjector.invokeEvent(ev1);
net.rim.device.api.system.Alert.setVolume(master_volume);
System.out.println("Master volume 2 "+master_volume);




Also below is the debugger output.


:confused:
Master Volume 100
Master Volume after setting 0
Master Volume 1 after setting 70
Master volume 2 100


The NotificationManager volume too has the same effect when using.

I do not want even one ring when the call rises.


:tbulb: I m Using Strom 9530 and JDE 4.7.0 for development.










privacy (GDPR)