Skip to content

Commit

Permalink
Merge branch 'master' into shicheng/fence-1948-set-log-level-in-sdk-i…
Browse files Browse the repository at this point in the history
…n-initialize
  • Loading branch information
ShiCheng-Lu authored Jun 12, 2024
2 parents e981966 + 1a7cbdd commit 5ba16b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdk/src/main/java/io/radar/sdk/RadarApiClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ internal class RadarApiClient(
"X-Radar-Device-Model" to RadarUtils.deviceModel,
"X-Radar-Device-OS" to RadarUtils.deviceOS,
"X-Radar-Device-Type" to RadarUtils.deviceType,
"X-Radar-SDK-Version" to RadarUtils.sdkVersion
"X-Radar-SDK-Version" to RadarUtils.sdkVersion,
"X-Radar-Mobile-Origin" to context.packageName
)
if (RadarSettings.isXPlatform(context)) {
headers["X-Radar-X-Platform-SDK-Type"] = RadarSettings.getXPlatformSDKType(context)
Expand Down
9 changes: 9 additions & 0 deletions sdk/src/main/java/io/radar/sdk/model/RadarAddress.kt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ class RadarAddress(
*/
val plus4: String?,

/**
* The distance to the search anchor in meters
*/
val distance: Int?,

/**
* The layer of the address
*/
Expand Down Expand Up @@ -155,6 +160,7 @@ class RadarAddress(
private const val FIELD_PLACE_LABEL = "placeLabel"
private const val FIELD_UNIT = "unit"
private const val FIELD_PLUS4 = "plus4"
private const val FIELD_DISTANCE = "distance"
private const val FIELD_LAYER = "layer"
private const val FIELD_METADATA = "metadata"
private const val FIELD_CONFIDENCE = "confidence"
Expand Down Expand Up @@ -185,6 +191,7 @@ class RadarAddress(
val placeLabel = obj.optString(FIELD_PLACE_LABEL) ?: null
val unit = obj.optString(FIELD_UNIT) ?: null
val plus4 = obj.optString(FIELD_PLUS4) ?: null
val distance = obj.optInt(FIELD_DISTANCE)
val layer = obj.optString(FIELD_LAYER) ?: null
val metadata: JSONObject? = obj.optJSONObject(FIELD_METADATA) ?: null
val confidence = when(obj.optString(FIELD_CONFIDENCE)) {
Expand Down Expand Up @@ -215,6 +222,7 @@ class RadarAddress(
placeLabel,
unit,
plus4,
distance,
layer,
metadata,
confidence
Expand Down Expand Up @@ -288,6 +296,7 @@ class RadarAddress(
obj.putOpt(FIELD_PLACE_LABEL, this.placeLabel)
obj.putOpt(FIELD_UNIT, this.unit)
obj.putOpt(FIELD_PLUS4, this.plus4)
obj.putOpt(FIELD_DISTANCE, this.distance)
obj.putOpt(FIELD_LAYER, this.layer)
obj.putOpt(FIELD_METADATA, this.metadata)
obj.putOpt(FIELD_CONFIDENCE, stringForConfidence(this.confidence))
Expand Down

0 comments on commit 5ba16b4

Please sign in to comment.