Revert submission
1512686
Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules&lkgb=
7010703&lkbb=
7011903&fkbb=
7010786, bug b/
174815635
Bug:
174815635
Reverted Changes:
I163111bc8:rusty-gd: move init_flag parsing to rust
I54cffe93d:rusty-gd: compile into libbluetooth
I5207f4df9:rusty-gd: add stack start stubs, define shim libra...
Change-Id: I0cfbe779c4cad43f92cbf0ffb1a4b9ed75205c72
apex {
name: "com.android.bluetooth.updatable",
- enabled: false,
manifest: "apex_manifest.json",
"BluetoothGeneratedDumpsysDataSchema_h",
"BluetoothGeneratedDumpsysBundledSchema_h",
"BluetoothGeneratedPackets_h",
- "libbt_common_bridge_header",
],
shared_libs: [
"libchrome",
],
static_libs: [
"libbluetooth-protos",
- "libbluetooth_rust_interop",
- "libbt_common_ffi",
- "libcxxbridge05",
- ],
-}
-
-cc_library_static {
- name: "libbluetooth_rust_interop",
- generated_headers: ["libbt_common_bridge_header"],
- generated_sources: ["libbt_common_bridge_code"],
- cflags: [
- "-Wno-unused-const-variable",
- ],
- host_supported: true,
- apex_available: [
- "//apex_available:platform",
- "com.android.bluetooth.updatable",
- ],
- static_libs: [
- "libbt_common_ffi",
- ],
+ ]
}
cc_library {
#include "common/strings.h"
#include "os/log.h"
-#include "src/init_flags.rs.h"
namespace bluetooth {
namespace common {
}
void InitFlags::Load(const char** flags) {
- rust::Vec<rust::String> rusted_flags = rust::Vec<rust::String>();
- while (flags != nullptr && *flags != nullptr) {
- rusted_flags.push_back(rust::String(*flags));
- flags++;
- }
- init_flags_load(std::move(rusted_flags));
-
SetAll(false);
while (flags != nullptr && *flags != nullptr) {
std::string flag_element = *flags;
"libtokio",
"libnix",
"liblog_rust",
- "libcxx",
- ],
- target: {
- android: {
- rustlibs: [
- "libandroid_logger",
- ],
- },
- host: {
- rustlibs: [
- "libenv_logger",
- ],
- },
- },
- host_supported: true,
-}
-
-rust_ffi_static {
- name: "libbt_common_ffi",
- stem: "libbt_common",
- crate_name: "bt_common",
- srcs: ["src/lib.rs"],
- edition: "2018",
- rustlibs: [
- "libtokio",
- "libnix",
- "liblog_rust",
- "libcxx",
],
target: {
android: {
"libnix",
"liblog_rust",
"libenv_logger",
- "libcxx",
],
}
-
-genrule {
- name: "libbt_common_bridge_header",
- tools: ["cxxbridge"],
- cmd: "$(location cxxbridge) $(in) --header > $(out)",
- srcs: ["src/init_flags.rs"],
- out: ["src/init_flags.rs.h"],
-}
-
-genrule {
- name: "libbt_common_bridge_code",
- tools: ["cxxbridge"],
- cmd: "$(location cxxbridge) $(in) >> $(out)",
- srcs: ["src/init_flags.rs"],
- out: ["init_flags.cc"],
-}
-
-
+++ /dev/null
-use log::error;
-
-#[cxx::bridge(namespace = bluetooth::common)]
-mod ffi {
- extern "Rust" {
- fn init_flags_load(flags: Vec<String>);
- }
-}
-
-fn init_flags_load(flags: Vec<String>) {
- crate::init_logging();
-
- for flag in flags {
- error!("hello from rust: {}", flag);
- }
-}
#[macro_use]
mod asserts;
-mod init_flags;
-
/// Inits logging for Android
#[cfg(target_os = "android")]
pub fn init_logging() {
"libg722codec",
"libudrv-uipc",
"libbluetooth_gd", // Gabeldorsche
- "libbluetooth_rust_interop",
- "libbt_common_ffi",
- "libcxxbridge05",
],
whole_static_libs: [
"libbt-bta",