blob: 70dba3071a385fc9a60a70b1e8c4e4450e0424e1 [file] [log] [blame]
Yu Shan7a5283f2022-10-25 18:01:05 -07001/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18 default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
Yu Shan1532afd2022-11-30 14:41:30 -080021cc_defaults {
22 name: "remote-access-hal-defaults",
Yu Shan7a5283f2022-10-25 18:01:05 -070023 vendor: true,
Yu Shan7a5283f2022-10-25 18:01:05 -070024 relative_install_path: "hw",
Yu Shan39b19852023-01-12 16:20:11 -080025 srcs: [
26 "src/RemoteAccessImpl.cpp",
Yu Shan39b19852023-01-12 16:20:11 -080027 ],
Yu Shan7a5283f2022-10-25 18:01:05 -070028 whole_static_libs: [
29 "RemoteAccessService",
30 ],
Yu Shan39b19852023-01-12 16:20:11 -080031 static_libs: [
Yu Shan2a096c42023-02-15 18:16:22 -080032 "BindToDeviceSocketMutatorLib",
Yu Shan39b19852023-01-12 16:20:11 -080033 ],
Yu Shan7a5283f2022-10-25 18:01:05 -070034 shared_libs: [
Yu Shan7a5283f2022-10-25 18:01:05 -070035 "libbinder_ndk",
Yu Shan7a5283f2022-10-25 18:01:05 -070036 "libutils",
Yu Shan7a5283f2022-10-25 18:01:05 -070037 "libprotobuf-cpp-full",
38 ],
39 defaults: [
40 "vhalclient_defaults",
Yu Shan2a096c42023-02-15 18:16:22 -080041 "BindToDeviceSocketMutatorDefaults",
Yu Shan7a5283f2022-10-25 18:01:05 -070042 ],
43 cflags: [
Yu Shan2a096c42023-02-15 18:16:22 -080044 // This is already included in BindToDeviceSocketMutatorDefaults but
45 // might be overridden by vhalclient_defaults.
Yu Shan7a5283f2022-10-25 18:01:05 -070046 "-Wno-unused-parameter",
Yu Shan1532afd2022-11-30 14:41:30 -080047 ],
48}
49
Yu Shan06ddbc62023-08-23 18:05:26 -070050// TODO(b/295393732): remove this once we finish the migration from V1 to V2.
Yu Shan1532afd2022-11-30 14:41:30 -080051cc_binary {
52 name: "android.hardware.automotive.remoteaccess@V1-default-service",
53 defaults: ["remote-access-hal-defaults"],
Yu Shan06ddbc62023-08-23 18:05:26 -070054 vintf_fragments: ["remoteaccess-default-service-v1.xml"],
55 init_rc: ["remoteaccess-default-service-v1.rc"],
56 cflags: [
57 "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"",
58 ],
59}
60
61cc_binary {
62 name: "android.hardware.automotive.remoteaccess@V2-default-service",
63 defaults: ["remote-access-hal-defaults"],
Yu Shan1532afd2022-11-30 14:41:30 -080064 vintf_fragments: ["remoteaccess-default-service.xml"],
65 init_rc: ["remoteaccess-default-service.rc"],
66 cflags: [
Yu Shan3a129d72023-05-31 16:33:07 -070067 "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"",
Yu Shan7a5283f2022-10-25 18:01:05 -070068 ],
69}
70
Yu Shan06ddbc62023-08-23 18:05:26 -070071// TODO(b/295393732): remove this once we finish the migration from V1 to V2.
Yu Shan1532afd2022-11-30 14:41:30 -080072cc_binary {
73 name: "android.hardware.automotive.remoteaccess@V1-tcu-test-service",
74 defaults: ["remote-access-hal-defaults"],
Yu Shan06ddbc62023-08-23 18:05:26 -070075 vintf_fragments: ["remoteaccess-default-service-v1.xml"],
76 init_rc: ["remoteaccess-tcu-test-service-v1.rc"],
77 cflags: [
78 "-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"",
79 "-DGRPC_SERVICE_IFNAME=\"eth1\"",
80 ],
81}
82
83cc_binary {
84 name: "android.hardware.automotive.remoteaccess@V2-tcu-test-service",
85 defaults: ["remote-access-hal-defaults"],
Yu Shan1532afd2022-11-30 14:41:30 -080086 vintf_fragments: ["remoteaccess-default-service.xml"],
87 init_rc: ["remoteaccess-tcu-test-service.rc"],
88 cflags: [
89 "-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"",
Yu Shan39b19852023-01-12 16:20:11 -080090 "-DGRPC_SERVICE_IFNAME=\"eth1\"",
Yu Shan1532afd2022-11-30 14:41:30 -080091 ],
92}
93
Yu Shan7a5283f2022-10-25 18:01:05 -070094cc_library {
95 name: "RemoteAccessService",
96 vendor_available: true,
97 local_include_dirs: ["include"],
98 export_include_dirs: ["include"],
99 srcs: [
100 "src/RemoteAccessService.cpp",
101 ],
102 whole_static_libs: [
Yu Shan06ddbc62023-08-23 18:05:26 -0700103 "android.hardware.automotive.remoteaccess-V2-ndk",
Yu Shan7a5283f2022-10-25 18:01:05 -0700104 "wakeup_client_protos",
105 "libvhalclient",
106 ],
107 defaults: [
108 "vhalclient_defaults",
109 ],
110 shared_libs: [
111 "libbase",
112 "libbinder_ndk",
113 "libcutils",
114 "liblog",
115 "libutils",
116 "libgrpc++",
117 "libprotobuf-cpp-full",
118 ],
119 cflags: [
120 "-Wno-unused-parameter",
121 ],
122}
123
124cc_fuzz {
Yu Shan06ddbc62023-08-23 18:05:26 -0700125 name: "android.hardware.automotive.remoteaccess@V2-default-service.aidl_fuzzer",
Yu Shan7a5283f2022-10-25 18:01:05 -0700126 srcs: ["fuzzer/fuzzer.cpp"],
127 whole_static_libs: [
128 "RemoteAccessService",
129 ],
130 static_libs: [
131 "libgtest",
132 "libgmock",
133 ],
134 shared_libs: [
135 "libbase",
136 "libbinder_ndk",
137 "liblog",
138 "libutils",
139 "libgrpc++",
140 "libprotobuf-cpp-full",
141 ],
142 defaults: [
143 "vhalclient_defaults",
144 "service_fuzzer_defaults",
145 ],
146 cflags: [
147 "-Wno-unused-parameter",
148 "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"",
149 ],
150 fuzz_config: {
151 cc: [
152 "shanyu@google.com",
153 ],
154 },
155}