Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca4841e4 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Revert "rusty-gd: compile into libbluetooth"

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
parent 34fcbf0d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
apex {
    name: "com.android.bluetooth.updatable",
    enabled: false,

    manifest: "apex_manifest.json",

+1 −22
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ cc_defaults {
        "BluetoothGeneratedDumpsysDataSchema_h",
        "BluetoothGeneratedDumpsysBundledSchema_h",
        "BluetoothGeneratedPackets_h",
        "libbt_common_bridge_header",
    ],
    shared_libs: [
        "libchrome",
@@ -163,27 +162,7 @@ cc_defaults {
    ],
    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 {
+0 −8
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@

#include "common/strings.h"
#include "os/log.h"
#include "src/init_flags.rs.h"

namespace bluetooth {
namespace common {
@@ -52,13 +51,6 @@ bool ParseBoolFlag(const std::vector<std::string>& flag_pair, const std::string&
}

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;
+0 −47
Original line number Diff line number Diff line
@@ -7,34 +7,6 @@ rust_library {
        "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: {
@@ -61,24 +33,5 @@ rust_test_host {
        "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"],
}

+0 −16
Original line number Diff line number Diff line
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);
    }
}
Loading