public class

CustomTileListenerService

extends Service
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ cyanogenmod.app.CustomTileListenerService

Class Overview

A service that receives calls from the system when new custom tiles are posted or removed.

To extend this class, you must declare the service in your manifest file with the cyanogenmod.permission.BIND_CUSTOM_TILE_LISTENER_SERVICE and include an intent filter with the SERVICE_INTERFACE action. For example:

 <service android:name=".CustomTileListener"
          android:label="@string/service_name"
          android:permission="cyanogenmod.permission.BIND_CUSTOM_TILE_LISTENER_SERVICE">
     <intent-filter>
         <action android:name="cyanogenmod.app.CustomTileListenerService" />
     </intent-filter>
 </service>

Summary

Constants
String SERVICE_INTERFACE The Intent that must be declared as handled by the service.
[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2
Public Constructors
CustomTileListenerService()
Public Methods
IBinder onBind(Intent intent)
void onCustomTilePosted(StatusBarPanelCustomTile sbc)
Implement this method to learn about new custom tiles as they are posted by apps.
void onCustomTileRemoved(StatusBarPanelCustomTile sbc)
Implement this method to learn when custom tiles are removed.
void onListenerConnected()
Implement this method to learn about when the listener is enabled and connected to the status bar manager.
final void removeCustomTile(String pkg, String tag, int id)
Inform the CMStatusBarManager about dismissal of a single custom tile.
[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 android.content.ComponentCallbacks

Constants

public static final String SERVICE_INTERFACE

Added in API level 1

The Intent that must be declared as handled by the service.

Constant Value: "cyanogenmod.app.CustomTileListenerService"

Public Constructors

public CustomTileListenerService ()

Added in API level 1

Public Methods

public IBinder onBind (Intent intent)

Added in API level 1

public void onCustomTilePosted (StatusBarPanelCustomTile sbc)

Added in API level 1

Implement this method to learn about new custom tiles as they are posted by apps.

Parameters
sbc A data structure encapsulating the original CustomTile object as well as its identifying information (tag and id) and source (package name).

public void onCustomTileRemoved (StatusBarPanelCustomTile sbc)

Added in API level 1

Implement this method to learn when custom tiles are removed.

Parameters
sbc A data structure encapsulating at least the original information (tag and id) and source (package name) used to post the CustomTile that was just removed.

public void onListenerConnected ()

Added in API level 1

Implement this method to learn about when the listener is enabled and connected to the status bar manager. at this time.

public final void removeCustomTile (String pkg, String tag, int id)

Added in API level 1

Inform the CMStatusBarManager about dismissal of a single custom tile.

Use this if your listener has a user interface that allows the user to dismiss individual custom tiles, similar to the behavior of Android's status bar and notification panel. It should be called after the user dismisses a single custom tile using your UI; upon being informed, the cmstatusbar manager will actually remove the custom tile and you will get an onCustomTileRemoved(StatusBarPanelCustomTile) callback.

Parameters
pkg Package of the notifying app.
tag Tag of the custom tile as specified by the notifying app
id ID of the custom tile as specified by the notifying app