FileDocCategorySizeDatePackage
ActivityRecognitionProvider.javaAPI DocAndroid 5.1 API5102Thu Mar 12 22:22:30 GMT 2015com.android.location.provider

ActivityRecognitionProvider

public final class ActivityRecognitionProvider extends Object
A class that exposes {@link IActivityRecognitionHardware} functionality to unbundled services.

Fields Summary
private final android.hardware.location.IActivityRecognitionHardware
mService
private final HashSet
mSinkSet
private final SinkTransport
mSinkTransport
public static final String
ACTIVITY_IN_VEHICLE
public static final String
ACTIVITY_ON_BICYCLE
public static final String
ACTIVITY_WALKING
public static final String
ACTIVITY_RUNNING
public static final String
ACTIVITY_STILL
public static final String
ACTIVITY_TILTING
public static final int
EVENT_TYPE_FLUSH_COMPLETE
public static final int
EVENT_TYPE_ENTER
public static final int
EVENT_TYPE_EXIT
Constructors Summary
public ActivityRecognitionProvider(android.hardware.location.IActivityRecognitionHardware service)


    // end constants activity_recognition.h

              
       
          
    

      
              
        Preconditions.checkNotNull(service);
        mService = service;
        mService.registerSink(mSinkTransport);
    
Methods Summary
public booleandisableActivityEvent(java.lang.String activity, int eventType)

        return mService.disableActivityEvent(activity, eventType);
    
public booleanenableActivityEvent(java.lang.String activity, int eventType, long reportLatencyNs)

        return mService.enableActivityEvent(activity, eventType, reportLatencyNs);
    
public booleanflush()

        return mService.flush();
    
public java.lang.String[]getSupportedActivities()

        return mService.getSupportedActivities();
    
public booleanisActivitySupported(java.lang.String activity)

        return mService.isActivitySupported(activity);
    
public voidregisterSink(com.android.location.provider.ActivityRecognitionProvider$Sink sink)

        Preconditions.checkNotNull(sink);
        synchronized (mSinkSet) {
            mSinkSet.add(sink);
        }
    
public voidunregisterSink(com.android.location.provider.ActivityRecognitionProvider$Sink sink)

        Preconditions.checkNotNull(sink);
        synchronized (mSinkSet) {
            mSinkSet.remove(sink);
        }