Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for creating instances of SessionConfig
.
Summary
Public constructors
Public methods
setAngleOfArrivalNeeded
fun setAngleOfArrivalNeeded(isAngleOfArrivalNeeded: Boolean): SessionConfig.Builder
Sets whether Angle of Arrival (AoA) is required for the ranging operation.
Defaults to false
Parameters |
isAngleOfArrivalNeeded |
Boolean: true if AoA data is required; false otherwise. |
setDataNotificationConfig
fun setDataNotificationConfig(config: DataNotificationConfig): SessionConfig.Builder
Sets the data notification configuration for this preference.
Exceptions |
java.lang.IllegalArgumentException |
if the config is null. |
setRangingMeasurementsLimit
fun setRangingMeasurementsLimit(rangingMeasurementsLimit: Int): SessionConfig.Builder
Sets the maximum number of ranging rounds for this session. This includes all ranging rounds, irrespective of whether they were successful or not. For 1:many sessions, a round includes ranging to all peers within that round.
By default, when the value is set to 0
, the ranging session will run indefinitely.
Parameters |
rangingMeasurementsLimit |
Int: the maximum number of ranging rounds (0 to 65535). Value is between 0 and 65535 inclusive |
Exceptions |
java.lang.IllegalArgumentException |
if the value is outside the allowed range (0 to 65535). |
setSensorFusionParams
fun setSensorFusionParams(parameters: SensorFusionParams): SessionConfig.Builder
Sets the sensor fusion parameters for this preference.
Exceptions |
java.lang.IllegalArgumentException |
if the parameters is null. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-13 UTC."],[],[],null,["# SessionConfig.Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/ranging/SessionConfig.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.ranging.SessionConfig.Builder](#) |\n\nBuilder for creating instances of [SessionConfig](/reference/kotlin/android/ranging/SessionConfig).\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [SessionConfig](/reference/kotlin/android/ranging/SessionConfig) | [build](#build())`()` Builds a new [SessionConfig](/reference/kotlin/android/ranging/SessionConfig) instance. |\n| [SessionConfig.Builder](#) | [setAngleOfArrivalNeeded](#setAngleOfArrivalNeeded(kotlin.Boolean))`(`isAngleOfArrivalNeeded:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether Angle of Arrival (AoA) is required for the ranging operation. |\n| [SessionConfig.Builder](#) | [setDataNotificationConfig](#setDataNotificationConfig(android.ranging.DataNotificationConfig))`(`config:` `[DataNotificationConfig](/reference/kotlin/android/ranging/DataNotificationConfig)`)` Sets the data notification configuration for this preference. |\n| [SessionConfig.Builder](#) | [setRangingMeasurementsLimit](#setRangingMeasurementsLimit(kotlin.Int))`(`rangingMeasurementsLimit:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the maximum number of ranging rounds for this session. |\n| [SessionConfig.Builder](#) | [setSensorFusionParams](#setSensorFusionParams(android.ranging.SensorFusionParams))`(`parameters:` `[SensorFusionParams](/reference/kotlin/android/ranging/SensorFusionParams)`)` Sets the sensor fusion parameters for this preference. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): SessionConfig\n```\n\nBuilds a new [SessionConfig](/reference/kotlin/android/ranging/SessionConfig) instance.\n\n| Return ||\n|------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|\n| [SessionConfig](/reference/kotlin/android/ranging/SessionConfig) | the new [SessionConfig](/reference/kotlin/android/ranging/SessionConfig) instance. This value cannot be `null`. |\n\n### setAngleOfArrivalNeeded\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setAngleOfArrivalNeeded(isAngleOfArrivalNeeded: Boolean): SessionConfig.Builder\n```\n\nSets whether Angle of Arrival (AoA) is required for the ranging operation.\n\nDefaults to false\n\n| Parameters ||\n|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `isAngleOfArrivalNeeded` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): `true` if AoA data is required; `false` otherwise. |\n\n| Return ||\n|----------------------------|---------------------------------------------------------|\n| [SessionConfig.Builder](#) | The [Builder](#) instance. This value cannot be `null`. |\n\n### setDataNotificationConfig\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setDataNotificationConfig(config: DataNotificationConfig): SessionConfig.Builder\n```\n\nSets the data notification configuration for this preference.\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `config` | [DataNotificationConfig](/reference/kotlin/android/ranging/DataNotificationConfig): the [DataNotificationConfig](/reference/kotlin/android/ranging/DataNotificationConfig) to use. This value cannot be `null`. |\n\n| Return ||\n|----------------------------|-----------------------------------------------------------------|\n| [SessionConfig.Builder](#) | the builder instance for chaining. This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|------------------------|\n| `java.lang.IllegalArgumentException` | if the config is null. |\n\n### setRangingMeasurementsLimit\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setRangingMeasurementsLimit(rangingMeasurementsLimit: Int): SessionConfig.Builder\n```\n\nSets the maximum number of ranging rounds for this session. This includes all ranging rounds, irrespective of whether they were successful or not. For 1:many sessions, a round includes ranging to all peers within that round.\n\nBy default, when the value is set to `0`, the ranging session will run indefinitely.\n\n| Parameters ||\n|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `rangingMeasurementsLimit` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the maximum number of ranging rounds (0 to 65535). Value is between 0 and 65535 inclusive |\n\n| Return ||\n|----------------------------|----------------------------------------------------------|\n| [SessionConfig.Builder](#) | this [Builder](#) instance. This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|---------------------------------------------------------|\n| `java.lang.IllegalArgumentException` | if the value is outside the allowed range (0 to 65535). |\n\n### setSensorFusionParams\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setSensorFusionParams(parameters: SensorFusionParams): SessionConfig.Builder\n```\n\nSets the sensor fusion parameters for this preference.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parameters` | [SensorFusionParams](/reference/kotlin/android/ranging/SensorFusionParams): the [SensorFusionParams](/reference/kotlin/android/ranging/SensorFusionParams) to use. This value cannot be `null`. |\n\n| Return ||\n|----------------------------|----------------------------------------------------|\n| [SessionConfig.Builder](#) | the builder instance. This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|----------------------------|\n| `java.lang.IllegalArgumentException` | if the parameters is null. |"]]