From 24f43efa352fc272a1a50ab18682c84caf5be519 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Tue, 13 Feb 2024 13:46:07 +0100 Subject: [PATCH] feat: Add `context` to `VisionCameraProxy` (#2545) --- .../com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/android/src/main/java/com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt b/package/android/src/main/java/com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt index db41e55..81bd1af 100644 --- a/package/android/src/main/java/com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt +++ b/package/android/src/main/java/com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt @@ -14,7 +14,7 @@ import com.mrousavy.camera.core.ViewNotFoundError import java.lang.ref.WeakReference @Suppress("KotlinJniMissingFunction") // we use fbjni. -class VisionCameraProxy(context: ReactApplicationContext) { +class VisionCameraProxy(private val reactContext: ReactApplicationContext) { companion object { const val TAG = "VisionCameraProxy" } @@ -24,6 +24,8 @@ class VisionCameraProxy(context: ReactApplicationContext) { private var mHybridData: HybridData private var mContext: WeakReference private var mScheduler: VisionCameraScheduler + val context: ReactApplicationContext + get() = reactContext init { val jsCallInvokerHolder = context.catalystInstance.jsCallInvokerHolder as CallInvokerHolderImpl