Call block by code - getting one ring before the call blocks
Results 1 to 4 of 4

Thread: Call block by code - getting one ring before the call blocks

  1. #1
    scache is offline BlackBerryOS Noobie
    Join Date
    Mar 2010
    PIN
    9530
    Device
    storm
    OS
    xp
    Posts
    1
    Liked
    0 times

    Smile Call block by code - getting one ring before the call blocks


    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.NotificationsManag er.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.NotificationsMan ager.getMasterNotificationVolume());
    EventInjector.KeyCodeEvent ev1 = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEv ent.KEY_DOWN, ((char) Keypad.KEY_END), KeypadListener.STATUS_ALT, 100);
    EventInjector.invokeEvent(ev1);
    net.rim.device.api.system.Alert.setVolume(master_v olume);
    System.out.println("Master volume 2 "+master_volume);





    :amish:Also below is the debugger output.





    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.



    :1244::amish:I m Using Strom 9500 and JDE 4.7.0 for development.




  2. #2
    ShimmyShine's Avatar
    ShimmyShine is offline BlackBerryOS Inspired Follow ShimmyShine On Twitter
    Join Date
    Aug 2009
    Location
    Gowen, Michigan
    PIN
    Just ask!
    Device
    9800
    OS
    6.0.0.337
    Posts
    242
    Liked
    1 times
    Can you post all of your code please? Where is the listener for when the phone has an incoming call?
    "Shimmy, I love it when you talk nerdy to me!" - Natemz

  3. #3
    jnepsa's Avatar
    jnepsa is offline BlackBerryOS Wizard
    Join Date
    Apr 2009
    Location
    ohio
    PIN
    ch me then
    Device
    9550 Storm 2
    OS
    5.0.0.428
    Posts
    4,387
    Liked
    5 times
    Moved to software; )

  4. #4
    toytooii is offline BlackBerryOS Addict
    Join Date
    Apr 2009
    Device
    Storm 9530
    OS
    .419/.692 Hybrid by Lyricidal (Shrunk)
    Posts
    510
    Liked
    0 times
    Quote Originally Posted by scache View Post

    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.NotificationsManag er.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.NotificationsMan ager.getMasterNotificationVolume());
    EventInjector.KeyCodeEvent ev1 = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEv ent.KEY_DOWN, ((char) Keypad.KEY_END), KeypadListener.STATUS_ALT, 100);
    EventInjector.invokeEvent(ev1);
    net.rim.device.api.system.Alert.setVolume(master_v olume);
    System.out.println("Master volume 2 "+master_volume);





    :amish:Also below is the debugger output.





    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.



    :1244::amish:I m Using Strom 9500 and JDE 4.7.0 for development.
    Pretty certain this is because the caller ID code does not come down the line until after the first ring pulse and just before the second. Therefore, your phone doesn't know it's supposed to block the call immediately and the phone has already initiated the ring tone. You might check my post in tips and tricks in the BB Help center forum. It might be useful. Hope it works for you. http://www.blackberryos.com/forums/t...orkaround.html
    Last edited by toytooii; 03-28-2010 at 10:08 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •