From f8a3a2ed427523871d4fc23267e28b246952047f Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Thu, 15 Feb 2024 16:03:22 -0500 Subject: [PATCH 01/13] Initial work to get allow us to get a Binder handle to the UBus. --- .../eclipse/uprotocol/core/UCoreService.java | 5 ++ .../core/ustreamer/UStreamerManager.java | 64 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java diff --git a/service/src/main/java/org/eclipse/uprotocol/core/UCoreService.java b/service/src/main/java/org/eclipse/uprotocol/core/UCoreService.java index 9ad9f59..6a0eb77 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/UCoreService.java +++ b/service/src/main/java/org/eclipse/uprotocol/core/UCoreService.java @@ -39,6 +39,7 @@ import org.eclipse.uprotocol.common.util.log.Formatter; import org.eclipse.uprotocol.common.util.log.Key; import org.eclipse.uprotocol.core.ubus.UBusAdapter; +import org.eclipse.uprotocol.core.ustreamer.UStreamerManager; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -47,6 +48,7 @@ public class UCoreService extends Service { private static final String TAG = Formatter.tag("core", "UCoreService"); private UCore mUCore; private UBusAdapter mUBusAdapter; + private UStreamerManager mUStreamerManager; public UCoreService() { //Nothing to do @@ -59,6 +61,9 @@ public void onCreate() { mUCore = newUCore(this); mUCore.init(); mUCore.startup(); + + mUStreamerManager = new UStreamerManager(this); + mUStreamerManager.connect(); } @VisibleForTesting diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java new file mode 100644 index 0000000..edc51b0 --- /dev/null +++ b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java @@ -0,0 +1,64 @@ +package org.eclipse.uprotocol.core.ustreamer; + +import static android.content.Context.BIND_AUTO_CREATE; +import static java.util.Objects.requireNonNull; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.util.Log; + +import androidx.annotation.NonNull; + + +public class UStreamerManager { + + private static final String TAG = "UStreamerManager"; + + private final Context mContext; + private boolean mServiceBound; + + public static final String ACTION_BIND_UBUS = "uprotocol.action.BIND_UBUS"; + + private final ServiceConnection mServiceConnectionCallback = new ServiceConnection() { + + @Override + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + Log.i(TAG, "inside mServiceConnectionCallback onServiceConnected()"); + } + + @Override + public void onServiceDisconnected(ComponentName componentName) { + + } + + @Override + public void onBindingDied(ComponentName name) { + ServiceConnection.super.onBindingDied(name); + } + + @Override + public void onNullBinding(ComponentName name) { + ServiceConnection.super.onNullBinding(name); + } + }; + + public UStreamerManager(@NonNull Context context) { + mContext = requireNonNull(context); + Log.i(TAG, "inside UStreamerManager constructor"); + } + + public boolean connect() { + Log.i(TAG, "inside UStreamerManager connect()"); + final Intent intent = new Intent(ACTION_BIND_UBUS); + String mServiceConfig = "org.eclipse.uprotocol.core"; + intent.setPackage(mServiceConfig); + Log.d(TAG, "intent: " + intent); + mServiceBound = mContext.bindService(intent, mServiceConnectionCallback, BIND_AUTO_CREATE); + return mServiceBound; + } + + +} From 8774a0f00eccec6b792392f0fd6549bdc6129f5a Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Thu, 15 Feb 2024 17:58:43 -0500 Subject: [PATCH 02/13] Was able to call into Rust using JNI from the Android ServiceConnection =) TODO: Explore Gradle rules from Mozilla for running cargo automatically as a part of build and placing .so in correct location. --- service/build.gradle | 2 +- .../core/ustreamer/UStreamerGlue.java | 14 + .../core/ustreamer/UStreamerManager.java | 3 +- service/src/main/jniLibs/x86_64/.gitkeep | 0 .../src/main/rust/ustreamer-glue/.gitignore | 3 + .../src/main/rust/ustreamer-glue/Cargo.lock | 243 ++++++++++++++++++ .../src/main/rust/ustreamer-glue/Cargo.toml | 10 + .../src/main/rust/ustreamer-glue/src/lib.rs | 37 +++ 8 files changed, 309 insertions(+), 3 deletions(-) create mode 100644 service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java create mode 100644 service/src/main/jniLibs/x86_64/.gitkeep create mode 100644 service/src/main/rust/ustreamer-glue/.gitignore create mode 100644 service/src/main/rust/ustreamer-glue/Cargo.lock create mode 100644 service/src/main/rust/ustreamer-glue/Cargo.toml create mode 100644 service/src/main/rust/ustreamer-glue/src/lib.rs diff --git a/service/build.gradle b/service/build.gradle index 911443c..dae1137 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -78,7 +78,7 @@ android { sourceSets { main { - jniLibs.srcDirs = [] + jniLibs.srcDirs = ["src/main/jniLibs"] } test.assets.srcDirs += files("$projectDir/src/test/".toString()) } diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java new file mode 100644 index 0000000..610b64c --- /dev/null +++ b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java @@ -0,0 +1,14 @@ +package org.eclipse.uprotocol.core.ustreamer; + +public class UStreamerGlue { + // This declares that the static `hello` method will be provided + // a native library. + public static native String hello(String input); + + static { + // This actually loads the shared object that we'll be creating. + // The actual location of the .so or .dll may differ based on your + // platform. + System.loadLibrary("ustreamer_glue"); + } +} diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java index edc51b0..00f01e6 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java +++ b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java @@ -27,6 +27,7 @@ public class UStreamerManager { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { Log.i(TAG, "inside mServiceConnectionCallback onServiceConnected()"); + Log.d(TAG, UStreamerGlue.hello("hello from rust =)")); } @Override @@ -59,6 +60,4 @@ public boolean connect() { mServiceBound = mContext.bindService(intent, mServiceConnectionCallback, BIND_AUTO_CREATE); return mServiceBound; } - - } diff --git a/service/src/main/jniLibs/x86_64/.gitkeep b/service/src/main/jniLibs/x86_64/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/service/src/main/rust/ustreamer-glue/.gitignore b/service/src/main/rust/ustreamer-glue/.gitignore new file mode 100644 index 0000000..198c4ce --- /dev/null +++ b/service/src/main/rust/ustreamer-glue/.gitignore @@ -0,0 +1,3 @@ +/target + +.idea/ diff --git a/service/src/main/rust/ustreamer-glue/Cargo.lock b/service/src/main/rust/ustreamer-glue/Cargo.lock new file mode 100644 index 0000000..d56f562 --- /dev/null +++ b/service/src/main/rust/ustreamer-glue/Cargo.lock @@ -0,0 +1,243 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "ustreamer-glue" +version = "0.1.0" +dependencies = [ + "jni", +] + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" diff --git a/service/src/main/rust/ustreamer-glue/Cargo.toml b/service/src/main/rust/ustreamer-glue/Cargo.toml new file mode 100644 index 0000000..a9eda65 --- /dev/null +++ b/service/src/main/rust/ustreamer-glue/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "ustreamer-glue" +version = "0.1.0" +edition = "2021" + +[lib] +crate_type = ["cdylib"] + +[dependencies] +jni = "0.21.1" \ No newline at end of file diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer-glue/src/lib.rs new file mode 100644 index 0000000..6f0d4f2 --- /dev/null +++ b/service/src/main/rust/ustreamer-glue/src/lib.rs @@ -0,0 +1,37 @@ +// This is the interface to the JVM that we'll call the majority of our +// methods on. +use jni::JNIEnv; + +// These objects are what you should use as arguments to your native +// function. They carry extra lifetime information to prevent them escaping +// this context and getting used after being GC'd. +use jni::objects::{JClass, JString}; + +// This is just a pointer. We'll be returning it from our function. We +// can't return one of the objects with lifetime information because the +// lifetime checker won't let us. +use jni::sys::jstring; + +// This keeps Rust from "mangling" the name and making it unique for this +// crate. +#[no_mangle] +pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_hello<'local>(mut env: JNIEnv<'local>, +// This is the class that owns our static method. It's not going to be used, +// but still must be present to match the expected signature of a static +// native method. + class: JClass<'local>, + input: JString<'local>) + -> jstring { + // First, we have to get the string out of Java. Check out the `strings` + // module for more info on how this works. + let input: String = + env.get_string(&input).expect("Couldn't get java string!").into(); + + // Then we have to create a new Java string to return. Again, more info + // in the `strings` module. + let output = env.new_string(format!("Hello, {}!", input)) + .expect("Couldn't create java string!"); + + // Finally, extract the raw pointer to return. + output.into_raw() +} \ No newline at end of file From 95af824f61d971cad1f3cc25f48d44a43aef10c4 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Fri, 16 Feb 2024 16:47:23 -0500 Subject: [PATCH 03/13] Able to transform Java Binder object into NDK AIBinder object into Rust SpIBinder object into IUBus object. --- .../core/ustreamer/UStreamerGlue.java | 7 +- .../core/ustreamer/UStreamerManager.java | 2 +- .../src/main/rust/ustreamer-glue/Cargo.lock | 1542 ++++++++++++++++- .../src/main/rust/ustreamer-glue/Cargo.toml | 6 +- .../src/main/rust/ustreamer-glue/src/lib.rs | 56 +- 5 files changed, 1557 insertions(+), 56 deletions(-) diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java index 610b64c..2d512ba 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java +++ b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java @@ -1,9 +1,10 @@ package org.eclipse.uprotocol.core.ustreamer; +import android.os.IBinder; + public class UStreamerGlue { - // This declares that the static `hello` method will be provided - // a native library. - public static native String hello(String input); + + public static native String forwardJavaBinder(IBinder binder); static { // This actually loads the shared object that we'll be creating. diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java index 00f01e6..61a0f61 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java +++ b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java @@ -27,7 +27,7 @@ public class UStreamerManager { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { Log.i(TAG, "inside mServiceConnectionCallback onServiceConnected()"); - Log.d(TAG, UStreamerGlue.hello("hello from rust =)")); + Log.d(TAG, UStreamerGlue.forwardJavaBinder(iBinder)); } @Override diff --git a/service/src/main/rust/ustreamer-glue/Cargo.lock b/service/src/main/rust/ustreamer-glue/Cargo.lock index d56f562..20cd625 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.lock +++ b/service/src/main/rust/ustreamer-glue/Cargo.lock @@ -2,93 +2,1159 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "aidl-rust-codegen" +version = "0.1.5-SNAPSHOT" +source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#742810e6c6634fd65eb17c8fbb8f6613ca9dab2c" +dependencies = [ + "anyhow", + "async-trait", + "binder", + "binder_tokio", + "clap", + "lazy_static", + "protobuf", + "tokio", + "uprotocol-sdk", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "async-trait" +version = "0.1.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "binder" +version = "0.2.0" +source = "git+https://github.com/PLeVasseur/binder_rs.git?branch=main#8c9cba4d815061b536f8d91ebd9b5d1f0cb107d3" +dependencies = [ + "binder_ndk_sys", + "downcast-rs", + "libc", +] + +[[package]] +name = "binder_ndk_sys" +version = "0.2.0" +source = "git+https://github.com/PLeVasseur/binder_rs.git?branch=main#8c9cba4d815061b536f8d91ebd9b5d1f0cb107d3" +dependencies = [ + "anyhow", + "bindgen", + "jni", +] + +[[package]] +name = "binder_tokio" +version = "0.2.0" +source = "git+https://github.com/PLeVasseur/binder_rs.git?branch=main#8c9cba4d815061b536f8d91ebd9b5d1f0cb107d3" +dependencies = [ + "binder", + "tokio", + "tokio-runtime", +] + +[[package]] +name = "bindgen" +version = "0.64.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 1.0.109", + "which", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "bumpalo" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" + [[package]] name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + [[package]] name = "cesu8" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.0", +] + +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "cloudevents-sdk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801713078518ab05d7c78508c14cf55173a14a1a6659421d3352c2576a6167bf" +dependencies = [ + "base64 0.12.3", + "bitflags 1.3.2", + "chrono", + "delegate-attr", + "hostname", + "serde", + "serde_json", + "snafu", + "url", + "uuid", + "web-sys", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "combine" version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" dependencies = [ - "bytes", - "memchr", + "bytes", + "memchr", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "delegate-attr" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee7e7ea0dba407429d816e8e38dda1a467cd74737722f2ccc8eae60429a1a3ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libloading" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "mediatype" +version = "0.19.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8878cd8d1b3c8c8ae4b2ba0a36652b7cf192f618a599a7fbdfa25cffd4ea72dd" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "protobuf" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65f4a8ec18723a734e5dc09c173e0abf9690432da5340285d536edcb4dac190" +dependencies = [ + "once_cell", + "protobuf-support", + "thiserror", +] + +[[package]] +name = "protobuf-codegen" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e85514a216b1c73111d9032e26cc7a5ecb1bb3d4d9539e91fb72a4395060f78" +dependencies = [ + "anyhow", + "once_cell", + "protobuf", + "protobuf-parse", + "regex", + "tempfile", + "thiserror", +] + +[[package]] +name = "protobuf-parse" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77d6fbd6697c9e531873e81cec565a85e226b99a0f10e1acc079be057fe2fcba" +dependencies = [ + "anyhow", + "indexmap", + "log", + "protobuf", + "protobuf-support", + "tempfile", + "thiserror", + "which", +] + +[[package]] +name = "protobuf-support" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6872f4d4f4b98303239a2b5838f5bbbb77b01ffc892d627957f37a22d7cfe69c" +dependencies = [ + "thiserror", +] + +[[package]] +name = "protoc-bin-vendored" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "005ca8623e5633e298ad1f917d8be0a44bcf406bf3cde3b80e63003e49a3f27d" +dependencies = [ + "protoc-bin-vendored-linux-aarch_64", + "protoc-bin-vendored-linux-ppcle_64", + "protoc-bin-vendored-linux-x86_32", + "protoc-bin-vendored-linux-x86_64", + "protoc-bin-vendored-macos-x86_64", + "protoc-bin-vendored-win32", +] + +[[package]] +name = "protoc-bin-vendored-linux-aarch_64" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb9fc9cce84c8694b6ea01cc6296617b288b703719b725b8c9c65f7c5874435" + +[[package]] +name = "protoc-bin-vendored-linux-ppcle_64" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d2a07dcf7173a04d49974930ccbfb7fd4d74df30ecfc8762cf2f895a094516" + +[[package]] +name = "protoc-bin-vendored-linux-x86_32" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54fef0b04fcacba64d1d80eed74a20356d96847da8497a59b0a0a436c9165b0" + +[[package]] +name = "protoc-bin-vendored-linux-x86_64" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8782f2ce7d43a9a5c74ea4936f001e9e8442205c244f7a3d4286bd4c37bc924" + +[[package]] +name = "protoc-bin-vendored-macos-x86_64" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5de656c7ee83f08e0ae5b81792ccfdc1d04e7876b1d9a38e6876a9e09e02537" + +[[package]] +name = "protoc-bin-vendored-win32" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9653c3ed92974e34c5a6e0a510864dab979760481714c172e0a34e437cb98804" + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7" + +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] -name = "jni" -version = "0.21.1" +name = "serde_json" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", - "windows-sys", + "itoa", + "ryu", + "serde", ] [[package]] -name = "jni-sys" -version = "0.3.0" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "log" -version = "0.4.20" +name = "signal-hook-registry" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] [[package]] -name = "memchr" -version = "2.7.1" +name = "smallvec" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] -name = "proc-macro2" -version = "1.0.78" +name = "snafu" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "eab12d3c261b2308b0d80c26fffb58d17eba81a4be97890101f416b478c79ca7" dependencies = [ - "unicode-ident", + "doc-comment", + "snafu-derive", ] [[package]] -name = "quote" -version = "1.0.35" +name = "snafu-derive" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" dependencies = [ "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "same-file" -version = "1.0.6" +name = "socket2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ - "winapi-util", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] @@ -102,6 +1168,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tempfile" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "thiserror" version = "1.0.57" @@ -119,22 +1197,164 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", ] +[[package]] +name = "tokio-runtime" +version = "0.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7018ed6b511fcc46d60cae6e86d133b9235da92fc0579d6de63305a995901742" + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "uprotocol-sdk" +version = "0.1.5" +source = "git+https://github.com/PLeVasseur/uprotocol-rust_fork.git?branch=feature/protobuf_id_u32_to_micro_serializer_u16_checks#3d0f30f5b286e81d0239f65a0a224a29f55fd822" +dependencies = [ + "async-trait", + "bytes", + "chrono", + "cloudevents-sdk", + "mediatype", + "protobuf", + "protobuf-codegen", + "protoc-bin-vendored", + "rand", + "regex", + "serde", + "serde_json", + "ureq", + "url", + "uuid", +] + +[[package]] +name = "ureq" +version = "2.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f214ce18d8b2cbe84ed3aa6486ed3f5b285cf8d8fbdbce9f3f767a724adc35" +dependencies = [ + "base64 0.21.7", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "rustls-webpki", + "url", + "webpki-roots", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + [[package]] name = "ustreamer-glue" version = "0.1.0" dependencies = [ + "aidl-rust-codegen", + "binder", + "binder_ndk_sys", + "binder_tokio", "jni", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +dependencies = [ + "getrandom", +] + [[package]] name = "walkdir" version = "2.4.0" @@ -145,6 +1365,97 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" + +[[package]] +name = "web-sys" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -176,13 +1487,40 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -191,13 +1529,43 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -206,38 +1574,128 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/service/src/main/rust/ustreamer-glue/Cargo.toml b/service/src/main/rust/ustreamer-glue/Cargo.toml index a9eda65..ed378f6 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.toml +++ b/service/src/main/rust/ustreamer-glue/Cargo.toml @@ -7,4 +7,8 @@ edition = "2021" crate_type = ["cdylib"] [dependencies] -jni = "0.21.1" \ No newline at end of file +binder = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } +binder_ndk_sys = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } +binder_tokio = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } +jni = "0.21.1" +aidl-rust-codegen = { git = "https://github.com/PLeVasseur/up-client-android-rust.git", branch = "feature/initial_implementation" } diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer-glue/src/lib.rs index 6f0d4f2..73fa4f2 100644 --- a/service/src/main/rust/ustreamer-glue/src/lib.rs +++ b/service/src/main/rust/ustreamer-glue/src/lib.rs @@ -5,31 +5,69 @@ use jni::JNIEnv; // These objects are what you should use as arguments to your native // function. They carry extra lifetime information to prevent them escaping // this context and getting used after being GC'd. -use jni::objects::{JClass, JString}; +use jni::objects::{GlobalRef, JClass, JString}; // This is just a pointer. We'll be returning it from our function. We // can't return one of the objects with lifetime information because the // lifetime checker won't let us. -use jni::sys::jstring; +use jni::sys::{jstring, jobject}; + +use binder_ndk_sys::AIBinder; +use binder::unstable_api::new_spibinder; +use binder::{FromIBinder, Strong}; + +use aidl_rust_codegen::binder_impls::IUBus::IUBus; +use aidl_rust_codegen::binder_impls::IUListener::IUListener; +use aidl_rust_codegen::parcelable_stubs::{ParcelableUEntity, ParcelableUStatus, ParcelableUUri, ParcelableUMessage}; + +struct UStreamerGlue { + +} // This keeps Rust from "mangling" the name and making it unique for this // crate. #[no_mangle] -pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_hello<'local>(mut env: JNIEnv<'local>, +pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_forwardJavaBinder<'local>(mut env: JNIEnv<'local>, // This is the class that owns our static method. It's not going to be used, // but still must be present to match the expected signature of a static // native method. class: JClass<'local>, - input: JString<'local>) + binder: jobject) -> jstring { - // First, we have to get the string out of Java. Check out the `strings` - // module for more info on how this works. - let input: String = - env.get_string(&input).expect("Couldn't get java string!").into(); + + // TODO: Here we'd do the dance of turning a Java Binder object into a strongly typed Rust binder interface + let aibinder = unsafe { binder_ndk_sys::AIBinder_fromJavaBinder(env.get_raw(), binder) }; + let spibinder = unsafe { new_spibinder(aibinder) }; + + let spibinder_success = if spibinder.is_none() { + "failed to get SpIBinder" + } else { + "got SpIBinder" + }; + + let spibinder = spibinder.unwrap(); + + let remote_service = if spibinder.is_remote() { + "remote service" + } else { + "local service" + }; + + let ubus = spibinder.into_interface::(); + + let into_interface_success = if ubus.is_err() { + format!("into_interface to ubus failed: {:?}", &ubus) + } else { + format!("into_interface to ubus succeeded: {:?}", &ubus) + }; + + let empty_string = ""; + let status_strings = vec![empty_string, spibinder_success, remote_service, &into_interface_success]; + let status_string = status_strings.join("\n"); // Then we have to create a new Java string to return. Again, more info // in the `strings` module. - let output = env.new_string(format!("Hello, {}!", input)) + let output = env.new_string(status_string) .expect("Couldn't create java string!"); // Finally, extract the raw pointer to return. From 172ee3a7b88936330e44505dee94514c87d4bbef Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Sat, 17 Feb 2024 00:53:20 -0500 Subject: [PATCH 04/13] Able to call registerClient on an IUBus SpIBinder object from Rust now. Running into limitation that there's a check on package stuff. I guess I just need to add that? --- .../org/eclipse/uprotocol/core/ubus/UBus.java | 3 + .../uprotocol/core/ubus/UBusAdapter.java | 3 + .../core/ubus/client/ClientManager.java | 3 + .../src/main/rust/ustreamer-glue/Cargo.lock | 28 +++++---- .../src/main/rust/ustreamer-glue/Cargo.toml | 4 +- .../src/main/rust/ustreamer-glue/src/lib.rs | 59 +++++++++++++++++-- 6 files changed, 81 insertions(+), 19 deletions(-) diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ubus/UBus.java b/service/src/main/java/org/eclipse/uprotocol/core/ubus/UBus.java index f07eab5..bb07f5c 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/ubus/UBus.java +++ b/service/src/main/java/org/eclipse/uprotocol/core/ubus/UBus.java @@ -197,6 +197,9 @@ protected void clearCache() { public @NonNull UStatus registerClient(@NonNull String packageName, @NonNull UEntity entity, @NonNull IBinder clientToken, @NonNull T listener) { + // TODO: PELE - Remove this logging eventually + Log.d(TAG, "ParcelableUEntity: " + entity); + return mClientManager.registerClient(packageName, entity, clientToken, listener); } diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ubus/UBusAdapter.java b/service/src/main/java/org/eclipse/uprotocol/core/ubus/UBusAdapter.java index b529229..8e093ba 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/ubus/UBusAdapter.java +++ b/service/src/main/java/org/eclipse/uprotocol/core/ubus/UBusAdapter.java @@ -50,6 +50,9 @@ public UBusAdapter(@NonNull UBus uBus) { public ParcelableUStatus registerClient(String packageName, ParcelableUEntity entity, IBinder clientToken, int flags, IUListener listener) { try { + // TODO: PELE - Remove this logging eventually + Log.d("UBusAdapter", "ParcelableUEntity: " + entity); + return new ParcelableUStatus(mUBus.registerClient(packageName, entity.getWrapped(), clientToken, listener)); } catch (Exception e) { return new ParcelableUStatus(toStatus(e)); diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ubus/client/ClientManager.java b/service/src/main/java/org/eclipse/uprotocol/core/ubus/client/ClientManager.java index 8ff6b4c..7ad9747 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/ubus/client/ClientManager.java +++ b/service/src/main/java/org/eclipse/uprotocol/core/ubus/client/ClientManager.java @@ -206,6 +206,9 @@ private static void checkCallerCredentials(int pid, int uid, @NonNull Client cli public @NonNull UStatus registerClient(@NonNull String packageName, @NonNull UEntity entity, @NonNull IBinder clientToken, @NonNull T listener) { try { + // TODO: PELE - Remove this logging eventually + Log.d(TAG, "ParcelableUEntity: " + entity); + checkStringNotEmpty(packageName, "Package name is empty"); checkStringNotEmpty(entity.getName(), "Entity name is empty"); checkArgument(entity.hasVersionMajor(), "Entity version is empty"); diff --git a/service/src/main/rust/ustreamer-glue/Cargo.lock b/service/src/main/rust/ustreamer-glue/Cargo.lock index 20cd625..edd1d9c 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.lock +++ b/service/src/main/rust/ustreamer-glue/Cargo.lock @@ -29,7 +29,7 @@ dependencies = [ [[package]] name = "aidl-rust-codegen" version = "0.1.5-SNAPSHOT" -source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#742810e6c6634fd65eb17c8fbb8f6613ca9dab2c" +source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#044e85cb27995d1dcda1bf29d0b3ae88f7130d7c" dependencies = [ "anyhow", "async-trait", @@ -39,7 +39,7 @@ dependencies = [ "lazy_static", "protobuf", "tokio", - "uprotocol-sdk", + "up-rust", ] [[package]] @@ -119,7 +119,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -318,7 +318,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1062,7 +1062,7 @@ checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1159,9 +1159,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" dependencies = [ "proc-macro2", "quote", @@ -1197,7 +1197,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1242,7 +1242,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1279,9 +1279,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "uprotocol-sdk" +name = "up-rust" version = "0.1.5" -source = "git+https://github.com/PLeVasseur/uprotocol-rust_fork.git?branch=feature/protobuf_id_u32_to_micro_serializer_u16_checks#3d0f30f5b286e81d0239f65a0a224a29f55fd822" +source = "git+https://github.com/eclipse-uprotocol/up-rust?branch=main#cb5deec4581eb6c386941f54e7e33488060fb36a" dependencies = [ "async-trait", "bytes", @@ -1338,6 +1338,8 @@ dependencies = [ "binder_ndk_sys", "binder_tokio", "jni", + "protobuf", + "up-rust", ] [[package]] @@ -1392,7 +1394,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-shared", ] @@ -1414,7 +1416,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/service/src/main/rust/ustreamer-glue/Cargo.toml b/service/src/main/rust/ustreamer-glue/Cargo.toml index ed378f6..b0e54ff 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.toml +++ b/service/src/main/rust/ustreamer-glue/Cargo.toml @@ -7,8 +7,10 @@ edition = "2021" crate_type = ["cdylib"] [dependencies] +aidl-rust-codegen = { git = "https://github.com/PLeVasseur/up-client-android-rust.git", branch = "feature/initial_implementation" } binder = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } binder_ndk_sys = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } binder_tokio = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } jni = "0.21.1" -aidl-rust-codegen = { git = "https://github.com/PLeVasseur/up-client-android-rust.git", branch = "feature/initial_implementation" } +protobuf = { version = "3.3" } +up-rust = { git = "https://github.com/eclipse-uprotocol/up-rust", branch = "main" } \ No newline at end of file diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer-glue/src/lib.rs index 73fa4f2..a145040 100644 --- a/service/src/main/rust/ustreamer-glue/src/lib.rs +++ b/service/src/main/rust/ustreamer-glue/src/lib.rs @@ -14,14 +14,31 @@ use jni::sys::{jstring, jobject}; use binder_ndk_sys::AIBinder; use binder::unstable_api::new_spibinder; -use binder::{FromIBinder, Strong}; +use binder::{BinderFeatures, FromIBinder, Interface, Strong}; +use binder::binder_impl::Binder; use aidl_rust_codegen::binder_impls::IUBus::IUBus; -use aidl_rust_codegen::binder_impls::IUListener::IUListener; -use aidl_rust_codegen::parcelable_stubs::{ParcelableUEntity, ParcelableUStatus, ParcelableUUri, ParcelableUMessage}; +use aidl_rust_codegen::binder_impls::IUListener::{IUListener, BnUListener}; +use aidl_rust_codegen::parcelable_stubs::*; -struct UStreamerGlue { +use up_rust::uprotocol::UEntity; +use protobuf::Message; +use std::any::type_name; + +fn type_of(_: &T) -> &'static str { + type_name::() +} + +pub struct MyIUListener; + +impl Interface for MyIUListener {} + +impl IUListener for MyIUListener { + fn onReceive(&self, event: &ParcelableUMessage) -> binder::Result<()> { + println!("received ParcelableUMessage: {:?}", event); + Ok(()) + } } // This keeps Rust from "mangling" the name and making it unique for this @@ -61,8 +78,40 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f format!("into_interface to ubus succeeded: {:?}", &ubus) }; + let ubus = ubus.unwrap(); + + let type_of_ubus = type_of(&ubus); + + let package_name = "org.eclipse.uprotocol.core.ustreamer"; + let uentity = UEntity { + name: "ustreamer_glue".to_string(), + version_major: Some(1), + ..Default::default() + }; + let my_flags: i32 = 0; + let client_token = Binder::new(()).as_binder(); + let my_iulistener = MyIUListener; + let my_iulistener_binder = BnUListener::new_binder(my_iulistener, BinderFeatures::default()); + + let bytes = uentity.write_to_bytes().unwrap(); + let size = bytes.len() as i32; + + let uentity_size = format!("uentity_size: {}", size); + let uentity_bytes = format!("bytes: {:?}", bytes); + + let ustatus = ubus.registerClient(&package_name, &uentity.into(), &client_token, my_flags, &my_iulistener_binder); + + let ustatus_string = format!("ustatus: {:?}", ustatus); + let empty_string = ""; - let status_strings = vec![empty_string, spibinder_success, remote_service, &into_interface_success]; + let status_strings = vec![empty_string, + spibinder_success, + remote_service, + &into_interface_success, + type_of_ubus, + &uentity_size, + &uentity_bytes, + &ustatus_string]; let status_string = status_strings.join("\n"); // Then we have to create a new Java string to return. Again, more info From eda6f26ee2c2897e68e58d70f015501178d5f0cd Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Sat, 17 Feb 2024 01:04:16 -0500 Subject: [PATCH 05/13] Tried to figure out the entity name and version, but... probably need some advice. --- service/src/main/AndroidManifest.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/service/src/main/AndroidManifest.xml b/service/src/main/AndroidManifest.xml index 3b6fb6e..e34958f 100644 --- a/service/src/main/AndroidManifest.xml +++ b/service/src/main/AndroidManifest.xml @@ -40,5 +40,12 @@ + + + From fc430cfbe08d7662e72226df3e2daff3c02ba5e2 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Sat, 17 Feb 2024 04:41:16 -0500 Subject: [PATCH 06/13] Able to successfully send a registerClient request now =) --- .../src/main/rust/ustreamer-glue/Cargo.lock | 32 ++++++++++++++++++- .../src/main/rust/ustreamer-glue/src/lib.rs | 4 +++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/service/src/main/rust/ustreamer-glue/Cargo.lock b/service/src/main/rust/ustreamer-glue/Cargo.lock index edd1d9c..8e31f12 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.lock +++ b/service/src/main/rust/ustreamer-glue/Cargo.lock @@ -29,14 +29,16 @@ dependencies = [ [[package]] name = "aidl-rust-codegen" version = "0.1.5-SNAPSHOT" -source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#044e85cb27995d1dcda1bf29d0b3ae88f7130d7c" +source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#8cce702c2badc0cc53959a16392ace94781e8bb1" dependencies = [ + "android_logger", "anyhow", "async-trait", "binder", "binder_tokio", "clap", "lazy_static", + "log", "protobuf", "tokio", "up-rust", @@ -48,6 +50,24 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" +[[package]] +name = "android_log-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" + +[[package]] +name = "android_logger" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c494134f746c14dc653a35a4ea5aca24ac368529da5370ecf41fe0341c35772f" +dependencies = [ + "android_log-sys", + "env_logger", + "log", + "once_cell", +] + [[package]] name = "android_system_properties" version = "0.1.5" @@ -406,6 +426,16 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "log", + "regex", +] + [[package]] name = "errno" version = "0.3.8" diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer-glue/src/lib.rs index a145040..72a2d51 100644 --- a/service/src/main/rust/ustreamer-glue/src/lib.rs +++ b/service/src/main/rust/ustreamer-glue/src/lib.rs @@ -88,6 +88,9 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f version_major: Some(1), ..Default::default() }; + + let uentity_computed_size = format!("uentity computed size: {}", uentity.compute_size()); + let my_flags: i32 = 0; let client_token = Binder::new(()).as_binder(); let my_iulistener = MyIUListener; @@ -109,6 +112,7 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f remote_service, &into_interface_success, type_of_ubus, + &uentity_computed_size, &uentity_size, &uentity_bytes, &ustatus_string]; From b1ab6a94f7007359743b61cd13a9ecf36e66d642 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Sat, 17 Feb 2024 16:59:48 -0500 Subject: [PATCH 07/13] Updated to use up-client-android-rust's aidl-code-gen crate to use the impl'ed UnstructuredParcelable. --- service/src/main/rust/ustreamer-glue/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/rust/ustreamer-glue/Cargo.lock b/service/src/main/rust/ustreamer-glue/Cargo.lock index 8e31f12..e456af2 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.lock +++ b/service/src/main/rust/ustreamer-glue/Cargo.lock @@ -29,7 +29,7 @@ dependencies = [ [[package]] name = "aidl-rust-codegen" version = "0.1.5-SNAPSHOT" -source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#8cce702c2badc0cc53959a16392ace94781e8bb1" +source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#b5123cfd01ea935c8fdb6f3bcd17908a1a7e2bf7" dependencies = [ "android_logger", "anyhow", From f84efa94e2dadbab3a0e7d6430773ca0be70ca49 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Sat, 17 Feb 2024 17:35:00 -0500 Subject: [PATCH 08/13] Able to enable dispatching on good uuri and prove it can fail on a bad uuri (lacking a UResource name). --- .../src/main/rust/ustreamer-glue/src/lib.rs | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer-glue/src/lib.rs index 72a2d51..af3b24e 100644 --- a/service/src/main/rust/ustreamer-glue/src/lib.rs +++ b/service/src/main/rust/ustreamer-glue/src/lib.rs @@ -21,7 +21,7 @@ use aidl_rust_codegen::binder_impls::IUBus::IUBus; use aidl_rust_codegen::binder_impls::IUListener::{IUListener, BnUListener}; use aidl_rust_codegen::parcelable_stubs::*; -use up_rust::uprotocol::UEntity; +use up_rust::uprotocol::{UAuthority, UEntity, UResource, UUri}; use protobuf::Message; use std::any::type_name; @@ -102,9 +102,35 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f let uentity_size = format!("uentity_size: {}", size); let uentity_bytes = format!("bytes: {:?}", bytes); - let ustatus = ubus.registerClient(&package_name, &uentity.into(), &client_token, my_flags, &my_iulistener_binder); + let ustatus_registerClient = ubus.registerClient(&package_name, &uentity.into(), &client_token, my_flags, &my_iulistener_binder); - let ustatus_string = format!("ustatus: {:?}", ustatus); + let ustatus_registerClient_string = format!("ustatus_registerClient: {:?}", ustatus_registerClient); + + let good_uuri = UUri { + entity: Some(UEntity { + name: "topic_to_subscribe_to".to_string(), + ..Default::default() + }).into(), + resource: Some(UResource { + name: "resource_i_want".to_string(), + ..Default::default() + }).into(), + ..Default::default() + }; + + let bad_uuri = UUri { + entity: Some(UEntity { + name: "topic_to_subscribe_to".to_string(), + ..Default::default() + }).into(), + ..Default::default() + }; + + let ustatus_enableDispatching_success = ubus.enableDispatching(&good_uuri.into(), my_flags, &client_token); + let ustatus_enableDispatching_success_string = format!("ustatus_enableDispatching_success: {:?}", ustatus_enableDispatching_success); + + let ustatus_enableDispatching_failure = ubus.enableDispatching(&bad_uuri.into(), my_flags, &client_token); + let ustatus_enableDispatching_failure_string = format!("ustatus_enableDispatching_failure: {:?}", ustatus_enableDispatching_failure); let empty_string = ""; let status_strings = vec![empty_string, @@ -115,7 +141,9 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f &uentity_computed_size, &uentity_size, &uentity_bytes, - &ustatus_string]; + &ustatus_registerClient_string, + &ustatus_enableDispatching_success_string, + &ustatus_enableDispatching_failure_string]; let status_string = status_strings.join("\n"); // Then we have to create a new Java string to return. Again, more info From c4566716a15f156df4da58f1be2ba5eb2188a1c6 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Sat, 17 Feb 2024 18:46:15 -0500 Subject: [PATCH 09/13] Tried putting the Strong into a once_cell and then kicking off a loop, but something seems to go wrong. Tests are randomly failing. --- .../src/main/rust/ustreamer-glue/Cargo.lock | 475 +++++++++++++++++- .../src/main/rust/ustreamer-glue/Cargo.toml | 2 + .../src/main/rust/ustreamer-glue/src/lib.rs | 44 +- 3 files changed, 502 insertions(+), 19 deletions(-) diff --git a/service/src/main/rust/ustreamer-glue/Cargo.lock b/service/src/main/rust/ustreamer-glue/Cargo.lock index e456af2..97273be 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.lock +++ b/service/src/main/rust/ustreamer-glue/Cargo.lock @@ -131,6 +131,150 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +dependencies = [ + "concurrent-queue", + "event-listener 5.0.0", + "event-listener-strategy 0.5.0", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +dependencies = [ + "async-lock 3.3.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite 2.2.0", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.2.0", + "async-executor", + "async-io 2.3.1", + "async-lock 3.3.0", + "blocking", + "futures-lite 2.2.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.2.0", + "parking", + "polling 3.4.0", + "rustix 0.38.31", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" + [[package]] name = "async-trait" version = "0.1.77" @@ -142,6 +286,12 @@ dependencies = [ "syn 2.0.49", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -239,6 +389,22 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel 2.2.0", + "async-lock 3.3.0", + "async-task", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.2.0", + "piper", + "tracing", +] + [[package]] name = "bumpalo" version = "3.15.0" @@ -382,6 +548,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -397,6 +572,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + [[package]] name = "delegate-attr" version = "0.2.9" @@ -446,6 +627,63 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +dependencies = [ + "event-listener 5.0.0", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "fastrand" version = "2.0.1" @@ -471,6 +709,55 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "getrandom" version = "0.2.12" @@ -494,6 +781,18 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -575,6 +874,26 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "itoa" version = "1.0.10" @@ -612,6 +931,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -640,6 +968,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -661,6 +995,9 @@ name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "value-bag", +] [[package]] name = "match_cfg" @@ -750,6 +1087,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.12.1" @@ -791,6 +1134,53 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.31", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1010,6 +1400,20 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + [[package]] name = "rustix" version = "0.38.31" @@ -1019,7 +1423,7 @@ dependencies = [ "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] @@ -1121,6 +1525,15 @@ dependencies = [ "libc", ] +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.13.1" @@ -1148,6 +1561,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.5.5" @@ -1205,8 +1628,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", - "fastrand", - "rustix", + "fastrand 2.0.1", + "rustix 0.38.31", "windows-sys 0.52.0", ] @@ -1259,7 +1682,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] @@ -1281,6 +1704,22 @@ version = "0.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7018ed6b511fcc46d60cae6e86d133b9235da92fc0579d6de63305a995901742" +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -1364,10 +1803,12 @@ name = "ustreamer-glue" version = "0.1.0" dependencies = [ "aidl-rust-codegen", + "async-std", "binder", "binder_ndk_sys", "binder_tokio", "jni", + "once_cell", "protobuf", "up-rust", ] @@ -1387,6 +1828,18 @@ dependencies = [ "getrandom", ] +[[package]] +name = "value-bag" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" + +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + [[package]] name = "walkdir" version = "2.4.0" @@ -1428,6 +1881,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.91" @@ -1485,7 +1950,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix", + "rustix 0.38.31", ] [[package]] diff --git a/service/src/main/rust/ustreamer-glue/Cargo.toml b/service/src/main/rust/ustreamer-glue/Cargo.toml index b0e54ff..f1a8989 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.toml +++ b/service/src/main/rust/ustreamer-glue/Cargo.toml @@ -8,9 +8,11 @@ crate_type = ["cdylib"] [dependencies] aidl-rust-codegen = { git = "https://github.com/PLeVasseur/up-client-android-rust.git", branch = "feature/initial_implementation" } +async-std = "1.12.0" binder = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } binder_ndk_sys = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } binder_tokio = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = "main" } jni = "0.21.1" +once_cell = "1.19.0" protobuf = { version = "3.3" } up-rust = { git = "https://github.com/eclipse-uprotocol/up-rust", branch = "main" } \ No newline at end of file diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer-glue/src/lib.rs index af3b24e..51bd599 100644 --- a/service/src/main/rust/ustreamer-glue/src/lib.rs +++ b/service/src/main/rust/ustreamer-glue/src/lib.rs @@ -24,7 +24,12 @@ use aidl_rust_codegen::parcelable_stubs::*; use up_rust::uprotocol::{UAuthority, UEntity, UResource, UUri}; use protobuf::Message; +use once_cell::sync::OnceCell; + use std::any::type_name; +use std::time::Duration; +use async_std::sync::{Arc, Mutex}; +use async_std::task; fn type_of(_: &T) -> &'static str { type_name::() @@ -41,6 +46,8 @@ impl IUListener for MyIUListener { } } +static INSTANCE: OnceCell>> = OnceCell::new(); + // This keeps Rust from "mangling" the name and making it unique for this // crate. #[no_mangle] @@ -70,17 +77,11 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f "local service" }; - let ubus = spibinder.into_interface::(); - - let into_interface_success = if ubus.is_err() { - format!("into_interface to ubus failed: {:?}", &ubus) - } else { - format!("into_interface to ubus succeeded: {:?}", &ubus) - }; + let ubus = Arc::new(spibinder.into_interface::().expect("Unable to obtain strong interface")); - let ubus = ubus.unwrap(); + INSTANCE.set(ubus).unwrap_or_else(|_| panic!("Instance was already set!")); - let type_of_ubus = type_of(&ubus); + let type_of_ubus = type_of(&INSTANCE.get().expect("ubus is not initialized")); let package_name = "org.eclipse.uprotocol.core.ustreamer"; let uentity = UEntity { @@ -102,7 +103,7 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f let uentity_size = format!("uentity_size: {}", size); let uentity_bytes = format!("bytes: {:?}", bytes); - let ustatus_registerClient = ubus.registerClient(&package_name, &uentity.into(), &client_token, my_flags, &my_iulistener_binder); + let ustatus_registerClient = INSTANCE.get().expect("ubus is not initialized").registerClient(&package_name, &uentity.into(), &client_token, my_flags, &my_iulistener_binder); let ustatus_registerClient_string = format!("ustatus_registerClient: {:?}", ustatus_registerClient); @@ -126,24 +127,39 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f ..Default::default() }; - let ustatus_enableDispatching_success = ubus.enableDispatching(&good_uuri.into(), my_flags, &client_token); + let ustatus_enableDispatching_success = INSTANCE.get().expect("ubus is not initialized").enableDispatching(&good_uuri.clone().into(), my_flags, &client_token); let ustatus_enableDispatching_success_string = format!("ustatus_enableDispatching_success: {:?}", ustatus_enableDispatching_success); - let ustatus_enableDispatching_failure = ubus.enableDispatching(&bad_uuri.into(), my_flags, &client_token); + let ustatus_enableDispatching_failure = INSTANCE.get().expect("ubus is not initialized").enableDispatching(&bad_uuri.into(), my_flags, &client_token); let ustatus_enableDispatching_failure_string = format!("ustatus_enableDispatching_failure: {:?}", ustatus_enableDispatching_failure); + let ustatus_disableDispatching_success = INSTANCE.get().expect("ubus is not initialized").disableDispatching(&good_uuri.clone().into(), my_flags, &client_token); + let ustatus_disableDispatching_success_string = format!("ustatus_disableDispatching_success: {:?}", ustatus_disableDispatching_success); + + task::spawn(async move { + loop { + let ustatus_enableDispatchingTask_success = INSTANCE.get().expect("ubus is not initialized").enableDispatching(&good_uuri.clone().into(), my_flags, &client_token); + let ustatus_enableDispatchingTask_success_string = format!("ustatus_enableDispatching_success: {:?}", ustatus_enableDispatching_success); + + let ustatus_disableDispatchingTask_success = INSTANCE.get().expect("ubus is not initialized").disableDispatching(&good_uuri.clone().into(), my_flags, &client_token); + let ustatus_disableDispatchingTask_success_string = format!("ustatus_disableDispatching_success: {:?}", ustatus_disableDispatching_success); + + task::sleep(Duration::from_millis(100)).await; + } + }); + let empty_string = ""; let status_strings = vec![empty_string, spibinder_success, remote_service, - &into_interface_success, type_of_ubus, &uentity_computed_size, &uentity_size, &uentity_bytes, &ustatus_registerClient_string, &ustatus_enableDispatching_success_string, - &ustatus_enableDispatching_failure_string]; + &ustatus_enableDispatching_failure_string, + &ustatus_disableDispatching_success_string]; let status_string = status_strings.join("\n"); // Then we have to create a new Java string to return. Again, more info From 41887360a807fc0086d413c8040c8129ce0c4a42 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Sun, 18 Feb 2024 15:18:15 -0500 Subject: [PATCH 10/13] Added a basic async loop + logging from Java after the call into Rust via JNI to confirm that execution of the Java can continue after we launch an async task. Works! :) --- .../core/ustreamer/UStreamerManager.java | 1 + .../src/main/rust/ustreamer-glue/Cargo.lock | 4 +++- .../src/main/rust/ustreamer-glue/Cargo.toml | 6 ++++- .../src/main/rust/ustreamer-glue/src/lib.rs | 24 +++++++++++++++---- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java index 61a0f61..6f3cdaa 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java +++ b/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerManager.java @@ -58,6 +58,7 @@ public boolean connect() { intent.setPackage(mServiceConfig); Log.d(TAG, "intent: " + intent); mServiceBound = mContext.bindService(intent, mServiceConnectionCallback, BIND_AUTO_CREATE); + Log.i(TAG, "Made it back from calling into Rust!"); return mServiceBound; } } diff --git a/service/src/main/rust/ustreamer-glue/Cargo.lock b/service/src/main/rust/ustreamer-glue/Cargo.lock index 97273be..1bc00a6 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.lock +++ b/service/src/main/rust/ustreamer-glue/Cargo.lock @@ -29,7 +29,7 @@ dependencies = [ [[package]] name = "aidl-rust-codegen" version = "0.1.5-SNAPSHOT" -source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#b5123cfd01ea935c8fdb6f3bcd17908a1a7e2bf7" +source = "git+https://github.com/PLeVasseur/up-client-android-rust.git?branch=feature/initial_implementation#040dd19e5a4f6a24a9be0940cd2dd3f4b9e9f091" dependencies = [ "android_logger", "anyhow", @@ -1803,11 +1803,13 @@ name = "ustreamer-glue" version = "0.1.0" dependencies = [ "aidl-rust-codegen", + "android_logger", "async-std", "binder", "binder_ndk_sys", "binder_tokio", "jni", + "log", "once_cell", "protobuf", "up-rust", diff --git a/service/src/main/rust/ustreamer-glue/Cargo.toml b/service/src/main/rust/ustreamer-glue/Cargo.toml index f1a8989..848b85e 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.toml +++ b/service/src/main/rust/ustreamer-glue/Cargo.toml @@ -15,4 +15,8 @@ binder_tokio = { git = "https://github.com/PLeVasseur/binder_rs.git", branch = " jni = "0.21.1" once_cell = "1.19.0" protobuf = { version = "3.3" } -up-rust = { git = "https://github.com/eclipse-uprotocol/up-rust", branch = "main" } \ No newline at end of file +up-rust = { git = "https://github.com/eclipse-uprotocol/up-rust", branch = "main" } +log = "0.4.20" + +[target.'cfg(target_os = "android")'.dependencies] +android_logger = "0.13" diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer-glue/src/lib.rs index 51bd599..6023955 100644 --- a/service/src/main/rust/ustreamer-glue/src/lib.rs +++ b/service/src/main/rust/ustreamer-glue/src/lib.rs @@ -1,3 +1,10 @@ +#[macro_use] extern crate log; + +extern crate android_logger; + +use log::LevelFilter; +use android_logger::Config; + // This is the interface to the JVM that we'll call the majority of our // methods on. use jni::JNIEnv; @@ -59,6 +66,10 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f binder: jobject) -> jstring { + android_logger::init_once( + Config::default().with_max_level(LevelFilter::Trace), + ); + // TODO: Here we'd do the dance of turning a Java Binder object into a strongly typed Rust binder interface let aibinder = unsafe { binder_ndk_sys::AIBinder_fromJavaBinder(env.get_raw(), binder) }; let spibinder = unsafe { new_spibinder(aibinder) }; @@ -136,15 +147,18 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f let ustatus_disableDispatching_success = INSTANCE.get().expect("ubus is not initialized").disableDispatching(&good_uuri.clone().into(), my_flags, &client_token); let ustatus_disableDispatching_success_string = format!("ustatus_disableDispatching_success: {:?}", ustatus_disableDispatching_success); + let mut sleep_counter: u64 = 0; task::spawn(async move { loop { - let ustatus_enableDispatchingTask_success = INSTANCE.get().expect("ubus is not initialized").enableDispatching(&good_uuri.clone().into(), my_flags, &client_token); - let ustatus_enableDispatchingTask_success_string = format!("ustatus_enableDispatching_success: {:?}", ustatus_enableDispatching_success); - - let ustatus_disableDispatchingTask_success = INSTANCE.get().expect("ubus is not initialized").disableDispatching(&good_uuri.clone().into(), my_flags, &client_token); - let ustatus_disableDispatchingTask_success_string = format!("ustatus_disableDispatching_success: {:?}", ustatus_disableDispatching_success); +// let ustatus_enableDispatchingTask_success = INSTANCE.get().expect("ubus is not initialized").enableDispatching(&good_uuri.clone().into(), my_flags, &client_token); +// let ustatus_enableDispatchingTask_success_string = format!("ustatus_enableDispatching_success: {:?}", ustatus_enableDispatching_success); +// +// let ustatus_disableDispatchingTask_success = INSTANCE.get().expect("ubus is not initialized").disableDispatching(&good_uuri.clone().into(), my_flags, &client_token); +// let ustatus_disableDispatchingTask_success_string = format!("ustatus_disableDispatching_success: {:?}", ustatus_disableDispatching_success); + info!("sleeping for 1 second, sleep_counter: {sleep_counter}"); task::sleep(Duration::from_millis(100)).await; + sleep_counter += 1; } }); From ae091ca3a0d3599a8d9b1f4bd686706155965e5b Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Mon, 19 Feb 2024 00:04:11 -0500 Subject: [PATCH 11/13] Able to now hang onto 1. the original Java Binder object properly through a GlobalRef 2. the strongly typed interface for the trait object of IUBus and 3. keep the spawned thread attached to the JVM. --- .../src/main/rust/ustreamer-glue/src/lib.rs | 69 ++++++++++--------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer-glue/src/lib.rs index 6023955..fba3942 100644 --- a/service/src/main/rust/ustreamer-glue/src/lib.rs +++ b/service/src/main/rust/ustreamer-glue/src/lib.rs @@ -12,7 +12,7 @@ use jni::JNIEnv; // These objects are what you should use as arguments to your native // function. They carry extra lifetime information to prevent them escaping // this context and getting used after being GC'd. -use jni::objects::{GlobalRef, JClass, JString}; +use jni::objects::{GlobalRef, JClass, JObject, JString}; // This is just a pointer. We'll be returning it from our function. We // can't return one of the objects with lifetime information because the @@ -53,7 +53,10 @@ impl IUListener for MyIUListener { } } -static INSTANCE: OnceCell>> = OnceCell::new(); +// Because we can't allow the JVM to GC the Java Binder object, we need to put it in a GlobalRef and keep it around +static JAVA_BINDER_INSTANCE: OnceCell> = OnceCell::new(); +// The IUBus we'll keep around so we can use it async +static IUBUS_INSTANCE: OnceCell>> = OnceCell::new(); // This keeps Rust from "mangling" the name and making it unique for this // crate. @@ -70,7 +73,15 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f Config::default().with_max_level(LevelFilter::Trace), ); - // TODO: Here we'd do the dance of turning a Java Binder object into a strongly typed Rust binder interface + // TODO: Examine this more closely and ensure that if something bad happens in unsafe-land + // we react appropriately. + let binder_object = unsafe { JObject::from_raw(binder) }; + let binder_object_global_ref = env.new_global_ref(binder_object); + + let binder_object_global_ref = binder_object_global_ref.unwrap(); + + JAVA_BINDER_INSTANCE.set(binder_object_global_ref.into()).unwrap_or_else(|_| panic!("Instance was already set!")); + let aibinder = unsafe { binder_ndk_sys::AIBinder_fromJavaBinder(env.get_raw(), binder) }; let spibinder = unsafe { new_spibinder(aibinder) }; @@ -90,9 +101,9 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f let ubus = Arc::new(spibinder.into_interface::().expect("Unable to obtain strong interface")); - INSTANCE.set(ubus).unwrap_or_else(|_| panic!("Instance was already set!")); + IUBUS_INSTANCE.set(ubus).unwrap_or_else(|_| panic!("Instance was already set!")); - let type_of_ubus = type_of(&INSTANCE.get().expect("ubus is not initialized")); + let type_of_ubus = type_of(&IUBUS_INSTANCE.get().expect("ubus is not initialized")); let package_name = "org.eclipse.uprotocol.core.ustreamer"; let uentity = UEntity { @@ -114,7 +125,7 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f let uentity_size = format!("uentity_size: {}", size); let uentity_bytes = format!("bytes: {:?}", bytes); - let ustatus_registerClient = INSTANCE.get().expect("ubus is not initialized").registerClient(&package_name, &uentity.into(), &client_token, my_flags, &my_iulistener_binder); + let ustatus_registerClient = IUBUS_INSTANCE.get().expect("ubus is not initialized").registerClient(&package_name, &uentity.into(), &client_token, my_flags, &my_iulistener_binder); let ustatus_registerClient_string = format!("ustatus_registerClient: {:?}", ustatus_registerClient); @@ -130,34 +141,30 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f ..Default::default() }; - let bad_uuri = UUri { - entity: Some(UEntity { - name: "topic_to_subscribe_to".to_string(), - ..Default::default() - }).into(), - ..Default::default() - }; - - let ustatus_enableDispatching_success = INSTANCE.get().expect("ubus is not initialized").enableDispatching(&good_uuri.clone().into(), my_flags, &client_token); - let ustatus_enableDispatching_success_string = format!("ustatus_enableDispatching_success: {:?}", ustatus_enableDispatching_success); - let ustatus_enableDispatching_failure = INSTANCE.get().expect("ubus is not initialized").enableDispatching(&bad_uuri.into(), my_flags, &client_token); - let ustatus_enableDispatching_failure_string = format!("ustatus_enableDispatching_failure: {:?}", ustatus_enableDispatching_failure); - - let ustatus_disableDispatching_success = INSTANCE.get().expect("ubus is not initialized").disableDispatching(&good_uuri.clone().into(), my_flags, &client_token); - let ustatus_disableDispatching_success_string = format!("ustatus_disableDispatching_success: {:?}", ustatus_disableDispatching_success); + let java_vm = env.get_java_vm(); + if java_vm.is_err() { + panic!("unable to obtain java_vm: {:?}", java_vm); + } + let java_vm = java_vm.unwrap(); let mut sleep_counter: u64 = 0; + let run = 25; task::spawn(async move { + info!("entered newly spawned task"); + let task_local_env = java_vm.attach_current_thread_as_daemon(); + if task_local_env.is_err() { + panic!("unable to attach spawned task to jvm: {:?}", task_local_env); + } loop { -// let ustatus_enableDispatchingTask_success = INSTANCE.get().expect("ubus is not initialized").enableDispatching(&good_uuri.clone().into(), my_flags, &client_token); -// let ustatus_enableDispatchingTask_success_string = format!("ustatus_enableDispatching_success: {:?}", ustatus_enableDispatching_success); -// -// let ustatus_disableDispatchingTask_success = INSTANCE.get().expect("ubus is not initialized").disableDispatching(&good_uuri.clone().into(), my_flags, &client_token); -// let ustatus_disableDispatchingTask_success_string = format!("ustatus_disableDispatching_success: {:?}", ustatus_disableDispatching_success); - - info!("sleeping for 1 second, sleep_counter: {sleep_counter}"); - task::sleep(Duration::from_millis(100)).await; + info!("top of loop"); + let ustatus_enableDispatchingTask_success = IUBUS_INSTANCE.get().expect("ubus is not initialized").enableDispatching(&good_uuri.clone().into(), my_flags, &client_token); + info!("ustatus_enableDispatchingTask: {:?}", ustatus_enableDispatchingTask_success); + let ustatus_disableDispatchingTask_success = IUBUS_INSTANCE.get().expect("ubus is not initialized").disableDispatching(&good_uuri.clone().into(), my_flags, &client_token); + info!("ustatus_disableDispatchingTask: {:?}", ustatus_disableDispatchingTask_success); + + info!("sleeping for 1 second, sleep_counter, run #: {run}, {sleep_counter}"); + std::thread::sleep(Duration::from_secs(1)); sleep_counter += 1; } }); @@ -171,9 +178,7 @@ pub extern "system" fn Java_org_eclipse_uprotocol_core_ustreamer_UStreamerGlue_f &uentity_size, &uentity_bytes, &ustatus_registerClient_string, - &ustatus_enableDispatching_success_string, - &ustatus_enableDispatching_failure_string, - &ustatus_disableDispatching_success_string]; + ]; let status_string = status_strings.join("\n"); // Then we have to create a new Java string to return. Again, more info From c5ab03775d9815c0e40f733fc9268368e52b0388 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Tue, 20 Feb 2024 02:57:30 -0500 Subject: [PATCH 12/13] Figured out a certain way to build or not build with including the native Rust .so. I think actually compiling the Rust .so is kinda tricky to do within Gradle appropriately. No easily available plugins that do everything needed. --- service/build.gradle | 26 ++++++++++++-- .../.gitignore | 0 .../Cargo.lock | 35 ++++++++++--------- .../Cargo.toml | 2 +- .../src/lib.rs | 0 .../java}/UStreamerGlue.java | 2 +- .../withoutUStreamer/java/UStreamerGlue.java | 10 ++++++ 7 files changed, 54 insertions(+), 21 deletions(-) rename service/src/main/rust/{ustreamer-glue => ustreamer_bridge}/.gitignore (100%) rename service/src/main/rust/{ustreamer-glue => ustreamer_bridge}/Cargo.lock (98%) rename service/src/main/rust/{ustreamer-glue => ustreamer_bridge}/Cargo.toml (96%) rename service/src/main/rust/{ustreamer-glue => ustreamer_bridge}/src/lib.rs (100%) rename service/src/main/{java/org/eclipse/uprotocol/core/ustreamer => withUStreamer/java}/UStreamerGlue.java (88%) create mode 100644 service/src/main/withoutUStreamer/java/UStreamerGlue.java diff --git a/service/build.gradle b/service/build.gradle index dae1137..85e7382 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -76,9 +76,31 @@ android { jvmTarget = '17' } + // whether or not to build with the native Rust uStreamer + flavorDimensions = ["ustreamer"] + productFlavors { + withUStreamer { + // Assigns this product flavor to the "version" flavor dimension. + // If you are using only one dimension, this property is optional, + // and the plugin automatically assigns all the module's flavors to + // that dimension. + dimension "ustreamer" + } + withoutUStreamer { + dimension "ustreamer" + } + } + sourceSets { - main { - jniLibs.srcDirs = ["src/main/jniLibs"] + withUStreamer { + java { + srcDirs 'src/main/withUStreamer/java' + } + } + withoutUStreamer { + java { + srcDirs 'src/main/withoutUStreamer/java' + } } test.assets.srcDirs += files("$projectDir/src/test/".toString()) } diff --git a/service/src/main/rust/ustreamer-glue/.gitignore b/service/src/main/rust/ustreamer_bridge/.gitignore similarity index 100% rename from service/src/main/rust/ustreamer-glue/.gitignore rename to service/src/main/rust/ustreamer_bridge/.gitignore diff --git a/service/src/main/rust/ustreamer-glue/Cargo.lock b/service/src/main/rust/ustreamer_bridge/Cargo.lock similarity index 98% rename from service/src/main/rust/ustreamer-glue/Cargo.lock rename to service/src/main/rust/ustreamer_bridge/Cargo.lock index 1bc00a6..7aa083e 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.lock +++ b/service/src/main/rust/ustreamer_bridge/Cargo.lock @@ -79,9 +79,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" dependencies = [ "anstyle", "anstyle-parse", @@ -127,9 +127,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "async-channel" @@ -149,7 +149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 5.0.0", + "event-listener 5.1.0", "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite", @@ -216,7 +216,7 @@ dependencies = [ "futures-io", "futures-lite 2.2.0", "parking", - "polling 3.4.0", + "polling 3.5.0", "rustix 0.38.31", "slab", "tracing", @@ -646,9 +646,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" +checksum = "b7ad6fd685ce13acd6d9541a30f6db6567a7a24c9ffd4ba2955d29e3f22c8b27" dependencies = [ "concurrent-queue", "parking", @@ -671,7 +671,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" dependencies = [ - "event-listener 5.0.0", + "event-listener 5.1.0", "pin-project-lite", ] @@ -1169,9 +1169,9 @@ dependencies = [ [[package]] name = "polling" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" dependencies = [ "cfg-if", "concurrent-queue", @@ -1376,16 +1376,17 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1460,9 +1461,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -1799,7 +1800,7 @@ dependencies = [ ] [[package]] -name = "ustreamer-glue" +name = "ustreamer_bridge" version = "0.1.0" dependencies = [ "aidl-rust-codegen", diff --git a/service/src/main/rust/ustreamer-glue/Cargo.toml b/service/src/main/rust/ustreamer_bridge/Cargo.toml similarity index 96% rename from service/src/main/rust/ustreamer-glue/Cargo.toml rename to service/src/main/rust/ustreamer_bridge/Cargo.toml index 848b85e..51146db 100644 --- a/service/src/main/rust/ustreamer-glue/Cargo.toml +++ b/service/src/main/rust/ustreamer_bridge/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ustreamer-glue" +name = "ustreamer_bridge" version = "0.1.0" edition = "2021" diff --git a/service/src/main/rust/ustreamer-glue/src/lib.rs b/service/src/main/rust/ustreamer_bridge/src/lib.rs similarity index 100% rename from service/src/main/rust/ustreamer-glue/src/lib.rs rename to service/src/main/rust/ustreamer_bridge/src/lib.rs diff --git a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java b/service/src/main/withUStreamer/java/UStreamerGlue.java similarity index 88% rename from service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java rename to service/src/main/withUStreamer/java/UStreamerGlue.java index 2d512ba..8461b7f 100644 --- a/service/src/main/java/org/eclipse/uprotocol/core/ustreamer/UStreamerGlue.java +++ b/service/src/main/withUStreamer/java/UStreamerGlue.java @@ -10,6 +10,6 @@ public class UStreamerGlue { // This actually loads the shared object that we'll be creating. // The actual location of the .so or .dll may differ based on your // platform. - System.loadLibrary("ustreamer_glue"); + System.loadLibrary("ustreamer_bridge"); } } diff --git a/service/src/main/withoutUStreamer/java/UStreamerGlue.java b/service/src/main/withoutUStreamer/java/UStreamerGlue.java new file mode 100644 index 0000000..ebcdfe1 --- /dev/null +++ b/service/src/main/withoutUStreamer/java/UStreamerGlue.java @@ -0,0 +1,10 @@ +package org.eclipse.uprotocol.core.ustreamer; + +import android.os.IBinder; + +public class UStreamerGlue { + + public static String forwardJavaBinder(IBinder binder) { + return "noop"; + } +} \ No newline at end of file From 757c9c35268285237a952ad063ce7465ca95316f Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Wed, 21 Feb 2024 17:40:58 -0500 Subject: [PATCH 13/13] Adding other target architectures to jniLibs. --- service/src/main/jniLibs/aarch64/.gitkeep | 0 service/src/main/jniLibs/armv7/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 service/src/main/jniLibs/aarch64/.gitkeep create mode 100644 service/src/main/jniLibs/armv7/.gitkeep diff --git a/service/src/main/jniLibs/aarch64/.gitkeep b/service/src/main/jniLibs/aarch64/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/service/src/main/jniLibs/armv7/.gitkeep b/service/src/main/jniLibs/armv7/.gitkeep new file mode 100644 index 0000000..e69de29