-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RUMM-2542 Send hasReplay property for RUM events
- Loading branch information
Showing
28 changed files
with
624 additions
and
50 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
dd-sdk-android/src/main/kotlin/com/datadog/android/rum/internal/FeaturesContextResolver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2016-Present Datadog, Inc. | ||
*/ | ||
|
||
package com.datadog.android.rum.internal | ||
|
||
import com.datadog.android.sessionreplay.internal.SessionReplayFeature | ||
import com.datadog.android.v2.api.context.DatadogContext | ||
|
||
internal class FeaturesContextResolver { | ||
|
||
fun resolveHasReplay(context: DatadogContext): Boolean { | ||
val sessionReplayContext = | ||
context.featuresContext[SessionReplayFeature.SESSION_REPLAY_FEATURE_NAME] | ||
return ( | ||
sessionReplayContext?.get(SessionReplayFeature.IS_RECORDING_CONTEXT_KEY) | ||
as? Boolean | ||
) ?: false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...src/main/kotlin/com/datadog/android/sessionreplay/internal/SessionReplayRecordCallback.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2016-Present Datadog, Inc. | ||
*/ | ||
|
||
package com.datadog.android.sessionreplay.internal | ||
|
||
import com.datadog.android.sessionreplay.RecordCallback | ||
import com.datadog.android.v2.api.SDKCore | ||
|
||
internal class SessionReplayRecordCallback(private val datadogCore: SDKCore) : RecordCallback { | ||
override fun onStartRecording() { | ||
updateRecording(true) | ||
} | ||
|
||
override fun onStopRecording() { | ||
updateRecording(false) | ||
} | ||
|
||
private fun updateRecording(isRecording:Boolean){ | ||
val featureContext = mapOf(SessionReplayFeature.IS_RECORDING_CONTEXT_KEY to isRecording) | ||
datadogCore.setFeatureContext( | ||
SessionReplayFeature.SESSION_REPLAY_FEATURE_NAME, | ||
featureContext | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.