Add apex_available and min_sdk, sdk_version to deps of bt apex

Bug: 206121418
Test: Compile
Change-Id: I799bcdeabd19107a563fa4d8d6e094221d4f69f6
diff --git a/system/audio_a2dp_hw/Android.bp b/system/audio_a2dp_hw/Android.bp
index 33f7687..3fc6b65 100644
--- a/system/audio_a2dp_hw/Android.bp
+++ b/system/audio_a2dp_hw/Android.bp
@@ -28,6 +28,10 @@
         "src/audio_a2dp_hw.cc",
         "src/audio_a2dp_hw_utils.cc",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
     shared_libs: [
         "liblog",
         "libcutils",
@@ -42,6 +46,7 @@
         "src/audio_a2dp_hw_utils.cc",
     ],
     host_supported: true,
+    min_sdk_version: "29",
 }
 
 // Audio A2DP library unit tests for target and host
diff --git a/system/audio_hearing_aid_hw/Android.bp b/system/audio_hearing_aid_hw/Android.bp
index fd64d81..05b252d 100644
--- a/system/audio_hearing_aid_hw/Android.bp
+++ b/system/audio_hearing_aid_hw/Android.bp
@@ -27,6 +27,10 @@
         "src/audio_hearing_aid_hw.cc",
         "src/audio_hearing_aid_hw_utils.cc",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
     shared_libs: [
         "liblog",
     ],
diff --git a/system/btcore/Android.bp b/system/btcore/Android.bp
index 5f2dd17..a9b43f4 100644
--- a/system/btcore/Android.bp
+++ b/system/btcore/Android.bp
@@ -28,6 +28,10 @@
     ],
     header_libs: ["libbluetooth_headers"],
     host_supported: true,
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
     target: {
         linux_glibc: {
             cflags: ["-D_GNU_SOURCE"],
@@ -52,6 +56,11 @@
     export_include_dirs: ["./"],
     vendor_available: true,
     host_supported: true,
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 // Note: It's good to get the tests compiled both for the host and the target so
diff --git a/system/btif/Android.bp b/system/btif/Android.bp
index 426a8d5..5395598 100644
--- a/system/btif/Android.bp
+++ b/system/btif/Android.bp
@@ -47,6 +47,11 @@
     shared_libs: [
         "libcutils",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
     target: {
         android: {
             shared_libs: [
diff --git a/system/build/Android.bp b/system/build/Android.bp
index 559e4a7..c189b15 100644
--- a/system/build/Android.bp
+++ b/system/build/Android.bp
@@ -96,7 +96,11 @@
         "liblog",
         "libcutils",
     ],
+    shared_libs: [
+        "liblog",
+    ],
     cpp_std: "c++17",
+    min_sdk_version: "current",
 }
 
 fluoride_defaults {
diff --git a/system/gd/Android.bp b/system/gd/Android.bp
index 3c2b958..12b35d5 100644
--- a/system/gd/Android.bp
+++ b/system/gd/Android.bp
@@ -212,6 +212,7 @@
     defaults: [
         "libbluetooth_gd_defaults",
     ],
+    min_sdk_version: "31",
 }
 
 cc_library {
@@ -573,6 +574,11 @@
         "libthiserror",
         "liblog_rust",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 rust_test_host {
@@ -995,4 +1001,9 @@
     ],
     source_stem: "facade",
     host_supported: true,
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
diff --git a/system/gd/dumpsys/Android.bp b/system/gd/dumpsys/Android.bp
index 2409dd0..0f5392e 100644
--- a/system/gd/dumpsys/Android.bp
+++ b/system/gd/dumpsys/Android.bp
@@ -142,6 +142,11 @@
     generated_sources: [
         "BluetoothGeneratedDumpsysBundledSchema_cc",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 cc_library {
diff --git a/system/gd/proto/Android.bp b/system/gd/proto/Android.bp
index 0ccfc4c..6bb3f26 100644
--- a/system/gd/proto/Android.bp
+++ b/system/gd/proto/Android.bp
@@ -21,6 +21,8 @@
         "//apex_available:platform",
         "com.android.bluetooth",
     ],
+    min_sdk_version: "30",
+    sdk_version: "current",
 }
 
 cc_library_static {
@@ -38,6 +40,7 @@
         "//apex_available:platform",
         "com.android.bluetooth",
     ],
+    min_sdk_version: "30",
 }
 
 cc_library_static {
@@ -56,4 +59,5 @@
         "//apex_available:platform",
         "com.android.bluetooth",
     ],
+    min_sdk_version: "30",
 }
diff --git a/system/gd/rust/common/Android.bp b/system/gd/rust/common/Android.bp
index affad61..26a00689 100644
--- a/system/gd/rust/common/Android.bp
+++ b/system/gd/rust/common/Android.bp
@@ -40,6 +40,11 @@
     proc_macros: [
         "libpaste",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 rust_test_host {
diff --git a/system/gd/rust/facade/Android.bp b/system/gd/rust/facade/Android.bp
index 4e4f061..3d4d0b9 100644
--- a/system/gd/rust/facade/Android.bp
+++ b/system/gd/rust/facade/Android.bp
@@ -58,4 +58,9 @@
         "liblog_rust",
         "libcxx",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
diff --git a/system/gd/rust/gddi/Android.bp b/system/gd/rust/gddi/Android.bp
index fa9837f..91713ac 100644
--- a/system/gd/rust/gddi/Android.bp
+++ b/system/gd/rust/gddi/Android.bp
@@ -15,6 +15,11 @@
     edition: "2018",
     proc_macros: ["libgddi_macros"],
     rustlibs: ["libtokio"],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 rust_proc_macro {
diff --git a/system/gd/rust/shim/Android.bp b/system/gd/rust/shim/Android.bp
index f57ff6f..6df6a31 100644
--- a/system/gd/rust/shim/Android.bp
+++ b/system/gd/rust/shim/Android.bp
@@ -59,6 +59,11 @@
 rust_ffi_static {
     name: "libbt_shim_ffi",
     defaults: ["libbt_shim_defaults"],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 cc_library_static {
@@ -97,6 +102,7 @@
     shared_libs: [
         "libchrome",
     ],
+    min_sdk_version: "30",
 }
 
 cc_library_static {
@@ -107,6 +113,11 @@
         "libbt_shim_ffi",
     ],
     host_supported: true,
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 cc_library_static {
@@ -119,12 +130,22 @@
         "libchrome",
     ],
     host_supported: true,
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 cc_library_headers {
     name: "libbt_callbacks_cxx_headers",
     local_include_dirs: ["callbacks"],
     host_supported: true,
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
 genrule {
diff --git a/system/gd/rust/stack/Android.bp b/system/gd/rust/stack/Android.bp
index 0da24d8..48eedb0 100644
--- a/system/gd/rust/stack/Android.bp
+++ b/system/gd/rust/stack/Android.bp
@@ -35,6 +35,11 @@
     proc_macros: [
         "libnum_derive",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
     target: {
         android: {
             whole_static_libs: ["libbt_hidl_hal_cxx"],
@@ -108,5 +113,10 @@
         "libhidlbase",
         "libutils",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
 
diff --git a/system/include/Android.bp b/system/include/Android.bp
index fdbf651..7dd3db2 100644
--- a/system/include/Android.bp
+++ b/system/include/Android.bp
@@ -24,6 +24,7 @@
         "//apex_available:platform",
         "com.android.bluetooth",
     ],
+    min_sdk_version: "30",
 }
 
 cc_library_headers {
@@ -42,4 +43,9 @@
     export_include_dirs: ["./"],
     vendor_available: true,
     host_supported: true,
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
+    min_sdk_version: "30",
 }
diff --git a/system/internal_include/Android.bp b/system/internal_include/Android.bp
index 825be2a..aca617f 100644
--- a/system/internal_include/Android.bp
+++ b/system/internal_include/Android.bp
@@ -12,4 +12,5 @@
     export_include_dirs: ["./"],
     vendor_available: true,
     host_supported: true,
+    min_sdk_version: "30",
 }
diff --git a/system/main/Android.bp b/system/main/Android.bp
index 5e31216..81566b6 100644
--- a/system/main/Android.bp
+++ b/system/main/Android.bp
@@ -165,7 +165,12 @@
     sanitize: {
         never: true,
     },
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
     host_supported: true,
+    min_sdk_version: "30",
 }
 
 cc_library_static {
diff --git a/system/osi/Android.bp b/system/osi/Android.bp
index a5d5f43..47a2b29 100644
--- a/system/osi/Android.bp
+++ b/system/osi/Android.bp
@@ -99,6 +99,10 @@
             ],
         },
     },
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.bluetooth",
+    ],
 }
 
 // libosi unit tests for target and host
diff --git a/system/packet/Android.bp b/system/packet/Android.bp
index 5e6a074..45057d8 100644
--- a/system/packet/Android.bp
+++ b/system/packet/Android.bp
@@ -23,6 +23,7 @@
         "//apex_available:platform",
         "com.android.bluetooth",
     ],
+    min_sdk_version: "30",
 }
 
 cc_test {
diff --git a/system/packet/avrcp/Android.bp b/system/packet/avrcp/Android.bp
index f2214f3..b5aedd5 100644
--- a/system/packet/avrcp/Android.bp
+++ b/system/packet/avrcp/Android.bp
@@ -45,4 +45,5 @@
         "//apex_available:platform",
         "com.android.bluetooth",
     ],
+    min_sdk_version: "30",
 }
diff --git a/system/packet/base/Android.bp b/system/packet/base/Android.bp
index d0e023f..f3a99f9 100644
--- a/system/packet/base/Android.bp
+++ b/system/packet/base/Android.bp
@@ -22,4 +22,5 @@
         "//apex_available:platform",
         "com.android.bluetooth",
     ],
+    min_sdk_version: "30",
 }
diff --git a/system/profile/avrcp/Android.bp b/system/profile/avrcp/Android.bp
index 07bd25b..a8daa91 100644
--- a/system/profile/avrcp/Android.bp
+++ b/system/profile/avrcp/Android.bp
@@ -33,6 +33,7 @@
     ],
     shared_libs: [
         "libchrome",
+        "liblog",
     ],
     apex_available: [
         "//apex_available:platform",
diff --git a/system/types/Android.bp b/system/types/Android.bp
index 82ed7be..8b9c4ef 100644
--- a/system/types/Android.bp
+++ b/system/types/Android.bp
@@ -41,6 +41,7 @@
     ],
     header_libs: ["libbluetooth-types-header"],
     export_header_lib_headers: ["libbluetooth-types-header"],
+    min_sdk_version: "29",
 }
 
 cc_test {