From 3b16e98efecc780de367010851c37e0699706396 Mon Sep 17 00:00:00 2001 From: Eric Daniels Date: Mon, 8 Apr 2024 17:42:00 -0400 Subject: [PATCH] Pass env vars into rdk (#4) --- .../main/java/com/viam/rdk/fgservice/RDKForegroundService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/viam/rdk/fgservice/RDKForegroundService.kt b/app/src/main/java/com/viam/rdk/fgservice/RDKForegroundService.kt index 8485751..6a1526a 100644 --- a/app/src/main/java/com/viam/rdk/fgservice/RDKForegroundService.kt +++ b/app/src/main/java/com/viam/rdk/fgservice/RDKForegroundService.kt @@ -14,8 +14,8 @@ import android.os.IBinder import android.preference.PreferenceManager import android.util.Log import androidx.compose.runtime.mutableStateOf -import droid.Droid.mainEntry import droid.Droid.droidStopHook +import droid.Droid.mainEntry import java.io.File import java.nio.file.StandardWatchEventKinds import java.util.Timer @@ -102,7 +102,8 @@ class RDKThread() : Thread() { // todo: I think we crash the entire process if the viam.json config fails to parse; be more graceful try { status = RDKStatus.RUNNING - mainEntry(path.toString(), filesDir.toString()) + val osEnv = System.getenv().entries.joinToString(separator = "\n") { "${it.key}=${it.value}" } + mainEntry(path.toString(), filesDir.toString(), osEnv) } catch (e: Exception) { Log.e(TAG, "viam thread caught error $e") } finally {