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", |
| 27 | "src/BindToDeviceSocketMutator.cpp", |
| 28 | ], |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 29 | whole_static_libs: [ |
| 30 | "RemoteAccessService", |
| 31 | ], |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame^] | 32 | static_libs: [ |
| 33 | "android.hardware.automotive.can@libnetdevice", |
| 34 | "libnl++", |
| 35 | ], |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 36 | shared_libs: [ |
| 37 | "libbase", |
| 38 | "libbinder_ndk", |
| 39 | "liblog", |
| 40 | "libutils", |
| 41 | "libgrpc++", |
| 42 | "libprotobuf-cpp-full", |
| 43 | ], |
| 44 | defaults: [ |
| 45 | "vhalclient_defaults", |
| 46 | ], |
| 47 | cflags: [ |
| 48 | "-Wno-unused-parameter", |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 49 | ], |
| 50 | } |
| 51 | |
| 52 | cc_binary { |
| 53 | name: "android.hardware.automotive.remoteaccess@V1-default-service", |
| 54 | defaults: ["remote-access-hal-defaults"], |
| 55 | vintf_fragments: ["remoteaccess-default-service.xml"], |
| 56 | init_rc: ["remoteaccess-default-service.rc"], |
| 57 | cflags: [ |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 58 | "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"", |
| 59 | ], |
| 60 | } |
| 61 | |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 62 | cc_binary { |
| 63 | name: "android.hardware.automotive.remoteaccess@V1-tcu-test-service", |
| 64 | defaults: ["remote-access-hal-defaults"], |
| 65 | vintf_fragments: ["remoteaccess-default-service.xml"], |
| 66 | init_rc: ["remoteaccess-tcu-test-service.rc"], |
| 67 | cflags: [ |
| 68 | "-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"", |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame^] | 69 | "-DGRPC_SERVICE_IFNAME=\"eth1\"", |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 70 | ], |
| 71 | } |
| 72 | |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 73 | cc_library { |
| 74 | name: "RemoteAccessService", |
| 75 | vendor_available: true, |
| 76 | local_include_dirs: ["include"], |
| 77 | export_include_dirs: ["include"], |
| 78 | srcs: [ |
| 79 | "src/RemoteAccessService.cpp", |
| 80 | ], |
| 81 | whole_static_libs: [ |
| 82 | "android.hardware.automotive.remoteaccess-V1-ndk", |
| 83 | "wakeup_client_protos", |
| 84 | "libvhalclient", |
| 85 | ], |
| 86 | defaults: [ |
| 87 | "vhalclient_defaults", |
| 88 | ], |
| 89 | shared_libs: [ |
| 90 | "libbase", |
| 91 | "libbinder_ndk", |
| 92 | "libcutils", |
| 93 | "liblog", |
| 94 | "libutils", |
| 95 | "libgrpc++", |
| 96 | "libprotobuf-cpp-full", |
| 97 | ], |
| 98 | cflags: [ |
| 99 | "-Wno-unused-parameter", |
| 100 | ], |
| 101 | } |
| 102 | |
| 103 | cc_fuzz { |
| 104 | name: "android.hardware.automotive.remoteaccess@V1-default-service.aidl_fuzzer", |
| 105 | srcs: ["fuzzer/fuzzer.cpp"], |
| 106 | whole_static_libs: [ |
| 107 | "RemoteAccessService", |
| 108 | ], |
| 109 | static_libs: [ |
| 110 | "libgtest", |
| 111 | "libgmock", |
| 112 | ], |
| 113 | shared_libs: [ |
| 114 | "libbase", |
| 115 | "libbinder_ndk", |
| 116 | "liblog", |
| 117 | "libutils", |
| 118 | "libgrpc++", |
| 119 | "libprotobuf-cpp-full", |
| 120 | ], |
| 121 | defaults: [ |
| 122 | "vhalclient_defaults", |
| 123 | "service_fuzzer_defaults", |
| 124 | ], |
| 125 | cflags: [ |
| 126 | "-Wno-unused-parameter", |
| 127 | "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"", |
| 128 | ], |
| 129 | fuzz_config: { |
| 130 | cc: [ |
| 131 | "shanyu@google.com", |
| 132 | ], |
| 133 | }, |
| 134 | } |