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

PassiveProvider

public class PassiveProvider extends Object implements LocationProviderInterface
A passive location provider reports locations received from other providers for clients that want to listen passively without actually triggering location updates. {@hide}

Fields Summary
private static final String
TAG
private static final com.android.internal.location.ProviderProperties
PROPERTIES
private final android.location.ILocationManager
mLocationManager
private boolean
mReportLocation
Constructors Summary
public PassiveProvider(android.location.ILocationManager locationManager)


       
        mLocationManager = locationManager;
    
Methods Summary
public voiddisable()

    
public voiddump(java.io.FileDescriptor fd, java.io.PrintWriter pw, java.lang.String[] args)

        pw.println("mReportLocation=" + mReportLocation);
    
public voidenable()

    
public java.lang.StringgetName()

        return LocationManager.PASSIVE_PROVIDER;
    
public com.android.internal.location.ProviderPropertiesgetProperties()

        return PROPERTIES;
    
public intgetStatus(android.os.Bundle extras)

        if (mReportLocation) {
            return LocationProvider.AVAILABLE;
        } else {
            return LocationProvider.TEMPORARILY_UNAVAILABLE;
        }
    
public longgetStatusUpdateTime()

        return -1;
    
public booleanisEnabled()

        return true;
    
public booleansendExtraCommand(java.lang.String command, android.os.Bundle extras)

        return false;
    
public voidsetRequest(com.android.internal.location.ProviderRequest request, android.os.WorkSource source)

        mReportLocation = request.reportLocation;
    
public voidupdateLocation(android.location.Location location)

        if (mReportLocation) {
            try {
                // pass the location back to the location manager
                mLocationManager.reportLocation(location, true);
            } catch (RemoteException e) {
                Log.e(TAG, "RemoteException calling reportLocation");
            }
        }