Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package { |
| 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 19 | } |
| 20 | |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 21 | cc_defaults { |
| 22 | name: "remote-access-hal-defaults", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 23 | vendor: true, |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 24 | relative_install_path: "hw", |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 25 | srcs: [ |
| 26 | "src/RemoteAccessImpl.cpp", |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 27 | ], |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 28 | whole_static_libs: [ |
| 29 | "RemoteAccessService", |
| 30 | ], |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 31 | static_libs: [ |
Yu Shan | 2a096c4 | 2023-02-15 18:16:22 -0800 | [diff] [blame] | 32 | "BindToDeviceSocketMutatorLib", |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 33 | ], |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 34 | shared_libs: [ |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 35 | "libbinder_ndk", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 36 | "libutils", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 37 | "libprotobuf-cpp-full", |
| 38 | ], |
| 39 | defaults: [ |
| 40 | "vhalclient_defaults", |
Yu Shan | 2a096c4 | 2023-02-15 18:16:22 -0800 | [diff] [blame] | 41 | "BindToDeviceSocketMutatorDefaults", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 42 | ], |
| 43 | cflags: [ |
Yu Shan | 2a096c4 | 2023-02-15 18:16:22 -0800 | [diff] [blame] | 44 | // This is already included in BindToDeviceSocketMutatorDefaults but |
| 45 | // might be overridden by vhalclient_defaults. |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 46 | "-Wno-unused-parameter", |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 47 | ], |
| 48 | } |
| 49 | |
Yu Shan | 06ddbc6 | 2023-08-23 18:05:26 -0700 | [diff] [blame^] | 50 | // TODO(b/295393732): remove this once we finish the migration from V1 to V2. |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 51 | cc_binary { |
| 52 | name: "android.hardware.automotive.remoteaccess@V1-default-service", |
| 53 | defaults: ["remote-access-hal-defaults"], |
Yu Shan | 06ddbc6 | 2023-08-23 18:05:26 -0700 | [diff] [blame^] | 54 | 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 | |
| 61 | cc_binary { |
| 62 | name: "android.hardware.automotive.remoteaccess@V2-default-service", |
| 63 | defaults: ["remote-access-hal-defaults"], |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 64 | vintf_fragments: ["remoteaccess-default-service.xml"], |
| 65 | init_rc: ["remoteaccess-default-service.rc"], |
| 66 | cflags: [ |
Yu Shan | 3a129d7 | 2023-05-31 16:33:07 -0700 | [diff] [blame] | 67 | "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 68 | ], |
| 69 | } |
| 70 | |
Yu Shan | 06ddbc6 | 2023-08-23 18:05:26 -0700 | [diff] [blame^] | 71 | // TODO(b/295393732): remove this once we finish the migration from V1 to V2. |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 72 | cc_binary { |
| 73 | name: "android.hardware.automotive.remoteaccess@V1-tcu-test-service", |
| 74 | defaults: ["remote-access-hal-defaults"], |
Yu Shan | 06ddbc6 | 2023-08-23 18:05:26 -0700 | [diff] [blame^] | 75 | 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 | |
| 83 | cc_binary { |
| 84 | name: "android.hardware.automotive.remoteaccess@V2-tcu-test-service", |
| 85 | defaults: ["remote-access-hal-defaults"], |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 86 | 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 Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 90 | "-DGRPC_SERVICE_IFNAME=\"eth1\"", |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 91 | ], |
| 92 | } |
| 93 | |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 94 | cc_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 Shan | 06ddbc6 | 2023-08-23 18:05:26 -0700 | [diff] [blame^] | 103 | "android.hardware.automotive.remoteaccess-V2-ndk", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 104 | "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 | |
| 124 | cc_fuzz { |
Yu Shan | 06ddbc6 | 2023-08-23 18:05:26 -0700 | [diff] [blame^] | 125 | name: "android.hardware.automotive.remoteaccess@V2-default-service.aidl_fuzzer", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 126 | 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 | } |