com.cisco.jabber.guest.sdk.CallService Class Reference

The CallService monitors an active Jabber Guest call and provides a number of benefits. More...

Inherits Service, and SensorEventListener.

Public Member Functions

void onSensorChanged (SensorEvent event)
 This service listens for changes to the device's proximity sensor. More...
 

Protected Member Functions

void setCallNotification ()
 Post a notification by calling startForeground with a notification containing the PendingIntent passed as an extra when this service was started. More...
 
void clearCallNotification ()
 Clear the notification posted by setCallNotification by calling stopForeground.
 

Detailed Description

The CallService monitors an active Jabber Guest call and provides a number of benefits.

It is optional, but recommended that this service is started whenever there is an active call. The JabberGuestCallActivity does this for you.

CallService will:

  • hold onto a JabberGuestCall instance so that a call in the background will not be garbage collected.
  • post a Notification while the call is active so that a call may easily be resumed if the application is in the background.
  • monitor the Proximity sensor to detect when the Front camera is obscured and automatically stop the outgoing video.
  • monitor the phone state and automatically end a Jabber Guest Call if an incoming call is answered or an outgoing call is placed.

In order for this service to be started (by your application or by JabberGuestCallActivity), it needs to be declared in your application's manifest.

Add to your manifest by adding:

<service android:name="com.cisco.jabber.guest.sdk.CallService" />

If your application is starting the CallService (instead of having JabberGuestCallActivity do it automatically), you must pass in a PendingIntent as an extra. This PendingIntent is used to relaunch your application from the ongoing call notification that this service will post.

Intent serviceIntent = new Intent(this, CallService.class);
serviceIntent.putExtra(CallService.ARG_PENDING_INTENT_FOR_NOTIFICATION, getPendingIntentForNotification());
startService(serviceIntent);

Member Function Documentation

void com.cisco.jabber.guest.sdk.CallService.onSensorChanged ( SensorEvent  event)
inline

This service listens for changes to the device's proximity sensor.

This implementation will automatically stop the outgoing video if the proximity sensor is triggered (typically meaning the front camera is also obscured).

There is a small delay between the triggering of the proximity sensor and the stopping of the video to prevent transient movement across the proximity sensor from stopping and restarting the video.

If the outgoing video is already muted by the user or application, the proximity sensor has no affect. For example, if your application has muted the outgoing video, it will not be unmuted by this method once the proximity sensor reports that there are no near objects.

void com.cisco.jabber.guest.sdk.CallService.setCallNotification ( )
inlineprotected

Post a notification by calling startForeground with a notification containing the PendingIntent passed as an extra when this service was started.

You may override this method to handle your own notification mechanism.