1// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "packages_modules_adb_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["packages_modules_adb_license"],
22}
23
24cc_defaults {
25    name: "libadb_pairing_connection_defaults",
26    cflags: [
27        "-Wall",
28        "-Wextra",
29        "-Wthread-safety",
30        "-Werror",
31    ],
32
33    compile_multilib: "both",
34
35    srcs: [
36        "pairing_connection.cpp",
37    ],
38    target: {
39        android: {
40            version_script: "libadb_pairing_connection.map.txt",
41        },
42        windows: {
43            compile_multilib: "first",
44            enabled: true,
45        },
46    },
47    export_include_dirs: ["include"],
48
49    visibility: [
50        "//art:__subpackages__",
51        "//frameworks/base/services:__subpackages__",
52        "//packages/modules/adb:__subpackages__",
53
54        // This needs to be visible to minadbd, even though it's removed via exclude_shared_libs.
55        "//bootable/recovery/minadbd:__subpackages__",
56    ],
57    apex_available: [
58        "com.android.adbd",
59    ],
60
61    // libadb_pairing_connection doesn't need an embedded build number.
62    use_version_lib: false,
63
64    stl: "libc++_static",
65
66    host_supported: true,
67    recovery_available: false,
68
69    static_libs: [
70        "libbase",
71        "libssl",
72    ],
73    shared_libs: [
74        "libcrypto",
75        "liblog",
76        "libadb_pairing_auth",
77    ],
78}
79
80cc_library {
81    name: "libadb_pairing_connection",
82    defaults: ["libadb_pairing_connection_defaults"],
83
84    apex_available: [
85        "com.android.adbd",
86    ],
87
88    stubs: {
89        symbol_file: "libadb_pairing_connection.map.txt",
90        versions: ["30"],
91    },
92
93    static_libs: [
94        "libadb_protos",
95        // Statically link libadb_tls_connection because it is not
96        // ABI-stable.
97        "libadb_tls_connection",
98        "libprotobuf-cpp-lite",
99    ],
100}
101
102// For running atest (b/147158681)
103cc_library_static {
104    name: "libadb_pairing_connection_static",
105    defaults: ["libadb_pairing_connection_defaults"],
106
107    apex_available: [
108        "//apex_available:platform",
109    ],
110
111    static_libs: [
112        "libadb_protos_static",
113        "libprotobuf-cpp-lite",
114        "libadb_tls_connection_static",
115    ],
116}
117
118cc_defaults {
119    name: "libadb_pairing_server_defaults",
120    cflags: [
121        "-Wall",
122        "-Wextra",
123        "-Wthread-safety",
124        "-Werror",
125    ],
126
127    compile_multilib: "both",
128
129    srcs: [
130        "pairing_server.cpp",
131    ],
132    target: {
133        android: {
134            version_script: "libadb_pairing_server.map.txt",
135        },
136    },
137    export_include_dirs: ["include"],
138
139    visibility: [
140        "//art:__subpackages__",
141        "//frameworks/base/services:__subpackages__",
142        "//packages/modules/adb:__subpackages__",
143    ],
144
145    recovery_available: false,
146
147    stl: "libc++_static",
148
149    static_libs: [
150        "libbase",
151    ],
152    shared_libs: [
153        "libcrypto",
154        "libcrypto_utils",
155        "libcutils",
156        "liblog",
157        "libadb_pairing_auth",
158        "libadb_pairing_connection",
159    ],
160}
161
162cc_library {
163    name: "libadb_pairing_server",
164    defaults: ["libadb_pairing_server_defaults"],
165
166    apex_available: [
167        "com.android.adbd",
168    ],
169
170    stubs: {
171        symbol_file: "libadb_pairing_server.map.txt",
172        versions: ["30"],
173    },
174
175    static_libs: [
176        // Statically link libadb_crypto because it is not
177	// ABI-stable.
178        "libadb_crypto",
179        "libadb_protos",
180    ],
181}
182
183// For running atest (b/147158681)
184cc_library_static {
185    name: "libadb_pairing_server_static",
186    defaults: ["libadb_pairing_server_defaults"],
187
188    apex_available: [
189        "//apex_available:platform",
190    ],
191
192    static_libs: [
193        "libadb_crypto_static",
194        "libadb_protos_static",
195    ],
196}
197