Skip to content

Commit

Permalink
Merge pull request #753 from DataDog/marcosaia/RUM-7799/new-arch-support
Browse files Browse the repository at this point in the history
[RUM-7799] Android: new architecture fixes
  • Loading branch information
marco-saia-datadog authored Dec 18, 2024
2 parents 87c6136 + a505c2e commit 6011682
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package com.datadog.reactnative

import com.facebook.fbreact.specs.NativeDdLogsSpec
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package com.datadog.reactnative

import com.facebook.fbreact.specs.NativeDdRumSpec
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.datadog.reactnative

import android.app.Activity
import com.facebook.fbreact.specs.NativeDdSdkSpec
import com.facebook.react.bridge.LifecycleEventListener
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package com.datadog.reactnative

import com.facebook.fbreact.specs.NativeDdTraceSpec
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package com.datadog.reactnative.internaltesting

import com.facebook.fbreact.specs.NativeDdInternalTestingSpec
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ internal class ReactNativeImageViewMapper: BaseAsyncBackgroundWireframeMapper<Re
}

private fun generateUUID(reactImageView: ReactImageView): String {
val source = reactImageView.imageSource?.source ?:
System.identityHashCode(reactImageView).toString()
val hashCode = System.identityHashCode(reactImageView).toString()
val drawableType = reactImageView.drawable.current::class.java.name
return "${drawableType}-${source}"
return "${drawableType}-${hashCode}"
}

private fun Rect.toWireframeClip(): MobileSegment.WireframeClip {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package com.datadog.reactnative.sessionreplay

import com.facebook.fbreact.specs.NativeDdSessionReplaySpec
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactMethod
Expand All @@ -20,15 +21,15 @@ class DdSessionReplay(
private val implementation = DdSessionReplayImplementation(reactContext)

override fun getName(): String = DdSessionReplayImplementation.NAME

/**
* Enable session replay and start recording session.
* @param replaySampleRate The sample rate applied for session replay.
* @param defaultPrivacyLevel The privacy level used for replay.
* @param customEndpoint Custom server url for sending replay data.
* @param imagePrivacyLevel Defines the way images should be masked.
* @param touchPrivacyLevel Defines the way user touches should be masked.
* @param textAndInputPrivacyLevel Defines the way text and input should be masked.
* @param startRecordingImmediately Whether the recording should start immediately when the feature is enabled.
*/
@ReactMethod
override fun enable(
Expand All @@ -37,6 +38,7 @@ class DdSessionReplay(
imagePrivacyLevel: String,
touchPrivacyLevel: String,
textAndInputPrivacyLevel: String,
startRecordingImmediately: Boolean,
promise: Promise
) {
implementation.enable(
Expand All @@ -47,7 +49,16 @@ class DdSessionReplay(
touchPrivacyLevel = touchPrivacyLevel,
textAndInputPrivacyLevel = textAndInputPrivacyLevel
),
startRecordingImmediately,
promise
)
}

override fun startRecording(promise: Promise) {
implementation.startRecording(promise)
}

override fun stopRecording(promise: Promise) {
implementation.stopRecording(promise)
}
}

0 comments on commit 6011682

Please sign in to comment.