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
synchronized final IBinder onBind(Intent intent)
void onChange(ChangeEvent event)
void onCompletion(CompletionEvent event)
synchronized 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.ComponentCallbacks
From interface android.content.ComponentCallbacks2
From interface com.google.android.gms.drive.events.ChangeListener
From interface com.google.android.gms.drive.events.CompletionListener

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