Methods Summary |
---|
public int | getAccuracy()Returns a constant describing horizontal accuracy of this provider.
If the provider returns finer grain or exact location,
{@link Criteria#ACCURACY_FINE} is returned, otherwise if the
location is only approximate then {@link Criteria#ACCURACY_COARSE}
is returned.
return mProperties.mAccuracy;
|
public java.lang.String | getName()Returns the name of this provider.
return mName;
|
public int | getPowerRequirement()Returns the power requirement for this provider.
return mProperties.mPowerRequirement;
|
public boolean | hasMonetaryCost()Returns true if the use of this provider may result in a
monetary charge to the user, false if use is free. It is up to
each provider to give accurate information.
return mProperties.mHasMonetaryCost;
|
public boolean | meetsCriteria(Criteria criteria)Returns true if this provider meets the given criteria,
false otherwise.
return propertiesMeetCriteria(mName, mProperties, criteria);
|
public static boolean | propertiesMeetCriteria(java.lang.String name, com.android.internal.location.ProviderProperties properties, Criteria criteria)
if (LocationManager.PASSIVE_PROVIDER.equals(name)) {
// passive provider never matches
return false;
}
if (properties == null) {
// unfortunately this can happen for provider in remote services
// that have not finished binding yet
return false;
}
if (criteria.getAccuracy() != Criteria.NO_REQUIREMENT &&
criteria.getAccuracy() < properties.mAccuracy) {
return false;
}
if (criteria.getPowerRequirement() != Criteria.NO_REQUIREMENT &&
criteria.getPowerRequirement() < properties.mPowerRequirement) {
return false;
}
if (criteria.isAltitudeRequired() && !properties.mSupportsAltitude) {
return false;
}
if (criteria.isSpeedRequired() && !properties.mSupportsSpeed) {
return false;
}
if (criteria.isBearingRequired() && !properties.mSupportsBearing) {
return false;
}
if (!criteria.isCostAllowed() && properties.mHasMonetaryCost) {
return false;
}
return true;
|
public boolean | requiresCell()Returns true if the provider requires access to an appropriate
cellular network (e.g., to make use of cell tower IDs), false
otherwise.
return mProperties.mRequiresCell;
|
public boolean | requiresNetwork()Returns true if the provider requires access to a
data network (e.g., the Internet), false otherwise.
return mProperties.mRequiresNetwork;
|
public boolean | requiresSatellite()Returns true if the provider requires access to a
satellite-based positioning system (e.g., GPS), false
otherwise.
return mProperties.mRequiresSatellite;
|
public boolean | supportsAltitude()Returns true if the provider is able to provide altitude
information, false otherwise. A provider that reports altitude
under most circumstances but may occassionally not report it
should return true.
return mProperties.mSupportsAltitude;
|
public boolean | supportsBearing()Returns true if the provider is able to provide bearing
information, false otherwise. A provider that reports bearing
under most circumstances but may occassionally not report it
should return true.
return mProperties.mSupportsBearing;
|
public boolean | supportsSpeed()Returns true if the provider is able to provide speed
information, false otherwise. A provider that reports speed
under most circumstances but may occassionally not report it
should return true.
return mProperties.mSupportsSpeed;
|