ProviderProperties.Builder


public static final class ProviderProperties.Builder
extends Object

java.lang.Object
   ↳ android.location.provider.ProviderProperties.Builder


Builder for ProviderProperties.

Summary

Public constructors

Builder()
Builder(ProviderProperties providerProperties)

Public methods

ProviderProperties build()

Builds a new ProviderProperties.

ProviderProperties.Builder setAccuracy(int accuracy)

Sets a very rough bucket of provider location accuracy.

ProviderProperties.Builder setHasAltitudeSupport(boolean supportsAltitude)

Sets whether a provider can provide altitude information.

ProviderProperties.Builder setHasBearingSupport(boolean supportsBearing)

Sets whether a provider can provide bearing information.

ProviderProperties.Builder setHasCellRequirement(boolean requiresCell)

Sets whether a provider requires cell tower access.

ProviderProperties.Builder setHasMonetaryCost(boolean monetaryCost)

Sets whether a provider has a monetary cost.

ProviderProperties.Builder setHasNetworkRequirement(boolean requiresNetwork)

Sets whether a provider requires network access.

ProviderProperties.Builder setHasSatelliteRequirement(boolean requiresSatellite)

Sets whether a provider requires satellite access.

ProviderProperties.Builder setHasSpeedSupport(boolean supportsSpeed)

Sets whether a provider can provide speed information.

ProviderProperties.Builder setPowerUsage(int powerUsage)

Sets a very rough bucket of provider power usage.

Inherited methods

Public constructors

Builder

Added in API level 31
public Builder ()

Builder

Added in API level 31
public Builder (ProviderProperties providerProperties)

Parameters
providerProperties ProviderProperties: This value cannot be null.

Public methods

build

Added in API level 31
public ProviderProperties build ()

Builds a new ProviderProperties.

Returns
ProviderProperties This value cannot be null.

setAccuracy

Added in API level 31
public ProviderProperties.Builder setAccuracy (int accuracy)

Sets a very rough bucket of provider location accuracy. ProviderProperties.ACCURACY_COARSE by default.

Parameters
accuracy int: Value is ProviderProperties.ACCURACY_FINE, or ProviderProperties.ACCURACY_COARSE

Returns
ProviderProperties.Builder This value cannot be null.

setHasAltitudeSupport

Added in API level 31
public ProviderProperties.Builder setHasAltitudeSupport (boolean supportsAltitude)

Sets whether a provider can provide altitude information. False by default.

Parameters
supportsAltitude boolean

Returns
ProviderProperties.Builder This value cannot be null.

setHasBearingSupport

Added in API level 31
public ProviderProperties.Builder setHasBearingSupport (boolean supportsBearing)

Sets whether a provider can provide bearing information. False by default.

Parameters
supportsBearing boolean

Returns
ProviderProperties.Builder This value cannot be null.

setHasCellRequirement

Added in API level 31
public ProviderProperties.Builder setHasCellRequirement (boolean requiresCell)

Sets whether a provider requires cell tower access. False by default.

Parameters
requiresCell boolean

Returns
ProviderProperties.Builder This value cannot be null.

setHasMonetaryCost

Added in API level 31
public ProviderProperties.Builder setHasMonetaryCost (boolean monetaryCost)

Sets whether a provider has a monetary cost. False by default.

Parameters
monetaryCost boolean

Returns
ProviderProperties.Builder This value cannot be null.

setHasNetworkRequirement

Added in API level 31
public ProviderProperties.Builder setHasNetworkRequirement (boolean requiresNetwork)

Sets whether a provider requires network access. False by default.

Parameters
requiresNetwork boolean

Returns
ProviderProperties.Builder This value cannot be null.

setHasSatelliteRequirement

Added in API level 31
public ProviderProperties.Builder setHasSatelliteRequirement (boolean requiresSatellite)

Sets whether a provider requires satellite access. False by default.

Parameters
requiresSatellite boolean

Returns
ProviderProperties.Builder This value cannot be null.

setHasSpeedSupport

Added in API level 31
public ProviderProperties.Builder setHasSpeedSupport (boolean supportsSpeed)

Sets whether a provider can provide speed information. False by default.

Parameters
supportsSpeed boolean

Returns
ProviderProperties.Builder This value cannot be null.

setPowerUsage

Added in API level 31
public ProviderProperties.Builder setPowerUsage (int powerUsage)

Sets a very rough bucket of provider power usage. ProviderProperties.POWER_USAGE_HIGH by default.

Parameters
powerUsage int: Value is ProviderProperties.POWER_USAGE_LOW, ProviderProperties.POWER_USAGE_MEDIUM, or ProviderProperties.POWER_USAGE_HIGH

Returns
ProviderProperties.Builder This value cannot be null.