com.motorola.iden.call
Class CallHandler

java.lang.Object
  extended bycom.motorola.iden.call.CallHandler

public class CallHandler
extends java.lang.Object

A CallHandler is a class that provides functionality to handle calls.. The CallHandler is a class that provides methods to register for a particular call. The call can be InterconnectCall, GroupCall, PrivateCall or any of its combinations. Application has to create instances of a Call object with the CallHandler.getInstance() method. The Application has to specify about the type of call it has to register with. The Call object maintains a reference to its Handler object throughout the lifetime of the Call object.

After the registration, the Application has to register with a call listener. If the application is registered for a particular call, and has not registered with the listener, it will not be notified of different state changes into that call. The state of a call will be Call.WAIT when Application registers with the listener initially.

Whole of this process needs to be done in a separate thread that implements CallListener interface. The reason for doing this is the listener will constantly wait on the instance of that thread and will notify the Application using callActionListener method. So, The Application does not get blocked at the time of waiting.

Stubbed out on Gemini product.


Field Summary
static int DISPATCH_CALL
           
static int INTERCONNECT_CALL
           
 
Constructor Summary
CallHandler()
          Constructor of a class.
 
Method Summary
static Call getInstance(int type, CallListener l)
          Returns an instance of a Call.
 void startCallListener()
          The method starts the listener of a call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERCONNECT_CALL

public static final int INTERCONNECT_CALL
See Also:
Constant Field Values

DISPATCH_CALL

public static final int DISPATCH_CALL
See Also:
Constant Field Values
Constructor Detail

CallHandler

public CallHandler()
Constructor of a class.

used to create instance to use call handler methods.

Method Detail

getInstance

public static Call getInstance(int type,
                               CallListener l)
Returns an instance of a Call. If the method is called again, it will return the same instance of Call. This is done to prevent the duplication of a Call instance.

The method needs to be called as soon as the application launches. Calling it in constructor will be the best way to implement the Call instance. The type of the call needs to be passed in and the listener that will listen to the kind of Call has to be the parameter. Application has to call this method if it has to register with more than one type of call.

  • If App has to register with Interconnect Call, then Let CallHandler.getInstance(INTERCONNECT_CALL, this)
  • where this will pass the object of the thread. It needs to be casted with InterconnectCall now.

    Returns:
    Call object for a particular type of call. Call.

  • startCallListener

    public void startCallListener()
    The method starts the listener of a call. All the registered types of calls can listen based on their call types.

    This method needs to be called from a thread as this will block when it is waiting to receive new state of a call.