blob: 8af2872152d2e61cba26aa27b76337bbdbd9d285 [file] [log] [blame]
Dan Willemsene05dc6d2016-07-25 17:13:45 -07001// Copyright (C) 2009 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
Vijay Venkatraman5583be72017-03-24 16:13:58 -070015cc_library_headers {
16 name: "libbinder_headers",
17 export_include_dirs: ["include"],
Jiyong Park172bd722017-06-21 12:14:18 +090018 vendor_available: true,
Steven Moreland28723ae2019-04-01 18:52:30 -070019 host_supported: true,
20
Jiyong Parkb7df6cb2017-04-13 21:19:48 -070021 header_libs: [
22 "libbase_headers",
23 "libcutils_headers",
24 "libutils_headers",
25 ],
26 export_header_lib_headers: [
27 "libbase_headers",
28 "libcutils_headers",
29 "libutils_headers",
30 ],
Vijay Venkatraman5583be72017-03-24 16:13:58 -070031}
32
Steven Moreland28723ae2019-04-01 18:52:30 -070033// These interfaces are android-specific implementation unrelated to binder
34// transport itself and should be moved to AIDL or in domain-specific libs.
35//
36// Currently, these are only on system android (not vendor, not host)
37libbinder_device_interface_sources = [
38 "ActivityManager.cpp",
39 "AppOpsManager.cpp",
40 "IActivityManager.cpp",
41 "IAppOpsCallback.cpp",
42 "IAppOpsService.cpp",
43 "IBatteryStats.cpp",
44 "IMediaResourceMonitor.cpp",
45 "IPermissionController.cpp",
46 "IProcessInfoService.cpp",
47 "IUidObserver.cpp",
48 "PermissionCache.cpp",
49 "PermissionController.cpp",
50 "ProcessInfoService.cpp",
51 "IpPrefix.cpp",
52]
53
Steven Moreland7d48c5b2018-07-16 11:06:27 -070054cc_library_shared {
Dan Willemsene05dc6d2016-07-25 17:13:45 -070055 name: "libbinder",
56
Steven Moreland3aa76162017-04-13 21:19:48 -070057 // for vndbinder
58 vendor_available: true,
Justin Yunb367ff42017-08-02 17:02:05 +090059 vndk: {
60 enabled: true,
61 },
Jiyong Parkfe0a8242018-04-09 12:16:30 +090062 double_loadable: true,
Steven Moreland28723ae2019-04-01 18:52:30 -070063 host_supported: true,
64
65 // TODO(b/31559095): get headers from bionic on host
66 include_dirs: [
67 "bionic/libc/kernel/android/uapi/",
68 "bionic/libc/kernel/uapi/",
69 ],
Steven Moreland636d7d52019-08-26 10:42:38 -070070
71 // libbinder does not offer a stable wire protocol.
72 // if a second copy of it is installed, then it may break after security
73 // or dessert updates. Instead, apex users should use libbinder_ndk.
Jiyong Park79984982019-08-12 10:37:39 +090074 no_apex: true,
Steven Moreland3aa76162017-04-13 21:19:48 -070075
Dan Willemsene05dc6d2016-07-25 17:13:45 -070076 srcs: [
Dan Willemsene05dc6d2016-07-25 17:13:45 -070077 "Binder.cpp",
78 "BpBinder.cpp",
79 "BufferedTextOutput.cpp",
80 "Debug.cpp",
Dan Willemsene05dc6d2016-07-25 17:13:45 -070081 "IInterface.cpp",
Dan Willemsene05dc6d2016-07-25 17:13:45 -070082 "IMemory.cpp",
83 "IPCThreadState.cpp",
Dan Willemsene05dc6d2016-07-25 17:13:45 -070084 "IResultReceiver.cpp",
85 "IServiceManager.cpp",
Dianne Hackborn1941a402016-08-29 12:30:43 -070086 "IShellCallback.cpp",
Dan Willemsene05dc6d2016-07-25 17:13:45 -070087 "MemoryBase.cpp",
88 "MemoryDealer.cpp",
89 "MemoryHeapBase.cpp",
90 "Parcel.cpp",
Ryo Hashimotobf551892018-05-31 16:58:35 +090091 "ParcelFileDescriptor.cpp",
Dan Willemsene05dc6d2016-07-25 17:13:45 -070092 "PersistableBundle.cpp",
Dan Willemsene05dc6d2016-07-25 17:13:45 -070093 "ProcessState.cpp",
94 "Static.cpp",
Steven Morelanda86a3562019-08-01 23:28:34 +000095 "Stability.cpp",
Dan Willemsene05dc6d2016-07-25 17:13:45 -070096 "Status.cpp",
97 "TextOutput.cpp",
Colin Cross21c210e2017-11-14 13:05:37 -080098 ":libbinder_aidl",
Dan Willemsene05dc6d2016-07-25 17:13:45 -070099 ],
100
Jiyong Park47f876b2018-04-17 13:56:46 +0900101 target: {
Steven Moreland28723ae2019-04-01 18:52:30 -0700102 android: {
103 srcs: libbinder_device_interface_sources,
104 },
105 host: {
106 cflags: ["-D__ANDROID_HOST__"],
107 },
Jiyong Park47f876b2018-04-17 13:56:46 +0900108 vendor: {
Steven Moreland28723ae2019-04-01 18:52:30 -0700109 exclude_srcs: libbinder_device_interface_sources,
Jiyong Park47f876b2018-04-17 13:56:46 +0900110 },
111 },
112
Todd Kennedy757186e2017-08-02 07:49:20 -0700113 aidl: {
114 export_aidl_headers: true,
115 },
116
Dan Willemsene05dc6d2016-07-25 17:13:45 -0700117 cflags: [
118 "-Wall",
119 "-Wextra",
120 "-Werror",
Yi Kongc2376e42018-07-10 15:12:36 -0700121 "-Wzero-as-null-pointer-constant",
Dan Willemsene05dc6d2016-07-25 17:13:45 -0700122 ],
123 product_variables: {
124 binder32bit: {
125 cflags: ["-DBINDER_IPC_32BIT=1"],
126 },
127 },
128
129 shared_libs: [
Dan Willemsene05dc6d2016-07-25 17:13:45 -0700130 "liblog",
131 "libcutils",
132 "libutils",
Jayant Chowdharydac6dc82018-10-01 22:52:44 +0000133 "libbinderthreadstate",
Dan Willemsene05dc6d2016-07-25 17:13:45 -0700134 ],
Jiyong Park42842052017-06-20 13:51:22 +0900135
136 header_libs: [
137 "libbinder_headers",
138 ],
139
Jiyong Park42842052017-06-20 13:51:22 +0900140 export_header_lib_headers: [
141 "libbinder_headers",
Dan Stozad630e522016-12-01 15:16:31 -0800142 ],
143
Dan Willemsene05dc6d2016-07-25 17:13:45 -0700144 clang: true,
145 sanitize: {
146 misc_undefined: ["integer"],
147 },
148}
149
Colin Cross21c210e2017-11-14 13:05:37 -0800150// AIDL interface between libbinder and framework.jar
151filegroup {
152 name: "libbinder_aidl",
153 srcs: [
154 "aidl/android/content/pm/IPackageManagerNative.aidl",
Steven Moreland27cfab02019-08-12 14:34:16 -0700155 "aidl/android/os/IServiceCallback.aidl",
Steven Moreland80e1e6d2019-06-21 12:35:59 -0700156 "aidl/android/os/IServiceManager.aidl",
Colin Cross21c210e2017-11-14 13:05:37 -0800157 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700158 path: "aidl",
Colin Cross21c210e2017-11-14 13:05:37 -0800159}