package com.mapbox.mapboxsdk.plugins.locationlayer; import android.support.annotation.NonNull; /** * Interface defining the source of compass heading data that is * consumed by the {@link LocationLayerPlugin} when in compass related * {@link com.mapbox.mapboxsdk.plugins.locationlayer.modes.RenderMode} or * {@link com.mapbox.mapboxsdk.plugins.locationlayer.modes.CameraMode}s. */ public interface CompassEngine { /** * Adds a {@link CompassListener} that can be used to * receive heading and state changes. * * @param compassListener to be added */ void addCompassListener(@NonNull CompassListener compassListener); /** * Removes a {@link CompassListener} that can be used to * receive heading and state changes. * * @param compassListener to be removed */ void removeCompassListener(@NonNull CompassListener compassListener); /** * Returns the last heading value produced and pushed via * a compass listener. * * @return last heading value */ float getLastHeading(); /** * Provides the last know accuracy status from the sensor manager. *

* An integer value which is identical to the {@code SensorManager} class constants: *

* * @return last accuracy status */ int getLastAccuracySensorStatus(); /** * Lifecycle method that can be used for adding or releasing resources. */ void onStart(); /** * Lifecycle method that can be used for adding or releasing resources. */ void onStop(); }