FileDocCategorySizeDatePackage
GpsNavigationMessageProvider.javaAPI DocAndroid 5.1 API3806Thu Mar 12 22:22:42 GMT 2015com.android.server.location

GpsNavigationMessageProvider

public abstract class GpsNavigationMessageProvider extends RemoteListenerHelper
An base implementation for GPS navigation messages provider. It abstracts out the responsibility of handling listeners, while still allowing technology specific implementations to be built.
hide

Fields Summary
private static final String
TAG
Constructors Summary
public GpsNavigationMessageProvider(android.os.Handler handler)


       
        super(handler, TAG);
    
Methods Summary
protected ListenerOperationgetHandlerOperation(int result)

        final int status;
        switch (result) {
            case RESULT_SUCCESS:
                status = GpsNavigationMessageEvent.STATUS_READY;
                break;
            case RESULT_NOT_AVAILABLE:
            case RESULT_NOT_SUPPORTED:
            case RESULT_INTERNAL_ERROR:
                status = GpsNavigationMessageEvent.STATUS_NOT_SUPPORTED;
                break;
            case RESULT_GPS_LOCATION_DISABLED:
                status = GpsNavigationMessageEvent.STATUS_GPS_LOCATION_DISABLED;
                break;
            default:
                Log.v(TAG, "Unhandled addListener result: " + result);
                return null;
        }
        return new StatusChangedOperation(status);
    
protected voidhandleGpsEnabledChanged(boolean enabled)

        int status = enabled ?
                GpsNavigationMessageEvent.STATUS_READY :
                GpsNavigationMessageEvent.STATUS_GPS_LOCATION_DISABLED;
        foreach(new StatusChangedOperation(status));
    
public voidonCapabilitiesUpdated(boolean isGpsNavigationMessageSupported)

        int status = isGpsNavigationMessageSupported ?
                GpsNavigationMessageEvent.STATUS_READY :
                GpsNavigationMessageEvent.STATUS_NOT_SUPPORTED;
        setSupported(isGpsNavigationMessageSupported, new StatusChangedOperation(status));
    
public voidonNavigationMessageAvailable(android.location.GpsNavigationMessageEvent event)

        ListenerOperation<IGpsNavigationMessageListener> operation =
                new ListenerOperation<IGpsNavigationMessageListener>() {
                    @Override
                    public void execute(IGpsNavigationMessageListener listener)
                            throws RemoteException {
                        listener.onGpsNavigationMessageReceived(event);
                    }
                };
        foreach(operation);