Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.core:core:1.1.0-alpha01

NotificationCompatSideChannelService

public abstract class NotificationCompatSideChannelService
extends Service

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ androidx.core.app.NotificationCompatSideChannelService


Abstract service to receive side channel notifications sent from NotificationManagerCompat.

To receive side channel notifications, extend this service and register it in your android manifest with an intent filter for the BIND_NOTIFICATION_SIDE_CHANNEL action. Note: you must also have an enabled NotificationListenerService within your package.

Example AndroidManifest.xml addition:

 <service android:name="com.example.NotificationSideChannelService">
     <intent-filter>
         <action android:name="android.support.BIND_NOTIFICATION_SIDE_CHANNEL" />
     </intent-filter>
 </service>

Summary

Inherited constants

Public constructors

NotificationCompatSideChannelService()

Public methods

abstract void cancel(String packageName, int id, String tag)

Handle a side-channelled notification being cancelled.

abstract void cancelAll(String packageName)

Handle the side-channelled cancelling of all notifications for a package.

abstract void notify(String packageName, int id, String tag, Notification notification)

Handle a side-channeled notification being posted.

IBinder onBind(Intent intent)

Inherited methods

Public constructors

NotificationCompatSideChannelService

added in version 1.0.0
public NotificationCompatSideChannelService ()

Public methods

cancel

added in version 1.0.0
public abstract void cancel (String packageName, 
                int id, 
                String tag)

Handle a side-channelled notification being cancelled.

Parameters
packageName String

id int

tag String

cancelAll

added in version 1.0.0
public abstract void cancelAll (String packageName)

Handle the side-channelled cancelling of all notifications for a package.

Parameters
packageName String

notify

added in version 1.0.0
public abstract void notify (String packageName, 
                int id, 
                String tag, 
                Notification notification)

Handle a side-channeled notification being posted.

Parameters
packageName String

id int

tag String

notification Notification

onBind

added in version 1.0.0
public IBinder onBind (Intent intent)

Parameters
intent Intent

Returns
IBinder