DriveEventService

public abstract class DriveEventService extends Service
implements ChangeListener CompletionListener

Abstract base class for a bound service that handles all DriveEvent instances. These events will be delivered using AIDL calls to the service. The base class handles binding and handling of these calls and will raise listener events on the subclass.

Subclasses should override one or more of the following interfaces depending upon the event types that expected by the application:

The default implementation of all listener methods (onListener) methods will log an unhandled event warning to indicate that an unexpected event type was received. Subclasses should override these methods for any expected event types to provide appropriate handling.

The implementation subclass must be listed as an exported service in the Android manifest for the application. The following manifest fragment shows a sample declaration with the required attributes:

 <manifest xmlns:android="//schemas.android.com/apk/res/android"
   <service android:name=".MyAppEventService" android:exported="true" >
     <intent-filter>
       <action android:name="com.google.android.gms.drive.events.HANDLE_EVENT" />
     </intent-filter>
   </service>
 </manifest>

Constant Summary

String ACTION_HANDLE_EVENT The action name used to bind to the DriveEventService for event delivery

Inherited Constant Summary

Protected Constructor Summary

DriveEventService(String name)
Creates a new event service instance.
DriveEventService()
Creates a new event service instance with a default name.

Public Method Summary

synchronized final IBinder
onBind(Intent intent)
void
void
synchronized void
boolean
onUnbind(Intent intent)

Protected Method Summary

int
getCallingUid()
Retrieves the current calling UID.

Inherited Method Summary

Constants

public static final String ACTION_HANDLE_EVENT

The action name used to bind to the DriveEventService for event delivery

Constant Value: "com.google.android.gms.drive.events.HANDLE_EVENT"

Protected Constructors

protected DriveEventService (String name)

Creates a new event service instance.

Parameters
name the name of the event service, used to name the worker thread (for debugging).

protected DriveEventService ()

Creates a new event service instance with a default name.

Public Methods

public final synchronized IBinder onBind (Intent intent)

public void onChange (ChangeEvent event)

public void onCompletion (CompletionEvent event)

public synchronized void onDestroy ()

public boolean onUnbind (Intent intent)

Protected Methods

protected int getCallingUid ()

Retrieves the current calling UID. Exposed to support test mocking