public class FusionEngine extends Object implements LocationListener
Modifier and Type | Class and Description |
---|---|
static interface |
FusionEngine.Callback |
Modifier and Type | Field and Description |
---|---|
static long |
SWITCH_ON_FRESHNESS_CLIFF_NS |
Constructor and Description |
---|
FusionEngine(Context context,
Looper looper) |
Modifier and Type | Method and Description |
---|---|
void |
deinit()
Called to stop doing any work, and release all resources
This can happen when a better fusion engine is installed
in a different package, and this one is no longer needed.
|
void |
disable()
Called on mLooper thread
|
void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args) |
void |
enable()
Called on mLooper thread
|
void |
init(FusionEngine.Callback callback) |
void |
onLocationChanged(Location location)
Called on mLooper thread
|
void |
onProviderDisabled(String provider)
Called on mLooper thread
|
void |
onProviderEnabled(String provider)
Called on mLooper thread
|
void |
onStatusChanged(String provider,
int status,
Bundle extras)
Called on mLooper thread
|
void |
setRequest(ProviderRequestUnbundled request,
WorkSource source)
Called on mLooper thread
|
void |
switchUser()
Called on mLooper thread
|
public static final long SWITCH_ON_FRESHNESS_CLIFF_NS
public void init(FusionEngine.Callback callback)
public void deinit()
public void enable()
public void disable()
public void setRequest(ProviderRequestUnbundled request, WorkSource source)
public void onLocationChanged(Location location)
onLocationChanged
in interface LocationListener
location
- The new location, as a Location object.public void onStatusChanged(String provider, int status, Bundle extras)
onStatusChanged
in interface LocationListener
provider
- the name of the location provider associated with this
update.status
- LocationProvider.OUT_OF_SERVICE
if the
provider is out of service, and this is not expected to change in the
near future; LocationProvider.TEMPORARILY_UNAVAILABLE
if
the provider is temporarily unavailable but is expected to be available
shortly; and LocationProvider.AVAILABLE
if the
provider is currently available.extras
- an optional Bundle which will contain provider specific
status variables.
A number of common key/value pairs for the extras Bundle are listed below. Providers that use any of the keys on this list must provide the corresponding value as described below.
public void onProviderEnabled(String provider)
onProviderEnabled
in interface LocationListener
provider
- the name of the location provider associated with this
update.public void onProviderDisabled(String provider)
onProviderDisabled
in interface LocationListener
provider
- the name of the location provider associated with this
update.public void dump(FileDescriptor fd, PrintWriter pw, String[] args)
public void switchUser()