summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Henri Chataing <henrichataing@google.com> 2024-09-30 18:45:55 -0700
committer Henri Chataing <henrichataing@google.com> 2024-10-02 18:46:43 +0000
commit1cc68cfda6041a3626c646a525b24f633bb7211d (patch)
tree4544680e9405395095f5fe661862a81a5fbff962
parentb03c7ca973ad801dd6b11ff8a6735b4d37fa33e3 (diff)
Remove the init_flags module
All existing init flags have been migrated to feature flags or removed and the rust module can now be deleted. Bug: 331817295 Test: m com.android.btservices Flag: EXEMPT, dead code removal Change-Id: I38be97fad7f9bd42f432d74e5b8090a08dc4502a
-rw-r--r--Cargo.toml2
-rw-r--r--android/app/Android.bp1
-rw-r--r--android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp33
-rw-r--r--android/app/src/com/android/bluetooth/btservice/AdapterNativeInterface.java3
-rw-r--r--android/app/src/com/android/bluetooth/btservice/AdapterService.java13
-rw-r--r--system/audio/Android.bp2
-rw-r--r--system/audio_hal_interface/Android.bp6
-rw-r--r--system/audio_hal_interface/BUILD.gn1
-rw-r--r--system/audio_hal_interface/fuzzer/Android.bp2
-rw-r--r--system/bta/Android.bp35
-rw-r--r--system/bta/BUILD.gn1
-rw-r--r--system/btcore/Android.bp2
-rw-r--r--system/btcore/BUILD.gn5
-rw-r--r--system/btcore/fuzzer/Android.bp3
-rw-r--r--system/btif/Android.bp19
-rw-r--r--system/btif/BUILD.gn1
-rw-r--r--system/common/Android.bp2
-rw-r--r--system/common/BUILD.gn1
-rw-r--r--system/device/Android.bp5
-rw-r--r--system/device/BUILD.gn2
-rw-r--r--system/device/fuzzer/Android.bp2
-rw-r--r--system/gd/Android.bp19
-rw-r--r--system/gd/BUILD.gn2
-rw-r--r--system/gd/common/Android.bp1
-rw-r--r--system/gd/common/init_flags.h37
-rw-r--r--system/gd/common/init_flags_test.cc19
-rw-r--r--system/gd/os/BUILD.gn2
-rw-r--r--system/gd/packet/BUILD.gn1
-rw-r--r--system/gd/rust/common/Android.bp10
-rw-r--r--system/gd/rust/common/src/init_flags.rs241
-rw-r--r--system/gd/rust/common/src/lib.rs3
-rw-r--r--system/gd/rust/linux/service/Cargo.toml1
-rw-r--r--system/gd/rust/linux/service/src/main.rs4
-rw-r--r--system/gd/rust/linux/stack/Cargo.toml1
-rw-r--r--system/gd/rust/linux/stack/src/bluetooth_admin.rs3
-rw-r--r--system/gd/rust/shim/Android.bp116
-rw-r--r--system/gd/rust/shim/BUILD.gn44
-rw-r--r--system/gd/rust/shim/Cargo.toml30
-rw-r--r--system/gd/rust/shim/src/init_flags.rs28
-rw-r--r--system/gd/rust/shim/src/lib.rs3
-rw-r--r--system/gd/rust/topshim/Android.bp9
-rw-r--r--system/gd/rust/topshim/facade/Android.bp2
-rw-r--r--system/gd/rust/topshim/facade/src/main.rs2
-rw-r--r--system/gd/rust/topshim/src/btif.rs1
-rw-r--r--system/gd/shim/BUILD.gn1
-rw-r--r--system/hci/Android.bp1
-rw-r--r--system/include/hardware/bluetooth.h5
-rw-r--r--system/main/Android.bp8
-rw-r--r--system/main/shim/BUILD.gn4
-rw-r--r--system/osi/Android.bp3
-rw-r--r--system/osi/BUILD.gn1
-rw-r--r--system/profile/avrcp/Android.bp5
-rw-r--r--system/profile/avrcp/BUILD.gn1
-rw-r--r--system/rust/Android.bp10
-rw-r--r--system/rust/BUILD.gn1
-rw-r--r--system/rust/src/lib.rs7
-rw-r--r--system/stack/Android.bp62
-rw-r--r--system/stack/BUILD.gn3
-rw-r--r--system/stack/mmc/codec_server/BUILD.gn1
-rw-r--r--system/stack/test/fuzzers/Android.bp1
-rw-r--r--system/test/Android.bp7
-rw-r--r--system/test/common/init_flags.cc17
-rw-r--r--system/test/headless/Android.bp1
-rw-r--r--system/test/headless/headless.cc2
-rw-r--r--system/test/suite/Android.bp1
-rw-r--r--system/test/suite/adapter/bluetooth_test.cc4
-rwxr-xr-xsystem/test/tool/mockcify.pl2
-rw-r--r--system/udrv/Android.bp1
68 files changed, 45 insertions, 824 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 5ed873e057..d3cee8799b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,7 +16,6 @@
[workspace]
default-members = [
- "system/gd/rust/shim",
"system/gd/rust/topshim",
"system/gd/rust/linux/mgmt",
"system/gd/rust/linux/service",
@@ -26,7 +25,6 @@ default-members = [
]
members = [
- "system/gd/rust/shim",
"system/gd/rust/topshim",
"system/gd/rust/linux/mgmt",
"system/gd/rust/linux/service",
diff --git a/android/app/Android.bp b/android/app/Android.bp
index b80bd4057c..8a883b640f 100644
--- a/android/app/Android.bp
+++ b/android/app/Android.bp
@@ -125,7 +125,6 @@ cc_library_shared {
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
"libbtcore",
"libbtdevice",
"libbte",
diff --git a/android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp b/android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp
index 8036b43681..b4cf5eb326 100644
--- a/android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -1020,8 +1020,7 @@ int hal_util_load_bt_library(const bt_interface_t** interface) {
}
static bool initNative(JNIEnv* env, jobject obj, jboolean isGuest, jboolean isCommonCriteriaMode,
- int configCompareResult, jobjectArray initFlags, jboolean isAtvDevice,
- jstring userDataDirectory) {
+ int configCompareResult, jboolean isAtvDevice, jstring userDataDirectory) {
std::unique_lock<std::shared_timed_mutex> lock(jniObjMutex);
log::verbose("");
@@ -1036,34 +1035,15 @@ static bool initNative(JNIEnv* env, jobject obj, jboolean isGuest, jboolean isCo
return JNI_FALSE;
}
- int flagCount = env->GetArrayLength(initFlags);
- jstring* flagObjs = new jstring[flagCount];
- const char** flags = nullptr;
- if (flagCount > 0) {
- flags = new const char*[flagCount + 1];
- flags[flagCount] = nullptr;
- }
-
- for (int i = 0; i < flagCount; i++) {
- flagObjs[i] = (jstring)env->GetObjectArrayElement(initFlags, i);
- flags[i] = env->GetStringUTFChars(flagObjs[i], NULL);
- }
-
const char* user_data_directory = env->GetStringUTFChars(userDataDirectory, NULL);
- int ret = sBluetoothInterface->init(&sBluetoothCallbacks, isGuest == JNI_TRUE ? 1 : 0,
- isCommonCriteriaMode == JNI_TRUE ? 1 : 0, configCompareResult,
- flags, isAtvDevice == JNI_TRUE ? 1 : 0, user_data_directory);
+ int ret =
+ sBluetoothInterface->init(&sBluetoothCallbacks, isGuest == JNI_TRUE ? 1 : 0,
+ isCommonCriteriaMode == JNI_TRUE ? 1 : 0, configCompareResult,
+ nullptr, isAtvDevice == JNI_TRUE ? 1 : 0, user_data_directory);
env->ReleaseStringUTFChars(userDataDirectory, user_data_directory);
- for (int i = 0; i < flagCount; i++) {
- env->ReleaseStringUTFChars(flagObjs[i], flags[i]);
- }
-
- delete[] flags;
- delete[] flagObjs;
-
if (ret != BT_STATUS_SUCCESS) {
log::error("Error while setting the callbacks: {}", ret);
sBluetoothInterface = NULL;
@@ -2245,8 +2225,7 @@ static jboolean restoreFilterAcceptListNative(JNIEnv* /* env */, jobject /* obj
int register_com_android_bluetooth_btservice_AdapterService(JNIEnv* env) {
const JNINativeMethod methods[] = {
- {"initNative", "(ZZI[Ljava/lang/String;ZLjava/lang/String;)Z",
- reinterpret_cast<void*>(initNative)},
+ {"initNative", "(ZZIZLjava/lang/String;)Z", reinterpret_cast<void*>(initNative)},
{"cleanupNative", "()V", reinterpret_cast<void*>(cleanupNative)},
{"enableNative", "()Z", reinterpret_cast<void*>(enableNative)},
{"disableNative", "()Z", reinterpret_cast<void*>(disableNative)},
diff --git a/android/app/src/com/android/bluetooth/btservice/AdapterNativeInterface.java b/android/app/src/com/android/bluetooth/btservice/AdapterNativeInterface.java
index 28bff10bb7..87cd3536a4 100644
--- a/android/app/src/com/android/bluetooth/btservice/AdapterNativeInterface.java
+++ b/android/app/src/com/android/bluetooth/btservice/AdapterNativeInterface.java
@@ -64,7 +64,6 @@ public class AdapterNativeInterface {
boolean startRestricted,
boolean isCommonCriteriaMode,
int configCompareResult,
- String[] initFlags,
boolean isAtvDevice,
String userDataDirectory) {
mJniCallbacks = new JniCallbacks(service, adapterProperties);
@@ -72,7 +71,6 @@ public class AdapterNativeInterface {
startRestricted,
isCommonCriteriaMode,
configCompareResult,
- initFlags,
isAtvDevice,
userDataDirectory);
}
@@ -297,7 +295,6 @@ public class AdapterNativeInterface {
boolean startRestricted,
boolean isCommonCriteriaMode,
int configCompareResult,
- String[] initFlags,
boolean isAtvDevice,
String userDataDirectory);
diff --git a/android/app/src/com/android/bluetooth/btservice/AdapterService.java b/android/app/src/com/android/bluetooth/btservice/AdapterService.java
index 5acdcd0197..19c8aee207 100644
--- a/android/app/src/com/android/bluetooth/btservice/AdapterService.java
+++ b/android/app/src/com/android/bluetooth/btservice/AdapterService.java
@@ -700,7 +700,6 @@ public class AdapterService extends Service {
mUserManager.isGuestUser(),
isCommonCriteriaMode,
configCompareResult,
- getInitFlags(),
isAtvDevice,
getApplicationInfo().dataDir);
mNativeAvailable = true;
@@ -6441,18 +6440,6 @@ public class AdapterService extends Service {
}
}
- private String[] getInitFlags() {
- final DeviceConfig.Properties properties =
- DeviceConfig.getProperties(DeviceConfig.NAMESPACE_BLUETOOTH);
- ArrayList<String> initFlags = new ArrayList<>();
- for (String property : properties.getKeyset()) {
- if (property.startsWith("INIT_")) {
- initFlags.add(property + "=" + properties.getString(property, null));
- }
- }
- return initFlags.toArray(new String[0]);
- }
-
private final Object mDeviceConfigLock = new Object();
/**
diff --git a/system/audio/Android.bp b/system/audio/Android.bp
index 9165555cf6..d5dde594e1 100644
--- a/system/audio/Android.bp
+++ b/system/audio/Android.bp
@@ -37,7 +37,6 @@ cc_library_static {
"libbase",
"libbluetooth_hci_pdl",
"libbluetooth_log",
- "libbt_shim_bridge",
"libflatbuffers-cpp",
],
host_supported: true,
@@ -77,7 +76,6 @@ cc_library_host_shared {
"libbluetooth_hci_pdl",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
"libchrome",
"libevent",
"libflatbuffers-cpp",
diff --git a/system/audio_hal_interface/Android.bp b/system/audio_hal_interface/Android.bp
index 9704c1589b..6fd0037562 100644
--- a/system/audio_hal_interface/Android.bp
+++ b/system/audio_hal_interface/Android.bp
@@ -31,7 +31,6 @@ cc_library_static {
"bluetooth_flags_c_lib",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
"libosi",
],
target: {
@@ -121,7 +120,6 @@ cc_test {
"libbluetooth_log",
"libbt-audio-hal-interface",
"libbt-common",
- "libbt_shim_bridge",
"libchrome",
],
header_libs: ["libbluetooth_headers"],
@@ -188,7 +186,6 @@ cc_test {
"libbluetooth-types",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
"libchrome",
"libflagtest",
"libfmq",
@@ -238,14 +235,12 @@ cc_defaults {
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
- "libbluetooth_rust_interop",
"libbt-common", // needed for MessageLoopThread
"libbt-jni-thread",
"libbt-sbc-decoder",
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
"libbtcore",
"libbtdevice",
"libbte",
@@ -315,7 +310,6 @@ cc_test {
"libbt-bta",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libchrome",
"libevent",
"libgmock",
diff --git a/system/audio_hal_interface/BUILD.gn b/system/audio_hal_interface/BUILD.gn
index 5e26e14d20..a637d5afd6 100644
--- a/system/audio_hal_interface/BUILD.gn
+++ b/system/audio_hal_interface/BUILD.gn
@@ -27,7 +27,6 @@ static_library("audio_hal_interface") {
"//bt/system/bta/include",
"//bt/system/btif/include",
"//bt/system/stack/include",
- "//bt/system/gd/rust/shim",
]
configs += [
diff --git a/system/audio_hal_interface/fuzzer/Android.bp b/system/audio_hal_interface/fuzzer/Android.bp
index 5b03d9fa3e..e55a9d62ad 100644
--- a/system/audio_hal_interface/fuzzer/Android.bp
+++ b/system/audio_hal_interface/fuzzer/Android.bp
@@ -67,7 +67,6 @@ cc_defaults {
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
- "libbluetooth_rust_interop",
"libbt-audio-hal-interface",
"libbt-bta",
"libbt-bta-core",
@@ -79,7 +78,6 @@ cc_defaults {
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
"libbtcore",
"libbtdevice",
"libbte",
diff --git a/system/bta/Android.bp b/system/bta/Android.bp
index 2a045eb947..3f74fe2294 100644
--- a/system/bta/Android.bp
+++ b/system/bta/Android.bp
@@ -150,7 +150,6 @@ cc_library_static {
"libbt-audio-asrc",
"libbt-bta-core",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libcom.android.sysprop.bluetooth.wrapped",
"liblc3",
],
@@ -218,7 +217,6 @@ cc_library_static {
"libbluetooth_log",
"libbt-audio-hal-interface",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libcom.android.sysprop.bluetooth.wrapped",
"libflatbuffers-cpp",
"server_configurable_flags",
@@ -317,8 +315,6 @@ cc_test {
"libbt-btu-main-thread",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtcore",
"libbtdevice",
"libchrome",
@@ -398,8 +394,6 @@ cc_test {
"libbt-bta-core",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtcore",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
@@ -438,6 +432,7 @@ cc_test {
static_libs: [
"bluetooth_flags_c_lib",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
@@ -447,8 +442,6 @@ cc_test {
"libbt-btu-main-thread",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtcore",
"libchrome",
"libgmock",
@@ -501,8 +494,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtcore",
"libbtdevice",
"libchrome",
@@ -570,8 +561,6 @@ cc_test {
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libcutils",
"libgmock",
@@ -620,8 +609,6 @@ cc_test {
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libgmock",
"libosi",
@@ -682,8 +669,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libgmock",
"server_configurable_flags",
@@ -839,8 +824,6 @@ cc_test {
"libbt-audio-hal-interface",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libflatbuffers-cpp",
@@ -951,8 +934,6 @@ cc_test {
"libbt-audio-asrc",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libflatbuffers-cpp",
@@ -1039,8 +1020,6 @@ cc_test {
"libbt-audio-hal-interface",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libflagtest",
@@ -1134,8 +1113,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libflagtest",
"libflatbuffers-cpp",
@@ -1212,8 +1189,6 @@ cc_test {
"libbt-audio-hal-interface",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libflagtest",
@@ -1282,8 +1257,6 @@ cc_test {
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libgmock",
],
@@ -1350,14 +1323,13 @@ cc_test {
static_libs: [
"bluetooth_flags_c_lib",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_hci_pdl",
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
"libevent",
@@ -1423,14 +1395,13 @@ cc_test {
static_libs: [
"bluetooth_flags_c_lib",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_hci_pdl",
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
"libevent",
diff --git a/system/bta/BUILD.gn b/system/bta/BUILD.gn
index 306aaae1e9..ba89c1cb69 100644
--- a/system/bta/BUILD.gn
+++ b/system/bta/BUILD.gn
@@ -172,7 +172,6 @@ static_library("bta") {
"//bt/system/bta:install_audio_set_scenarios_bfbs",
"//bt/system/bta:install_audio_set_configurations_bfbs",
"//bt/system:libbt-platform-protos-lite",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
]
libs = [
diff --git a/system/btcore/Android.bp b/system/btcore/Android.bp
index 6410de70bc..96da5abf57 100644
--- a/system/btcore/Android.bp
+++ b/system/btcore/Android.bp
@@ -57,7 +57,6 @@ cc_library_static {
},
static_libs: [
"libbluetooth_log",
- "libbt_shim_bridge",
],
}
@@ -71,7 +70,6 @@ cc_library_static {
min_sdk_version: "Tiramisu",
static_libs: [
"libbluetooth_log",
- "libbt_shim_bridge",
],
}
diff --git a/system/btcore/BUILD.gn b/system/btcore/BUILD.gn
index f7b86f2023..76853554cf 100644
--- a/system/btcore/BUILD.gn
+++ b/system/btcore/BUILD.gn
@@ -32,11 +32,6 @@ static_library("btcore") {
"//bt/system:target_defaults",
"//bt/system/log:log_defaults",
]
-
- deps = [
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
- "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
- ]
}
if (use.test) {
diff --git a/system/btcore/fuzzer/Android.bp b/system/btcore/fuzzer/Android.bp
index 746fdb9244..746a3b31b5 100644
--- a/system/btcore/fuzzer/Android.bp
+++ b/system/btcore/fuzzer/Android.bp
@@ -35,10 +35,7 @@ cc_defaults {
"libbluetooth-types",
"libbluetooth_crypto_toolbox",
"libbluetooth_log",
- "libbluetooth_rust_interop",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtcore",
"libchrome",
"libevent",
diff --git a/system/btif/Android.bp b/system/btif/Android.bp
index 9b1bc41295..958c079471 100644
--- a/system/btif/Android.bp
+++ b/system/btif/Android.bp
@@ -60,7 +60,6 @@ cc_library_static {
srcs: ["src/btif_jni_task.cc"],
static_libs: [
"libbluetooth_log",
- "libbt_shim_bridge",
"libosi",
],
shared_libs: [
@@ -163,7 +162,6 @@ cc_library_static {
"libbt-platform-protos-lite",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
"libbtif-core",
"libflatbuffers-cpp",
],
@@ -244,7 +242,6 @@ cc_library_static {
"libbt-jni-thread",
"libbt-platform-protos-lite",
"libbt-stack-core",
- "libbt_shim_bridge",
"libcom.android.sysprop.bluetooth.wrapped",
"libflatbuffers-cpp",
"libstatslog_bt",
@@ -320,7 +317,6 @@ cc_test {
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
"libbtcore",
"libbtdevice",
"libbtif",
@@ -389,8 +385,6 @@ cc_test {
"libbluetooth-types",
"libbluetooth_gd",
"libbluetooth_log",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libosi",
],
@@ -428,8 +422,6 @@ cc_test {
static_libs: [
"libbluetooth-types",
"libbluetooth_log",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libosi",
],
@@ -477,8 +469,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
],
@@ -520,10 +510,9 @@ cc_test {
],
static_libs: [
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_log",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
"libgmock",
@@ -609,6 +598,7 @@ cc_test {
"lib-bt-packets-avrcp",
"lib-bt-packets-base",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
@@ -620,8 +610,6 @@ cc_test {
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libbtif",
"libbtif-core",
@@ -732,6 +720,7 @@ cc_test {
"lib-bt-packets-avrcp",
"lib-bt-packets-base",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_hci_pdl",
@@ -743,8 +732,6 @@ cc_test {
"libbt-platform-protos-lite",
"libbt-sbc-decoder",
"libbt-sbc-encoder",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libbtif",
"libbtif-core",
diff --git a/system/btif/BUILD.gn b/system/btif/BUILD.gn
index 7e4897fe6d..5129a1efb3 100644
--- a/system/btif/BUILD.gn
+++ b/system/btif/BUILD.gn
@@ -113,7 +113,6 @@ static_library("btif") {
"//bt/sysprop:libcom.android.sysprop.bluetooth",
"//bt/system:libbt-platform-protos-lite",
"//bt/system/common",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
"//bt/system/profile/avrcp:profile_avrcp",
"//bt/system/gd:libbluetooth-gdx",
]
diff --git a/system/common/Android.bp b/system/common/Android.bp
index f50de9f23e..3009c77ec0 100644
--- a/system/common/Android.bp
+++ b/system/common/Android.bp
@@ -57,7 +57,6 @@ cc_library_static {
"libbluetooth_crypto_toolbox",
"libbluetooth_log",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
],
}
@@ -107,7 +106,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libchrome",
"libevent",
"libgmock",
diff --git a/system/common/BUILD.gn b/system/common/BUILD.gn
index 52c14aaa0f..8352d2bcc4 100644
--- a/system/common/BUILD.gn
+++ b/system/common/BUILD.gn
@@ -34,7 +34,6 @@ static_library("common") {
deps = [
"//bt/system:libbt-platform-protos-lite",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
]
configs += [
diff --git a/system/device/Android.bp b/system/device/Android.bp
index 21d2344bf3..f4b06790fc 100644
--- a/system/device/Android.bp
+++ b/system/device/Android.bp
@@ -39,7 +39,6 @@ cc_library_static {
"libaconfig_storage_read_api_cc",
"libbluetooth_hci_pdl",
"libbluetooth_log",
- "libbt_shim_bridge",
"libflatbuffers-cpp",
"server_configurable_flags",
],
@@ -66,8 +65,6 @@ cc_test {
"libbluetooth-types",
"libbluetooth_gd",
"libbluetooth_log",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtcore",
"libbtdevice",
"libchrome",
@@ -106,8 +103,6 @@ cc_test {
"libbluetooth-types",
"libbluetooth_log",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtcore",
"libbtdevice",
"libchrome",
diff --git a/system/device/BUILD.gn b/system/device/BUILD.gn
index 08cf229113..12d38b33c4 100644
--- a/system/device/BUILD.gn
+++ b/system/device/BUILD.gn
@@ -34,8 +34,6 @@ static_library("device") {
deps = [
"//bt/flags:bluetooth_flags_c_lib",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
- "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
"//bt/system/pdl:BluetoothGeneratedPackets_h",
]
}
diff --git a/system/device/fuzzer/Android.bp b/system/device/fuzzer/Android.bp
index 64271ae146..0b5e6c1296 100644
--- a/system/device/fuzzer/Android.bp
+++ b/system/device/fuzzer/Android.bp
@@ -49,8 +49,6 @@ cc_fuzz {
"libbluetooth_gd",
"libbluetooth_hci_pdl",
"libbluetooth_log",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtcore",
"libbtdevice",
"libchrome",
diff --git a/system/gd/Android.bp b/system/gd/Android.bp
index 1e4950d41c..d09e184f92 100644
--- a/system/gd/Android.bp
+++ b/system/gd/Android.bp
@@ -178,11 +178,8 @@ cc_defaults {
"libbluetooth-types",
"libbluetooth_crypto_toolbox",
"libbluetooth_log",
- "libbluetooth_rust_interop",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libcom.android.sysprop.bluetooth.wrapped",
"libosi",
"server_configurable_flags",
@@ -192,7 +189,6 @@ cc_defaults {
"packages/modules/Bluetooth/system/stack/include",
"packages/modules/Bluetooth/system/types",
],
- export_static_lib_headers: ["libbluetooth_rust_interop"],
}
cc_library {
@@ -329,11 +325,8 @@ cc_binary {
"libbluetooth_l2cap_pdl",
"libbluetooth_log",
"libbluetooth_ras_pdl",
- "libbluetooth_rust_interop",
"libbluetooth_smp_pdl",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
"libflatbuffers-cpp",
@@ -501,12 +494,9 @@ cc_test {
"libbluetooth_l2cap_pdl",
"libbluetooth_log",
"libbluetooth_ras_pdl",
- "libbluetooth_rust_interop",
"libbluetooth_smp_pdl",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
"libflagtest",
@@ -569,8 +559,6 @@ cc_test {
"libbt-btu-main-thread",
"libbt-common",
"libbt-jni-thread",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libflatbuffers-cpp",
@@ -611,9 +599,6 @@ cc_test {
static_libs: [
"libbase",
"libbluetooth_log",
- "libbluetooth_rust_interop",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"liblog",
],
target: {
@@ -649,10 +634,7 @@ cc_defaults {
"libbluetooth_crypto_toolbox",
"libbluetooth_gd_fuzzing",
"libbluetooth_log",
- "libbluetooth_rust_interop",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
"libgmock",
@@ -746,7 +728,6 @@ cc_benchmark {
"libbase",
"libbluetooth_gd",
"libbluetooth_log",
- "libbt_shim_bridge",
"libchrome",
"liblog",
"server_configurable_flags",
diff --git a/system/gd/BUILD.gn b/system/gd/BUILD.gn
index 914ec30257..4e14df9a25 100644
--- a/system/gd/BUILD.gn
+++ b/system/gd/BUILD.gn
@@ -50,7 +50,6 @@ group("gd_default_deps") {
"//bt/system:libbt-platform-protos-lite",
"//bt/system/gd:BluetoothGeneratedDumpsysDataSchema_h",
"//bt/system/gd/dumpsys:libbluetooth-dumpsys",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
"//bt/system/pdl:BluetoothGeneratedPackets_h",
]
}
@@ -77,7 +76,6 @@ static_library("libbluetooth_gd") {
configs += [ ":gd_defaults" ]
deps = [
"//bt/system/gd/rust/topshim:libbluetooth_topshim",
- "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
"//bt/system/gd/common:BluetoothCommonSources",
"//bt/system/gd/dumpsys:BluetoothDumpsysSources",
"//bt/system/gd/hal:BluetoothHalSources",
diff --git a/system/gd/common/Android.bp b/system/gd/common/Android.bp
index 36da276e45..5e8b927058 100644
--- a/system/gd/common/Android.bp
+++ b/system/gd/common/Android.bp
@@ -24,7 +24,6 @@ filegroup {
"blocking_queue_unittest.cc",
"byte_array_test.cc",
"circular_buffer_test.cc",
- "init_flags_test.cc",
"list_map_test.cc",
"lru_cache_test.cc",
"metric_id_manager_unittest.cc",
diff --git a/system/gd/common/init_flags.h b/system/gd/common/init_flags.h
deleted file mode 100644
index de3d56103f..0000000000
--- a/system/gd/common/init_flags.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "src/init_flags.rs.h"
-
-namespace bluetooth {
-namespace common {
-
-class InitFlags final {
-public:
- inline static void 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));
- }
-};
-
-} // namespace common
-} // namespace bluetooth
diff --git a/system/gd/common/init_flags_test.cc b/system/gd/common/init_flags_test.cc
deleted file mode 100644
index 98a1779989..0000000000
--- a/system/gd/common/init_flags_test.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-/******************************************************************************
- *
- * Copyright 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-#include <gtest/gtest.h> \ No newline at end of file
diff --git a/system/gd/os/BUILD.gn b/system/gd/os/BUILD.gn
index e56c6883dd..6824184ad0 100644
--- a/system/gd/os/BUILD.gn
+++ b/system/gd/os/BUILD.gn
@@ -27,7 +27,6 @@ source_set("BluetoothOsSources_chromeos") {
]
deps = [
"//bt/system:libbt-platform-protos-lite",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
]
}
@@ -46,7 +45,6 @@ source_set("BluetoothOsSources_linux") {
]
deps = [
"//bt/system:libbt-platform-protos-lite",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
]
}
diff --git a/system/gd/packet/BUILD.gn b/system/gd/packet/BUILD.gn
index 871209a43b..2dbe5b1f98 100644
--- a/system/gd/packet/BUILD.gn
+++ b/system/gd/packet/BUILD.gn
@@ -28,7 +28,6 @@ source_set("BluetoothPacketSources") {
include_dirs = [ "//bt/system/gd" ]
- deps = [ "//bt/system/gd/rust/shim:init_flags_bridge_header" ]
configs += [
"//bt/system:target_defaults",
"//bt/system/log:log_defaults",
diff --git a/system/gd/rust/common/Android.bp b/system/gd/rust/common/Android.bp
index 188225ecf2..a1e8c4a977 100644
--- a/system/gd/rust/common/Android.bp
+++ b/system/gd/rust/common/Android.bp
@@ -7,6 +7,16 @@ package {
default_applicable_licenses: ["system_bt_license"],
}
+rust_defaults {
+ name: "gd_rust_defaults",
+ target: {
+ darwin: {
+ enabled: false,
+ },
+ },
+ host_supported: true,
+}
+
rust_library {
name: "libbt_common",
defaults: ["libbt_common_defaults"],
diff --git a/system/gd/rust/common/src/init_flags.rs b/system/gd/rust/common/src/init_flags.rs
deleted file mode 100644
index feb0ed96a9..0000000000
--- a/system/gd/rust/common/src/init_flags.rs
+++ /dev/null
@@ -1,241 +0,0 @@
-use log::{error, info};
-use paste::paste;
-use std::collections::{BTreeMap, HashMap};
-use std::fmt;
-use std::sync::LazyLock;
-use std::sync::Mutex;
-
-// Fallback to bool when type is not specified
-macro_rules! type_expand {
- () => {
- bool
- };
- ($type:ty) => {
- $type
- };
-}
-
-macro_rules! default_value {
- () => {
- false
- };
- ($type:ty) => {
- <$type>::default()
- };
- ($($type:ty)? = $default:tt) => {
- $default
- };
-}
-
-#[cfg(test)]
-macro_rules! call_getter_fn {
- ($flag:ident) => {
- paste! {
- [<$flag _is_enabled>]()
- }
- };
-}
-
-macro_rules! create_getter_fn {
- ($flag:ident) => {
- paste! {
- #[doc = concat!(" Return true if ", stringify!($flag), " is enabled")]
- pub fn [<$flag _is_enabled>]() -> bool {
- FLAGS.lock().unwrap().$flag
- }
- }
- };
-}
-
-macro_rules! init_flags {
- (
- name: $name:ident
- $($args:tt)*
- ) => {
- init_flags_struct! {
- name: $name
- $($args)*
- }
-
- init_flags_getters! {
- $($args)*
- }
- }
-}
-
-trait FlagHolder: Default {
- fn get_defaults_for_test() -> Self;
- fn parse(flags: Vec<String>) -> Self;
- fn dump(&self) -> BTreeMap<&'static str, String>;
-}
-
-macro_rules! init_flags_struct {
- (
- name: $name:ident
- flags: { $($flag:ident $(: $type:ty)? $(= $default:tt)?,)* }) => {
-
- struct $name {
- $($flag : type_expand!($($type)?),)*
- }
-
- impl $name {
- pub const fn new() -> Self {
- Self {
- $($flag : default_value!($($type)? $(= $default)?),)*
- }
- }
- }
-
- impl Default for $name {
- fn default() -> Self {
- Self::new()
- }
- }
-
- impl FlagHolder for $name {
- fn get_defaults_for_test() -> Self {
- Self {
- $($flag: true,)*
- }
- }
-
- fn dump(&self) -> BTreeMap<&'static str, String> {
- [
- $((stringify!($flag), format!("{}", self.$flag)),)*
- ].into()
- }
-
- fn parse(flags: Vec<String>) -> Self {
- let mut init_flags = Self::default();
-
- for flag in flags {
- let values: Vec<&str> = flag.split("=").collect();
- if values.len() != 2 {
- error!("Bad flag {}, must be in <FLAG>=<VALUE> format", flag);
- continue;
- }
-
- match values[0] {
- $(concat!("INIT_", stringify!($flag)) =>
- init_flags.$flag = values[1].parse().unwrap_or_else(|e| {
- error!("Parse failure on '{}': {}", flag, e);
- default_value!($($type)? $(= $default)?)}),)*
- _ => error!("Unsaved flag: {} = {}", values[0], values[1])
- }
- }
-
- init_flags
- }
- }
-
- impl fmt::Display for $name {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f,
- concat!($(concat!(stringify!($flag), "={}")),*),
- $(self.$flag),*)
- }
- }
-
- }
-}
-
-macro_rules! init_flags_getters {
- (flags: { $($flag:ident $(: $type:ty)? $(= $default:tt)?,)* }) => {
-
- $(create_getter_fn!($flag $($type)?);)*
-
- #[cfg(test)]
- mod tests_autogenerated {
- use super::*;
- $(paste! {
- #[test]
- pub fn [<test_get_ $flag>]() {
- let _guard = tests::ASYNC_LOCK.lock().unwrap();
- tests::test_load(vec![
- &*format!(concat!(concat!("INIT_", stringify!($flag)), "={}"), true)
- ]);
- let get_value = call_getter_fn!($flag);
- drop(_guard); // Prevent poisonning other tests if a panic occurs
- assert_eq!(get_value, true);
- }
- })*
- }
- }
-}
-
-#[allow(dead_code)]
-#[derive(Default)]
-struct ExplicitTagSettings {
- map: HashMap<String, i32>,
-}
-
-impl fmt::Display for ExplicitTagSettings {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{:?}", self.map)
- }
-}
-
-/// Sets all bool flags to true
-/// Set all other flags and extra fields to their default type value
-pub fn set_all_for_testing() {
- *FLAGS.lock().unwrap() = InitFlags::get_defaults_for_test();
-}
-
-init_flags!(
- name: InitFlags
- flags: {
- use_unified_connection_manager,
- }
-);
-
-/// Store some flag values
-static FLAGS: Mutex<InitFlags> = Mutex::new(InitFlags::new());
-/// Store the uid of bluetooth
-pub static AID_BLUETOOTH: Mutex<u32> = Mutex::new(1002);
-/// Store the prefix for file system
-pub static MISC: LazyLock<Mutex<String>> = LazyLock::new(|| Mutex::new("/data/misc/".to_string()));
-
-/// Loads the flag values from the passed-in vector of string values
-pub fn load(raw_flags: Vec<String>) {
- crate::init_logging();
-
- let flags = InitFlags::parse(raw_flags);
- info!("Flags loaded: {}", flags);
- *FLAGS.lock().unwrap() = flags;
-}
-
-/// Dumps all flag K-V pairs, storing values as strings
-pub fn dump() -> BTreeMap<&'static str, String> {
- FLAGS.lock().unwrap().dump()
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- /// do not run concurrent tests as they all use the same global init_flag struct and
- /// accessor
- pub(super) static ASYNC_LOCK: Mutex<bool> = Mutex::new(false);
-
- pub(super) fn test_load(raw_flags: Vec<&str>) {
- let raw_flags = raw_flags.into_iter().map(|x| x.to_string()).collect();
- load(raw_flags);
- }
-
- init_flags_struct!(
- name: InitFlagsForTest
- flags: {
- cat,
- }
- );
-
- #[test]
- fn test_dumpsys() {
- let flags = InitFlagsForTest { ..Default::default() };
-
- let out = flags.dump();
-
- assert_eq!(out.len(), 1);
- assert_eq!(out["cat"], "false");
- }
-}
diff --git a/system/gd/rust/common/src/lib.rs b/system/gd/rust/common/src/lib.rs
index c4001f575a..165aaa5063 100644
--- a/system/gd/rust/common/src/lib.rs
+++ b/system/gd/rust/common/src/lib.rs
@@ -1,7 +1,4 @@
//! Bluetooth common library
-/// Provides runtime configured-at-startup flags
-pub mod init_flags;
-
mod logging;
pub use logging::*;
diff --git a/system/gd/rust/linux/service/Cargo.toml b/system/gd/rust/linux/service/Cargo.toml
index 69049107b9..2ff5c1dbea 100644
--- a/system/gd/rust/linux/service/Cargo.toml
+++ b/system/gd/rust/linux/service/Cargo.toml
@@ -6,7 +6,6 @@ build = "build.rs"
[dependencies]
bt_topshim = { path = "../../topshim" }
-bt_shim = { path = "../../shim" }
btstack = { path = "../stack" }
clap = "2.33.3"
dbus_projection = { path = "../dbus_projection" }
diff --git a/system/gd/rust/linux/service/src/main.rs b/system/gd/rust/linux/service/src/main.rs
index df781794a1..f326bb62ee 100644
--- a/system/gd/rust/linux/service/src/main.rs
+++ b/system/gd/rust/linux/service/src/main.rs
@@ -9,10 +9,6 @@ use std::time::Duration;
use tokio::runtime::Builder;
use tokio::sync::mpsc::Sender;
-// Necessary to link right entries.
-#[allow(clippy::single_component_path_imports, unused_imports)]
-use bt_shim;
-
use bt_topshim::{btif::get_btinterface, topstack};
use btstack::{
battery_manager::BatteryManager,
diff --git a/system/gd/rust/linux/stack/Cargo.toml b/system/gd/rust/linux/stack/Cargo.toml
index 2562617b3d..da42d9face 100644
--- a/system/gd/rust/linux/stack/Cargo.toml
+++ b/system/gd/rust/linux/stack/Cargo.toml
@@ -6,7 +6,6 @@ edition = "2018"
[dependencies]
bt_common = { path = "../../common" }
bt_topshim = { path = "../../topshim" }
-bt_shim = { path = "../../shim" }
bt_utils = { path = "../utils" }
btif_macros = { path = "btif_macros" }
diff --git a/system/gd/rust/linux/stack/src/bluetooth_admin.rs b/system/gd/rust/linux/stack/src/bluetooth_admin.rs
index 5a8e2386fd..ce34bc45a4 100644
--- a/system/gd/rust/linux/stack/src/bluetooth_admin.rs
+++ b/system/gd/rust/linux/stack/src/bluetooth_admin.rs
@@ -423,10 +423,7 @@ mod tests {
use crate::bluetooth_admin::{BluetoothAdmin, BluetoothAdminPolicyHelper};
use bt_topshim::btif::Uuid;
- // A workaround needed for linking. For more details, check the comment in
- // system/gd/rust/topshim/facade/src/main.rs
#[allow(unused)]
- use bt_shim::*;
use serde_json::{json, Value};
#[test]
diff --git a/system/gd/rust/shim/Android.bp b/system/gd/rust/shim/Android.bp
deleted file mode 100644
index 295f766ad2..0000000000
--- a/system/gd/rust/shim/Android.bp
+++ /dev/null
@@ -1,116 +0,0 @@
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "system_bt_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["system_bt_license"],
-}
-
-rust_defaults {
- name: "gd_rust_defaults",
- target: {
- darwin: {
- enabled: false,
- },
- },
- host_supported: true,
-}
-
-cc_defaults {
- name: "gd_ffi_defaults",
- target: {
- darwin: {
- enabled: false,
- },
- },
-}
-
-rust_defaults {
- name: "libbt_shim_defaults",
- defaults: ["gd_rust_defaults"],
- crate_name: "bt_shim",
- srcs: ["src/lib.rs"],
- rustlibs: [
- "libbt_common",
- "libcxx",
- ],
- proc_macros: [
- "libpaste",
- ],
- apex_available: [
- "com.android.btservices",
- ],
- min_sdk_version: "30",
-}
-
-rust_library_rlib {
- name: "libbt_shim",
- defaults: ["libbt_shim_defaults"],
-}
-
-rust_ffi_static {
- name: "libbt_shim_ffi",
- defaults: ["libbt_shim_defaults"],
-}
-
-cc_library_static {
- name: "libbt_shim_bridge",
- defaults: [
- "gd_ffi_defaults",
- ],
- generated_headers: [
- "cxx-bridge-header",
- "libbt_init_flags_bridge_header",
- ],
- generated_sources: [
- "libbt_init_flags_bridge_code",
- ],
- export_generated_headers: [
- "cxx-bridge-header",
- "libbt_init_flags_bridge_header",
- ],
- include_dirs: [
- "packages/modules/Bluetooth/system/gd",
- ],
- cflags: [
- "-Wno-unused-const-variable",
- ],
- host_supported: true,
- apex_available: [
- "com.android.btservices",
- ],
- min_sdk_version: "30",
-}
-
-cc_library_static {
- name: "libbluetooth_rust_interop",
- defaults: [
- "gd_ffi_defaults",
- ],
- static_libs: [
- "libbt_shim_bridge",
- "libbt_shim_ffi",
- ],
- host_supported: true,
- apex_available: [
- "com.android.btservices",
- ],
- min_sdk_version: "30",
-}
-
-genrule {
- name: "libbt_init_flags_bridge_header",
- tools: ["cxxbridge"],
- cmd: "$(location cxxbridge) $(in) --header > $(out)",
- srcs: ["src/init_flags.rs"],
- out: ["src/init_flags.rs.h"],
-}
-
-genrule {
- name: "libbt_init_flags_bridge_code",
- tools: ["cxxbridge"],
- cmd: "$(location cxxbridge) $(in) >> $(out)",
- srcs: ["src/init_flags.rs"],
- out: ["init_flags.cc"],
-}
diff --git a/system/gd/rust/shim/BUILD.gn b/system/gd/rust/shim/BUILD.gn
deleted file mode 100644
index 363c63958c..0000000000
--- a/system/gd/rust/shim/BUILD.gn
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright 2020 Google
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import("//common-mk/cxxbridge.gni")
-
-config("rust_shim_config") {
- include_dirs = [ "//bt/system/gd/rust/shim" ]
-}
-
-cxxbridge_header("init_flags_bridge_header") {
- sources = [ "src/init_flags.rs" ]
- all_dependent_configs = [ ":rust_shim_config" ]
- deps = [ ":cxxlibheader" ]
-}
-
-cxxbridge_cc("init_flags_bridge_code") {
- sources = [ "src/init_flags.rs" ]
- deps = [ ":init_flags_bridge_header" ]
- configs = [ "//bt/system/gd:gd_defaults" ]
-}
-
-cxxbridge_libheader("cxxlibheader") {
- deps = []
-}
-
-static_library("libbluetooth_rust_interop") {
- deps = [
- ":cxxlibheader",
- ":init_flags_bridge_code",
- ]
-}
diff --git a/system/gd/rust/shim/Cargo.toml b/system/gd/rust/shim/Cargo.toml
deleted file mode 100644
index 4731d79811..0000000000
--- a/system/gd/rust/shim/Cargo.toml
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2021 Google, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-[package]
-name = "bt_shim"
-version = "0.0.1"
-edition = "2018"
-
-[dependencies]
-# BT dependencies
-bt_common = { path = "../common" }
-
-# All external dependencies. Keep all versions at build/rust/Cargo.toml
-cxx = { version = "1.0.42", features = ["c++17"] }
-env_logger = "0.8"
-
-[lib]
-path = "src/lib.rs"
diff --git a/system/gd/rust/shim/src/init_flags.rs b/system/gd/rust/shim/src/init_flags.rs
deleted file mode 100644
index a4819bd096..0000000000
--- a/system/gd/rust/shim/src/init_flags.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-#[cxx::bridge(namespace = bluetooth::common::init_flags)]
-#[allow(unsafe_op_in_unsafe_fn)]
-mod ffi {
- struct InitFlagWithValue {
- flag: &'static str,
- value: String,
- }
-
- extern "Rust" {
- fn load(flags: Vec<String>);
- fn set_all_for_testing();
-
- fn dump() -> Vec<InitFlagWithValue>;
-
- fn use_unified_connection_manager_is_enabled() -> bool;
- }
-}
-
-use crate::init_flags::ffi::InitFlagWithValue;
-
-fn dump() -> Vec<InitFlagWithValue> {
- bt_common::init_flags::dump()
- .into_iter()
- .map(|(flag, value)| InitFlagWithValue { flag, value })
- .collect()
-}
-
-use bt_common::init_flags::*;
diff --git a/system/gd/rust/shim/src/lib.rs b/system/gd/rust/shim/src/lib.rs
deleted file mode 100644
index 4a3910a123..0000000000
--- a/system/gd/rust/shim/src/lib.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-//! The main entry point for the legacy C++ code
-
-mod init_flags;
diff --git a/system/gd/rust/topshim/Android.bp b/system/gd/rust/topshim/Android.bp
index 1ce5215441..af5ed8cb5b 100644
--- a/system/gd/rust/topshim/Android.bp
+++ b/system/gd/rust/topshim/Android.bp
@@ -39,9 +39,6 @@ rust_library_host_rlib {
cc_library_static {
name: "libbt_topshim_cxx",
- defaults: [
- "gd_ffi_defaults",
- ],
srcs: [
"btav/btav_shim.cc",
"btav_sink/btav_sink_shim.cc",
@@ -57,7 +54,6 @@ cc_library_static {
generated_headers: [
"BluetoothGeneratedDumpsysDataSchema_h",
"cxx-bridge-header",
- "libbt_init_flags_bridge_header",
"libbt_topshim_bridge_header",
],
generated_sources: ["libbt_topshim_bridge_code"],
@@ -75,6 +71,11 @@ cc_library_static {
"libchrome",
"libflatbuffers-cpp",
],
+ target: {
+ darwin: {
+ enabled: false,
+ },
+ },
}
gensrcs {
diff --git a/system/gd/rust/topshim/facade/Android.bp b/system/gd/rust/topshim/facade/Android.bp
index 8e31ae7201..cfecd4465b 100644
--- a/system/gd/rust/topshim/facade/Android.bp
+++ b/system/gd/rust/topshim/facade/Android.bp
@@ -21,7 +21,6 @@ rust_defaults {
rustlibs: [
"libbluetooth_core_rs_for_facade",
"libbt_common",
- "libbt_shim",
"libbt_topshim",
"libbt_topshim_facade_protobuf",
"libclap",
@@ -56,7 +55,6 @@ rust_defaults {
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
"libbt_topshim_cxx",
"libbtcore",
"libbtdevice",
diff --git a/system/gd/rust/topshim/facade/src/main.rs b/system/gd/rust/topshim/facade/src/main.rs
index 65ac4c72a1..a8a9745752 100644
--- a/system/gd/rust/topshim/facade/src/main.rs
+++ b/system/gd/rust/topshim/facade/src/main.rs
@@ -31,8 +31,6 @@ mod utils;
// This is fine for now since bt_shim doesn't export anything
#[allow(unused)]
use bluetooth_core_rs_for_facade::*;
-#[allow(unused)]
-use bt_shim::*;
fn main() {
// SAFETY: There is no signal handler installed before this.
diff --git a/system/gd/rust/topshim/src/btif.rs b/system/gd/rust/topshim/src/btif.rs
index b5df64fb7e..5a6d76b770 100644
--- a/system/gd/rust/topshim/src/btif.rs
+++ b/system/gd/rust/topshim/src/btif.rs
@@ -1215,7 +1215,6 @@ impl BluetoothInterface {
/// # Arguments
///
/// * `callbacks` - Dispatcher struct that accepts [`BaseCallbacks`]
- /// * `init_flags` - List of flags sent to libbluetooth for init.
/// * `hci_index` - Index of the hci adapter in use
pub fn initialize(&mut self, callbacks: BaseCallbacksDispatcher, hci_index: i32) -> bool {
if get_dispatchers().lock().unwrap().set::<BaseCb>(Arc::new(Mutex::new(callbacks))) {
diff --git a/system/gd/shim/BUILD.gn b/system/gd/shim/BUILD.gn
index addc752715..2747594cf4 100644
--- a/system/gd/shim/BUILD.gn
+++ b/system/gd/shim/BUILD.gn
@@ -22,7 +22,6 @@ source_set("BluetoothShimSources") {
"//bt/flags:bluetooth_flags_c_lib",
"//bt/system/gd/dumpsys:libbluetooth-dumpsys",
"//bt/system/gd/dumpsys/bundler:BluetoothGeneratedBundlerSchema_h_bfbs",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
]
configs += [
diff --git a/system/hci/Android.bp b/system/hci/Android.bp
index b0773d34c1..5e493288a7 100644
--- a/system/hci/Android.bp
+++ b/system/hci/Android.bp
@@ -34,7 +34,6 @@ cc_library_static {
header_libs: ["libbluetooth_headers"],
static_libs: [
"libbluetooth_log",
- "libbt_shim_bridge",
],
}
diff --git a/system/include/hardware/bluetooth.h b/system/include/hardware/bluetooth.h
index bf53607a8d..7e891573b9 100644
--- a/system/include/hardware/bluetooth.h
+++ b/system/include/hardware/bluetooth.h
@@ -687,9 +687,8 @@ typedef struct {
* config file. These devices are deleted upon leaving restricted mode.
* The |is_common_criteria_mode| flag inits the adapter in common criteria
* mode. The |config_compare_result| flag show the config checksum check
- * result if is in common criteria mode. The |init_flags| are config flags
- * that cannot change during run. The |is_atv| flag indicates whether the
- * local device is an Android TV
+ * result if is in common criteria mode. The |is_atv| flag indicates whether
+ * the local device is an Android TV
*/
int (*init)(bt_callbacks_t* callbacks, bool guest_mode, bool is_common_criteria_mode,
int config_compare_result, const char** init_flags, bool is_atv,
diff --git a/system/main/Android.bp b/system/main/Android.bp
index f1b07c0544..62445e59e7 100644
--- a/system/main/Android.bp
+++ b/system/main/Android.bp
@@ -55,7 +55,6 @@ cc_library_static {
"libbluetooth_gd",
"libbluetooth_log",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libcom.android.sysprop.bluetooth.wrapped",
],
header_libs: ["libbluetooth_headers"],
@@ -149,7 +148,6 @@ cc_library_static {
"bluetooth_flags_c_lib",
"libbluetooth_log",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libcom.android.sysprop.bluetooth.wrapped",
],
}
@@ -209,14 +207,13 @@ cc_test {
"libbluetooth-dumpsys",
"libbluetooth-gdx",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_hci_pdl",
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
@@ -295,14 +292,13 @@ cc_test {
"libbluetooth-dumpsys",
"libbluetooth-gdx",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_hci_pdl",
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
diff --git a/system/main/shim/BUILD.gn b/system/main/shim/BUILD.gn
index 93ac01f992..88bbba0c6b 100644
--- a/system/main/shim/BUILD.gn
+++ b/system/main/shim/BUILD.gn
@@ -24,7 +24,6 @@ source_set("BluetoothStackManagerSources") {
"//bt/system",
"//bt/system/btif/include",
"//bt/system/gd",
- "//bt/system/gd/rust/shim",
"//bt/system/stack/include",
"//bt/system/types",
]
@@ -36,7 +35,6 @@ source_set("BluetoothStackManagerSources") {
"//bt/system/gd/hci:BluetoothHciSources",
"//bt/system/gd/os:BluetoothOsSources_linux_generic",
"//bt/system/gd/packet:BluetoothPacketSources",
- "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
"//bt/system/gd/rust/topshim:libbluetooth_topshim",
"//bt/system/osi",
"//bt/system/pdl:BluetoothGeneratedPackets_h",
@@ -71,7 +69,6 @@ source_set("LibBluetoothShimSources") {
"//bt/system",
"//bt/system/btif/include",
"//bt/system/gd",
- "//bt/system/gd/rust/shim",
"//bt/system/stack/include",
"//bt/system/types",
]
@@ -84,7 +81,6 @@ source_set("LibBluetoothShimSources") {
"//bt/system/gd/hci:BluetoothHciSources",
"//bt/system/gd/os:BluetoothOsSources_linux_generic",
"//bt/system/gd/packet:BluetoothPacketSources",
- "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
"//bt/system/gd/rust/topshim:libbluetooth_topshim",
"//bt/system/osi",
"//bt/system/pdl:BluetoothGeneratedPackets_h",
diff --git a/system/osi/Android.bp b/system/osi/Android.bp
index 9a9358b9b9..04e9a1f839 100644
--- a/system/osi/Android.bp
+++ b/system/osi/Android.bp
@@ -92,7 +92,6 @@ cc_library_static {
"libaconfig_storage_read_api_cc",
"libbluetooth_log",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"server_configurable_flags",
],
}
@@ -142,8 +141,6 @@ cc_test {
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libgmock",
diff --git a/system/osi/BUILD.gn b/system/osi/BUILD.gn
index af410b55d9..fdd2736fab 100644
--- a/system/osi/BUILD.gn
+++ b/system/osi/BUILD.gn
@@ -56,7 +56,6 @@ static_library("osi") {
deps = [
"//bt/flags:bluetooth_flags_c_lib",
"//bt/system/common",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
]
configs += [
diff --git a/system/profile/avrcp/Android.bp b/system/profile/avrcp/Android.bp
index 60b2947ddd..8616ca25cf 100644
--- a/system/profile/avrcp/Android.bp
+++ b/system/profile/avrcp/Android.bp
@@ -30,7 +30,6 @@ cc_library_static {
"lib-bt-packets",
"libbluetooth-types",
"libbluetooth_log",
- "libbt_shim_bridge",
"libosi",
],
whole_static_libs: [
@@ -81,8 +80,6 @@ cc_test {
"libbluetooth-types",
"libbluetooth_gd",
"libbluetooth_log",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libcutils",
@@ -130,8 +127,6 @@ cc_fuzz {
"libbluetooth-types",
"libbluetooth_gd",
"libbluetooth_log",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libcutils",
"libevent",
diff --git a/system/profile/avrcp/BUILD.gn b/system/profile/avrcp/BUILD.gn
index 84bff495f6..3305fc0948 100644
--- a/system/profile/avrcp/BUILD.gn
+++ b/system/profile/avrcp/BUILD.gn
@@ -40,7 +40,6 @@ static_library("profile_avrcp") {
deps = [
"//bt/flags:bluetooth_flags_c_lib",
- "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
]
configs += [
diff --git a/system/rust/Android.bp b/system/rust/Android.bp
index 4281cae7ae..f3fddcd3b9 100644
--- a/system/rust/Android.bp
+++ b/system/rust/Android.bp
@@ -22,7 +22,6 @@ rust_defaults {
"libbase",
],
static_libs: [
- "libbt_shim_bridge",
"libchrome",
"libevent",
"libmodpb64",
@@ -35,7 +34,6 @@ rust_defaults {
"libanyhow",
"libbitflags",
"libbt_common",
- "libbt_shim",
"libbytes",
"libcxx",
"liblog_rust",
@@ -45,11 +43,6 @@ rust_defaults {
whole_static_libs: [
"libbluetooth_core_rs_bridge",
],
- features: [
- // used to hide libbt_shim in Cargo builds, but
- // expose it to Soong to work around linker bug
- "via_android_bp",
- ],
target: {
android: {
shared_libs: [
@@ -130,8 +123,6 @@ cc_library_static {
static_libs: [
"libbluetooth_hci_pdl",
"libbluetooth_log",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libflatbuffers-cpp",
],
@@ -143,6 +134,7 @@ cc_library_static {
"BluetoothGeneratedDumpsysDataSchema_h",
],
export_generated_headers: [
+ "cxx-bridge-header",
"libbluetooth_core_rs_bridge_codegen_header",
],
host_supported: true,
diff --git a/system/rust/BUILD.gn b/system/rust/BUILD.gn
index 202e9dff76..5c386e5a0f 100644
--- a/system/rust/BUILD.gn
+++ b/system/rust/BUILD.gn
@@ -43,7 +43,6 @@ static_library("core_rs") {
deps = [
":cxxlibheader",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
"//bt/system/pdl:BluetoothGeneratedPackets_h",
]
diff --git a/system/rust/src/lib.rs b/system/rust/src/lib.rs
index b3361bad1e..b8154a1cd9 100644
--- a/system/rust/src/lib.rs
+++ b/system/rust/src/lib.rs
@@ -26,13 +26,6 @@ use tokio::runtime::Builder;
use tokio::sync::mpsc;
-#[cfg(feature = "via_android_bp")]
-mod do_not_use {
- // DO NOT USE
- #[allow(unused)]
- use bt_shim::*;
-}
-
pub mod connection;
pub mod core;
pub mod gatt;
diff --git a/system/stack/Android.bp b/system/stack/Android.bp
index 152b866cc3..15532a9acd 100644
--- a/system/stack/Android.bp
+++ b/system/stack/Android.bp
@@ -21,7 +21,6 @@ cc_library_static {
],
static_libs: [
"libbluetooth_log",
- "libbt_shim_bridge",
],
shared_libs: [
"libchrome",
@@ -147,7 +146,6 @@ cc_library_static {
"libbt-hci",
"libbt-platform-protos-lite",
"libbt-stack-core",
- "libbt_shim_bridge",
"liblc3",
],
whole_static_libs: [
@@ -329,6 +327,7 @@ cc_library_static {
],
generated_headers: [
"BluetoothGeneratedDumpsysDataSchema_h",
+ "cxx-bridge-header",
],
cflags: [
/* we export all classes, so change default visibility, instead of having EXPORT_SYMBOL on each class*/
@@ -344,7 +343,6 @@ cc_library_static {
"libbluetooth_log",
"libbt-hci",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libcom.android.sysprop.bluetooth.wrapped",
"server_configurable_flags",
],
@@ -454,8 +452,6 @@ cc_fuzz {
"libbluetooth-types",
"libbluetooth_log",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
],
shared_libs: [
"libaconfig_storage_read_api_cc",
@@ -510,14 +506,13 @@ cc_fuzz {
"bluetooth_flags_c_lib",
"libaconfig_storage_read_api_cc",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_hci_pdl",
"libbluetooth_l2cap_pdl",
"libbluetooth_log",
"libbluetooth_smp_pdl",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
],
}
@@ -565,14 +560,13 @@ cc_fuzz {
static_libs: [
"bluetooth_flags_c_lib",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_hci_pdl",
"libbluetooth_l2cap_pdl",
"libbluetooth_log",
"libbluetooth_smp_pdl",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
],
}
@@ -621,8 +615,6 @@ cc_fuzz {
"libbluetooth_smp_pdl",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libevent",
],
}
@@ -665,8 +657,6 @@ cc_fuzz {
"libbluetooth_log",
"libbluetooth_smp_pdl",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
],
}
@@ -716,8 +706,6 @@ cc_fuzz {
"libbluetooth_log",
"libbluetooth_smp_pdl",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libcom.android.sysprop.bluetooth.wrapped",
],
}
@@ -760,8 +748,6 @@ cc_fuzz {
"libbluetooth_log",
"libbluetooth_smp_pdl",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
],
shared_libs: [
"libaconfig_storage_read_api_cc",
@@ -846,7 +832,6 @@ cc_test {
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
"libbtcore",
"libbtdevice",
"libbtif",
@@ -952,8 +937,6 @@ cc_test {
"libbt-btu-main-thread",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libgmock",
@@ -1044,8 +1027,6 @@ cc_test {
"libbt-btu-main-thread",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libgmock",
@@ -1125,8 +1106,6 @@ cc_test {
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libgmock",
@@ -1179,12 +1158,11 @@ cc_test {
"bluetooth_flags_c_lib_for_test",
"libbase",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libgmock",
@@ -1257,8 +1235,6 @@ cc_test {
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libgmock",
@@ -1370,8 +1346,6 @@ cc_test {
"libbt-common",
"libbt-sbc-decoder",
"libbt-sbc-encoder",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libgmock",
"liblog",
@@ -1423,7 +1397,6 @@ cc_test {
"libbluetooth_crypto_toolbox",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
"libchrome",
"liblog",
"libosi",
@@ -1482,13 +1455,12 @@ cc_test {
"bluetooth_flags_c_lib_for_test",
"libbase",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libgmock",
@@ -1548,7 +1520,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libchrome",
"libgmock",
"liblog",
@@ -1625,8 +1596,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libevent",
"libgmock",
@@ -1750,6 +1719,7 @@ cc_test {
"bluetooth_flags_c_lib_for_test",
"libbase",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
@@ -1757,8 +1727,6 @@ cc_test {
"libbt-platform-protos-lite",
"libbt-sbc-decoder",
"libbt-sbc-encoder",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
@@ -1814,7 +1782,6 @@ cc_test {
"libbluetooth_crypto_toolbox",
"libbluetooth_log",
"libbt-common",
- "libbt_shim_bridge",
"libbtdevice",
"libbte",
"libchrome",
@@ -1874,8 +1841,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libbte",
"libchrome",
@@ -1954,8 +1919,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libevent",
@@ -2040,13 +2003,12 @@ cc_test {
"bluetooth_flags_c_lib_for_test",
"libbase",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libevent",
@@ -2140,8 +2102,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libevent",
@@ -2231,12 +2191,11 @@ cc_test {
static_libs: [
"bluetooth_flags_c_lib",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_gd",
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libcutils",
@@ -2332,6 +2291,7 @@ cc_test {
"bluetooth_flags_c_lib_for_test",
"libbase",
"libbluetooth-types",
+ "libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
@@ -2339,8 +2299,6 @@ cc_test {
"libbt-platform-protos-lite",
"libbt-sbc-decoder",
"libbt-sbc-encoder",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libbtdevice",
"libchrome",
"libcom.android.sysprop.bluetooth.wrapped",
@@ -2411,8 +2369,6 @@ cc_test {
"libbluetooth_log",
"libbt-common",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
- "libbt_shim_ffi",
"libchrome",
"libflagtest",
"libgmock",
diff --git a/system/stack/BUILD.gn b/system/stack/BUILD.gn
index ebb070c4ec..cc966337c4 100644
--- a/system/stack/BUILD.gn
+++ b/system/stack/BUILD.gn
@@ -40,7 +40,6 @@ source_set("nonstandard_codecs") {
]
deps = [
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
"//bt/system/stack/mmc",
]
@@ -223,9 +222,9 @@ source_set("stack") {
deps = [
"//bt/sysprop:libcom.android.sysprop.bluetooth",
"//bt/system/gd/crypto_toolbox:crypto_toolbox",
+ "//bt/system/gd/rust/topshim:cxxlibheader",
":nonstandard_codecs",
"//bt/system:libbt-platform-protos-lite",
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
"//bt/system/stack/mmc",
"//bt/system/types",
]
diff --git a/system/stack/mmc/codec_server/BUILD.gn b/system/stack/mmc/codec_server/BUILD.gn
index a8f6b143d9..0d7a3a7f9d 100644
--- a/system/stack/mmc/codec_server/BUILD.gn
+++ b/system/stack/mmc/codec_server/BUILD.gn
@@ -27,7 +27,6 @@ source_set("libcodec_server_a2dp_aac") {
"//bt/system/stack/include",
]
deps = [
- "//bt/system/gd/rust/shim:init_flags_bridge_header",
"//bt/system/stack/mmc/proto:mmc_config_proto",
]
sources = [ "a2dp_aac_mmc_encoder.cc" ]
diff --git a/system/stack/test/fuzzers/Android.bp b/system/stack/test/fuzzers/Android.bp
index 92de791e1b..8d146834d6 100644
--- a/system/stack/test/fuzzers/Android.bp
+++ b/system/stack/test/fuzzers/Android.bp
@@ -57,7 +57,6 @@ cc_defaults {
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
- "libbt_shim_bridge",
"libbtcore",
"libbtdevice",
"libbte",
diff --git a/system/test/Android.bp b/system/test/Android.bp
index 2970d10640..a78ed4e8ef 100644
--- a/system/test/Android.bp
+++ b/system/test/Android.bp
@@ -553,13 +553,6 @@ filegroup {
}
filegroup {
- name: "TestCommonInitFlags",
- srcs: [
- "common/init_flags.cc",
- ],
-}
-
-filegroup {
name: "TestCommonStackConfig",
srcs: [
"common/stack_config.cc",
diff --git a/system/test/common/init_flags.cc b/system/test/common/init_flags.cc
deleted file mode 100644
index 97be602fe3..0000000000
--- a/system/test/common/init_flags.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-#include "common/init_flags.h"
-
-#include <map>
-#include <string>
-
-namespace bluetooth {
-namespace common {
-
-bool InitFlags::logging_debug_enabled_for_all = false;
-std::unordered_map<std::string, bool> InitFlags::logging_debug_explicit_tag_settings = {};
-void InitFlags::Load(const char** flags) {}
-void InitFlags::SetAll(bool value) { InitFlags::logging_debug_enabled_for_all = value; }
-
-} // namespace common
-} // namespace bluetooth
diff --git a/system/test/headless/Android.bp b/system/test/headless/Android.bp
index 3349dc607e..9e0a234742 100644
--- a/system/test/headless/Android.bp
+++ b/system/test/headless/Android.bp
@@ -88,7 +88,6 @@ cc_binary {
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
- "libbluetooth_rust_interop",
"libbt-audio-asrc",
"libbt-audio-hal-interface",
"libbt-bta",
diff --git a/system/test/headless/headless.cc b/system/test/headless/headless.cc
index 0ff3155258..dd15c2a557 100644
--- a/system/test/headless/headless.cc
+++ b/system/test/headless/headless.cc
@@ -258,7 +258,7 @@ void HeadlessStack::SetUp() {
const bool is_atv = false;
int status = bluetoothInterface.init(&bt_callbacks, start_restricted, is_common_criteria_mode,
- config_compare_result, {}, is_atv, nullptr);
+ config_compare_result, nullptr, is_atv, nullptr);
if (status == BT_STATUS_SUCCESS) {
log::info("Initialized bluetooth callbacks");
diff --git a/system/test/suite/Android.bp b/system/test/suite/Android.bp
index ce0e3f4eb8..c8776665d2 100644
--- a/system/test/suite/Android.bp
+++ b/system/test/suite/Android.bp
@@ -129,7 +129,6 @@ cc_test {
"libbt-btu-main-thread",
"libbt-jni-thread",
"libbt-platform-protos-lite",
- "libbt_shim_bridge",
"libchrome",
"libevent",
"libflags_rust_cpp_bridge",
diff --git a/system/test/suite/adapter/bluetooth_test.cc b/system/test/suite/adapter/bluetooth_test.cc
index cea06fad0d..ce7f0c4479 100644
--- a/system/test/suite/adapter/bluetooth_test.cc
+++ b/system/test/suite/adapter/bluetooth_test.cc
@@ -96,8 +96,8 @@ void BluetoothTest::TearDown() {
}
void BluetoothTest::ClearSemaphore(btsemaphore& sem) {
- while (sem.try_wait())
- ;
+ while (sem.try_wait()) {
+ }
}
const bt_interface_t* BluetoothTest::bt_interface() { return &bluetoothInterface; }
diff --git a/system/test/tool/mockcify.pl b/system/test/tool/mockcify.pl
index 1f9978489e..dadd768c05 100755
--- a/system/test/tool/mockcify.pl
+++ b/system/test/tool/mockcify.pl
@@ -210,7 +210,6 @@ if ($COMPILE_SCREEN_ENABLED) {
sub reject_include_list {
my @incs = ();
foreach (@_) {
- next if (/init_flags/);
push(@incs, $_);
}
return @incs;
@@ -239,7 +238,6 @@ sub compilation_screen {
## Verious external or generated header not needed for mocks
foreach((
"test/mock/mock.h",
- "src/init_flags.rs.h",
"src/message_loop_thread.rs.h",
"android/hardware/bluetooth/audio/2.2/IBluetoothAudioProvidersFactory.h",
"android/hardware/bluetooth/audio/2.2/types.h",
diff --git a/system/udrv/Android.bp b/system/udrv/Android.bp
index 0e8be074e0..5a69d8e886 100644
--- a/system/udrv/Android.bp
+++ b/system/udrv/Android.bp
@@ -30,6 +30,5 @@ cc_library_static {
header_libs: ["libbluetooth_headers"],
static_libs: [
"libbluetooth_log",
- "libbt_shim_bridge",
],
}