From cc9bb399d25875e4f1d240ead43a2db9b7ac9708 Mon Sep 17 00:00:00 2001
From: David Duarte <licorne@google.com>
Date: Thu, 31 Aug 2023 04:30:38 +0000
Subject: [PATCH] Remove libbluetooth-types from fluoride_defaults

Bug: 279502784
Test: mmm packages/modules/Bluetooth
Change-Id: Ic4233b951586a90cb35f7c6264b4bc9b93858061
---
 system/bta/Android.bp                | 11 +++++++++++
 system/btcore/Android.bp             |  1 +
 system/btif/Android.bp               |  1 +
 system/build/Android.bp              |  1 -
 system/common/Android.bp             |  1 +
 system/hci/Android.bp                |  1 +
 system/main/Android.bp               |  1 +
 system/profile/avrcp/Android.bp      |  2 ++
 system/stack/Android.bp              | 21 +++++++++++++++++++++
 system/stack/test/fuzzers/Android.bp |  1 +
 system/test/headless/Android.bp      |  1 +
 system/types/Android.bp              |  1 +
 12 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/system/bta/Android.bp b/system/bta/Android.bp
index a10fc8ba5f2..90383164923 100644
--- a/system/bta/Android.bp
+++ b/system/bta/Android.bp
@@ -465,6 +465,7 @@ cc_test {
     ],
     static_libs: [
         "crypto_toolbox_for_tests",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -509,6 +510,7 @@ cc_test {
     ],
     static_libs: [
         "crypto_toolbox_for_tests",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -564,6 +566,7 @@ cc_test {
     ],
     static_libs: [
         "crypto_toolbox_for_tests",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -707,6 +710,7 @@ cc_test {
         "liblog", // __android_log_print
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -801,6 +805,7 @@ cc_test {
         "liblog", // __android_log_print
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -874,6 +879,7 @@ cc_test {
     ],
     static_libs: [
         "crypto_toolbox_for_tests",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-audio-hal-interface",
         "libbt-common",
@@ -937,6 +943,7 @@ cc_test {
     ],
     static_libs: [
         "crypto_toolbox_for_tests",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -991,6 +998,7 @@ cc_test {
         "liblog",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -1054,6 +1062,7 @@ cc_test {
         "liblog",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbt-audio-hal-interface",
         "libbt-common",
         "libchrome",
@@ -1114,6 +1123,7 @@ cc_test {
     ],
     static_libs: [
         "crypto_toolbox_for_tests",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -1176,6 +1186,7 @@ cc_test {
     ],
     static_libs: [
         "crypto_toolbox_for_tests",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
diff --git a/system/btcore/Android.bp b/system/btcore/Android.bp
index 42f95e492a8..8892fde3cb0 100644
--- a/system/btcore/Android.bp
+++ b/system/btcore/Android.bp
@@ -100,6 +100,7 @@ cc_test {
         "liblog",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbtcore",
         "libchrome",
         "libosi",
diff --git a/system/btif/Android.bp b/system/btif/Android.bp
index fae227f26ec..a46b91b5063 100644
--- a/system/btif/Android.bp
+++ b/system/btif/Android.bp
@@ -148,6 +148,7 @@ cc_library_static {
         "lib-bt-packets-avrcp",
         "lib-bt-packets-base",
         "libaudio-a2dp-hw-utils",
+        "libbluetooth-types",
         "libbt-audio-hal-interface",
         "libbt-stack",
         "libbt-stack-core",
diff --git a/system/build/Android.bp b/system/build/Android.bp
index d86e70b70fa..f768ae20e20 100644
--- a/system/build/Android.bp
+++ b/system/build/Android.bp
@@ -33,7 +33,6 @@ cc_defaults {
     },
     defaults: ["fluoride_types_defaults_fuzzable"],
     static_libs: [
-        "libbluetooth-types",
         "libbluetooth_rust_interop",
         "libbt-platform-protos-lite",
         "libbt_shim_bridge",
diff --git a/system/common/Android.bp b/system/common/Android.bp
index 1d684a622ac..9cd44cadf9f 100644
--- a/system/common/Android.bp
+++ b/system/common/Android.bp
@@ -95,6 +95,7 @@ cc_test {
         "liblog",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbt-common",
         "libchrome",
         "libevent",
diff --git a/system/hci/Android.bp b/system/hci/Android.bp
index 015a53ae9f7..08b49ca15d8 100644
--- a/system/hci/Android.bp
+++ b/system/hci/Android.bp
@@ -70,6 +70,7 @@ cc_test {
     ],
     static_libs: [
         "libbluetooth-for-tests",
+        "libbluetooth-types",
         "libbt-hci",
         "libbtcore",
         "libchrome",
diff --git a/system/main/Android.bp b/system/main/Android.bp
index 6e0e6b41bf8..aca76270c2a 100644
--- a/system/main/Android.bp
+++ b/system/main/Android.bp
@@ -204,6 +204,7 @@ cc_test {
     ],
     static_libs: [
         "libbluetooth-dumpsys",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libbtdevice",
diff --git a/system/profile/avrcp/Android.bp b/system/profile/avrcp/Android.bp
index 95d60b3c020..ef2aef08d7b 100644
--- a/system/profile/avrcp/Android.bp
+++ b/system/profile/avrcp/Android.bp
@@ -70,6 +70,7 @@ cc_test {
         "lib-bt-packets-avrcp",
         "lib-bt-packets-base",
         "libbase",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbtdevice",
         "libchrome",
@@ -109,6 +110,7 @@ cc_fuzz {
         "lib-bt-packets-avrcp",
         "lib-bt-packets-base",
         "libbase",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libchrome",
         "libcutils",
diff --git a/system/stack/Android.bp b/system/stack/Android.bp
index ceac11a43e2..5553fc7e992 100644
--- a/system/stack/Android.bp
+++ b/system/stack/Android.bp
@@ -392,6 +392,7 @@ cc_fuzz {
         ":TestMockStackMetrics",
         "fuzzers/sdp_fuzzer.cc",
     ],
+    static_libs: ["libbluetooth-types"],
 }
 
 cc_fuzz {
@@ -432,6 +433,7 @@ cc_fuzz {
         "gatt/*.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libgmock",
     ],
 }
@@ -469,6 +471,7 @@ cc_fuzz {
         "smp/*.cc", // add other sources files  (p256 related) under smp into this test
     ],
     static_libs: [
+        "libbluetooth-types",
         "libgmock",
     ],
 }
@@ -506,6 +509,7 @@ cc_fuzz {
         "fuzzers/bnep_fuzzer.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libgmock",
     ],
 }
@@ -545,6 +549,7 @@ cc_fuzz {
         "fuzzers/avrc_fuzzer.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libgmock",
         "libosi",
     ],
@@ -589,6 +594,7 @@ cc_fuzz {
         "l2cap/*.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libgmock",
     ],
     target: {
@@ -650,6 +656,7 @@ cc_test {
         "android.system.suspend.control-V1-ndk",
         "libFraunhoferAAC",
         "libbluetooth-dumpsys",
+        "libbluetooth-types",
         "libbluetooth_core_rs",
         "libbt-audio-hal-interface",
         "libbt-bta",
@@ -735,6 +742,7 @@ cc_test {
         "libcutils",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -814,6 +822,7 @@ cc_test {
         "libcutils",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libchrome",
         "libevent",
@@ -932,6 +941,7 @@ cc_test {
         "libcutils",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -998,6 +1008,7 @@ cc_test {
         "libcutils",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -1106,6 +1117,7 @@ cc_test {
     ],
     static_libs: [
         "libFraunhoferAAC",
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libbt-sbc-decoder",
@@ -1213,6 +1225,7 @@ cc_test {
         "libcutils",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -1261,6 +1274,7 @@ cc_test {
         "test/common/mock_hcic_layer.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbt-common",
         "libchrome",
         "libgmock",
@@ -1323,6 +1337,7 @@ cc_test {
         "libcutils",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libchrome",
@@ -1439,6 +1454,7 @@ cc_test {
         "test/stack_include_test.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libbt-sbc-decoder",
@@ -1547,6 +1563,7 @@ cc_test {
         "test/hid/stack_hid_test.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbt-common",
         "libbtdevice",
         "libbte",
@@ -1619,6 +1636,7 @@ cc_test {
         "test/stack_btu_test.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libbtdevice",
@@ -1701,6 +1719,7 @@ cc_test {
         "test/gatt/stack_gatt_test.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libbtdevice",
@@ -1784,6 +1803,7 @@ cc_test {
         "test/stack_l2cap_test.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libbtdevice",
@@ -1871,6 +1891,7 @@ cc_test {
         "test/stack_acl_test.cc",
     ],
     static_libs: [
+        "libbluetooth-types",
         "libbluetooth_gd",
         "libbt-common",
         "libbtdevice",
diff --git a/system/stack/test/fuzzers/Android.bp b/system/stack/test/fuzzers/Android.bp
index 5f1e3d20097..426c8e46c92 100644
--- a/system/stack/test/fuzzers/Android.bp
+++ b/system/stack/test/fuzzers/Android.bp
@@ -22,6 +22,7 @@ cc_defaults {
     static_libs: [
         "libFraunhoferAAC",
         "libbluetooth-dumpsys",
+        "libbluetooth-types",
         "libbluetooth_core_rs",
         "libbluetooth_gd",
         "libbt-audio-hal-interface",
diff --git a/system/test/headless/Android.bp b/system/test/headless/Android.bp
index bb0d332fc5d..df60cebe721 100644
--- a/system/test/headless/Android.bp
+++ b/system/test/headless/Android.bp
@@ -74,6 +74,7 @@ cc_binary {
         "libFraunhoferAAC",
         "libaudio-a2dp-hw-utils",
         "libbluetooth-dumpsys",
+        "libbluetooth-types",
         "libbluetooth_core_rs",
         "libbluetooth_gd",
         "libbluetooth_rust_interop",
diff --git a/system/types/Android.bp b/system/types/Android.bp
index b862dfbd4cf..1a4af0b6692 100644
--- a/system/types/Android.bp
+++ b/system/types/Android.bp
@@ -57,6 +57,7 @@ cc_library_static {
 cc_test {
     name: "net_test_types",
     static_libs: [
+        "libbluetooth-types",
         "libchrome",
         "libosi", // strlcpy
     ],
-- 
GitLab