FileDocCategorySizeDatePackage
ConditionProviderService.javaAPI DocAndroid 5.1 API5675Thu Mar 12 22:22:10 GMT 2015android.service.notification

ConditionProviderService

public abstract class ConditionProviderService extends android.app.Service
A service that provides conditions about boolean state.

To extend this class, you must declare the service in your manifest file with the {@link android.Manifest.permission#BIND_CONDITION_PROVIDER_SERVICE} permission and include an intent filter with the {@link #SERVICE_INTERFACE} action. For example:

<service android:name=".MyConditionProvider"
android:label="@string/service_name"
android:permission="android.permission.BIND_CONDITION_PROVIDER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.ConditionProviderService" />
</intent-filter>
</service>
hide

Fields Summary
private final String
TAG
private final H
mHandler
private Provider
mProvider
private android.app.INotificationManager
mNoMan
public static final String
SERVICE_INTERFACE
The {@link Intent} that must be declared as handled by the service.
Constructors Summary
Methods Summary
private final android.app.INotificationManagergetNotificationInterface()


       
        
        
        

        
        if (mNoMan == null) {
            mNoMan = INotificationManager.Stub.asInterface(
                    ServiceManager.getService(Context.NOTIFICATION_SERVICE));
        }
        return mNoMan;
    
private booleanisBound()

        if (mProvider == null) {
            Log.w(TAG, "Condition provider service not yet bound.");
            return false;
        }
        return true;
    
public final voidnotifyCondition(Condition condition)

        if (condition == null) return;
        notifyConditions(new Condition[]{ condition });
    
public final voidnotifyConditions(Condition conditions)

        if (!isBound() || conditions == null) return;
        try {
            getNotificationInterface().notifyConditions(getPackageName(), mProvider, conditions);
        } catch (android.os.RemoteException ex) {
            Log.v(TAG, "Unable to contact notification manager", ex);
        }
    
public android.os.IBinderonBind(android.content.Intent intent)

        if (mProvider == null) {
            mProvider = new Provider();
        }
        return mProvider;
    
public abstract voidonConnected()

public abstract voidonRequestConditions(int relevance)

public abstract voidonSubscribe(android.net.Uri conditionId)

public abstract voidonUnsubscribe(android.net.Uri conditionId)