1// libadbconnection
2// =========================================================
3// libadbconnection_client/server implement the socket handling for jdwp
4// forwarding and the track-jdwp service.
5package {
6    // See: http://go/android-license-faq
7    // A large-scale-change added 'default_applicable_licenses' to import
8    // all of the 'license_kinds' from "packages_modules_adb_license"
9    // to get the below license kinds:
10    //   SPDX-license-identifier-Apache-2.0
11    default_applicable_licenses: ["packages_modules_adb_license"],
12}
13
14cc_library {
15    name: "libadbconnection_server",
16    srcs: [
17        "adbconnection_server.cpp",
18        "common.cpp",
19    ],
20
21    export_include_dirs: ["include"],
22
23    stl: "libc++_static",
24    shared_libs: ["liblog"],
25    static_libs: [
26        "libbase",
27        "libapp_processes_protos_lite",
28        "libprotobuf-cpp-lite",
29    ],
30
31    defaults: [
32        "adbd_defaults",
33        "host_adbd_supported",
34    ],
35
36    // Avoid getting duplicate symbol of android::build::GetBuildNumber().
37    use_version_lib: false,
38
39    recovery_available: true,
40    min_sdk_version: "30",
41    apex_available: [
42        "com.android.adbd",
43        // TODO(b/151398197) remove the below
44        "//apex_available:platform",
45    ],
46    compile_multilib: "both",
47}
48
49cc_library {
50    name: "libadbconnection_client",
51    srcs: [
52        "adbconnection_client.cpp",
53        "common.cpp",
54    ],
55
56    export_include_dirs: ["include"],
57
58    stl: "libc++_static",
59    shared_libs: ["liblog"],
60    static_libs: [
61        "libbase",
62        "libapp_processes_protos_lite",
63        "libprotobuf-cpp-lite",
64    ],
65
66    defaults: ["adbd_defaults"],
67    visibility: [
68        "//art:__subpackages__",
69        "//packages/modules/adb/apex:__subpackages__",
70    ],
71    min_sdk_version: "30",
72    apex_available: [
73        "com.android.adbd",
74        "test_com.android.adbd",
75    ],
76
77    // libadbconnection_client doesn't need an embedded build number.
78    use_version_lib: false,
79
80    target: {
81        linux: {
82            version_script: "libadbconnection_client.map.txt",
83        },
84        darwin: {
85            enabled: false,
86        },
87    },
88    stubs: {
89        symbol_file: "libadbconnection_client.map.txt",
90        versions: ["1"],
91    },
92
93    host_supported: true,
94    compile_multilib: "both",
95}
96
97cc_test_host {
98    name: "libadbconnection_test",
99    srcs: ["tests.cc"],
100     static_libs: [
101         "libandroidfw",
102         "libbase",
103         "libadbconnection_client",
104         "libadbconnection_server",
105         "libapp_processes_protos_lite",
106         "libprotobuf-cpp-lite",
107         "liblog",
108     ],
109     target: {
110        windows: {
111            enabled: false,
112        },
113        darwin: {
114            enabled: false,
115        },
116     }
117}
118