Methods Summary |
---|
public int | describeContents()
return 0;
|
public int | getAccuracy()Returns a constant indicating desired accuracy of location
Accuracy may be {@link #ACCURACY_FINE} if desired location
is fine, else it can be {@link #ACCURACY_COARSE}.
return mAccuracy;
|
public int | getPowerRequirement()Returns a constant indicating the desired power requirement. The
returned
return mPowerRequirement;
|
public boolean | isAltitudeRequired()Returns whether the provider must provide altitude information.
Not all fixes are guaranteed to contain such information.
return mAltitudeRequired;
|
public boolean | isBearingRequired()Returns whether the provider must provide bearing information.
Not all fixes are guaranteed to contain such information.
return mBearingRequired;
|
public boolean | isCostAllowed()Returns whether the provider is allowed to incur monetary cost.
return mCostAllowed;
|
public boolean | isSpeedRequired()Returns whether the provider must provide speed information.
Not all fixes are guaranteed to contain such information.
return mSpeedRequired;
|
public void | setAccuracy(int accuracy)Indicates the desired accuracy for latitude and longitude. Accuracy
may be {@link #ACCURACY_FINE} if desired location
is fine, else it can be {@link #ACCURACY_COARSE}.
More accurate location usually consumes more power and may take
longer.
if (accuracy < NO_REQUIREMENT && accuracy > ACCURACY_COARSE) {
throw new IllegalArgumentException("accuracy=" + accuracy);
}
mAccuracy = accuracy;
|
public void | setAltitudeRequired(boolean altitudeRequired)Indicates whether the provider must provide altitude information.
Not all fixes are guaranteed to contain such information.
mAltitudeRequired = altitudeRequired;
|
public void | setBearingRequired(boolean bearingRequired)Indicates whether the provider must provide bearing information.
Not all fixes are guaranteed to contain such information.
mBearingRequired = bearingRequired;
|
public void | setCostAllowed(boolean costAllowed)Indicates whether the provider is allowed to incur monetary cost.
mCostAllowed = costAllowed;
|
public void | setPowerRequirement(int level)Indicates the desired maximum power level. The level parameter
must be one of NO_REQUIREMENT, POWER_LOW, POWER_MEDIUM, or
POWER_HIGH.
if (level < NO_REQUIREMENT || level > POWER_HIGH) {
throw new IllegalArgumentException("level=" + level);
}
mPowerRequirement = level;
|
public void | setSpeedRequired(boolean speedRequired)Indicates whether the provider must provide speed information.
Not all fixes are guaranteed to contain such information.
mSpeedRequired = speedRequired;
|
public void | writeToParcel(android.os.Parcel parcel, int flags)
parcel.writeInt(mAccuracy);
parcel.writeInt(mPowerRequirement);
// parcel.writeInt(mPreferredResponseTime);
parcel.writeInt(mAltitudeRequired ? 1 : 0);
parcel.writeInt(mBearingRequired ? 1 : 0);
parcel.writeInt(mSpeedRequired ? 1 : 0);
parcel.writeInt(mCostAllowed ? 1 : 0);
|