From c78957631a4c7008b339d4064c69a26d3a593cec Mon Sep 17 00:00:00 2001 From: Brett Chabot Date: Tue, 1 Apr 2025 23:59:55 +0000 Subject: [PATCH] Demo using a kotlin 2.0 feature --- .../test/services/shellexecutor/LocalSocketProtocol.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/shellexecutor/java/androidx/test/services/shellexecutor/LocalSocketProtocol.kt b/services/shellexecutor/java/androidx/test/services/shellexecutor/LocalSocketProtocol.kt index 4949d232d..7fa702159 100644 --- a/services/shellexecutor/java/androidx/test/services/shellexecutor/LocalSocketProtocol.kt +++ b/services/shellexecutor/java/androidx/test/services/shellexecutor/LocalSocketProtocol.kt @@ -52,6 +52,12 @@ object LocalSocketProtocol { env: Map? = null, timeout: Duration, ) { + val myString = "Kotlin is awesome!" + val destinationArray = CharArray(myString.length) + + // Convert the string and store it in the destinationArray: + myString.toCharArray(destinationArray) + val builder = RunCommandRequest.newBuilder().setSecret(secret).addAllArgv(argv) env?.forEach { (k, v) -> builder.putEnvironment(k, v) } if (timeout.isInfinite() || timeout.isNegative() || timeout == Duration.ZERO) {