public abstract class

DriveEventService

extends Service
implements ChangeListener CompletionListener
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ com.google.android.gms.drive.events.DriveEventService

Class Overview

Abstract base class for a bound service that handles Drive events. 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="http://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>

See also:

Summary

Constants
String ACTION_HANDLE_EVENT The action name used to bind to the DriveEventService for event delivery
[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2
Protected Constructors
DriveEventService(String name)
Creates a new event service instance.
DriveEventService()
Creates a new event service instance with a default name.
Public Methods
final IBinder onBind(Intent intent)
void onChange(ChangeEvent event)
void onCompletion(CompletionEvent event)
void onDestroy()
boolean onUnbind(Intent intent)
Protected Methods
int getCallingUid()
Retrieves the current calling UID.
[Expand]
Inherited Methods
From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface com.google.android.gms.drive.events.ChangeListener
From interface com.google.android.gms.drive.events.CompletionListener
From interface android.content.ComponentCallbacks

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 String: 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 IBinder onBind (Intent intent)

Parameters
intent Intent
Returns
IBinder

public void onChange (ChangeEvent event)

Parameters
event ChangeEvent

public void onCompletion (CompletionEvent event)

Parameters
event CompletionEvent

public void onDestroy ()

public boolean onUnbind (Intent intent)

Parameters
intent Intent
Returns
boolean

Protected Methods

protected int getCallingUid ()

Retrieves the current calling UID. Exposed to support test mocking

Returns
int