blob: fe07310aa6b2bde6cbcdfd354ccf0d3fe3af4991 [file] [log] [blame]
Dan Harms25fbf1b2019-07-25 16:09:17 -07001// Copyright (C) 2019 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//
15//
16
17// Build the Car service.
18
Bob Badour4da7d222021-02-22 16:14:07 -080019package {
20 default_applicable_licenses: ["Android-Apache-2.0"],
21}
22
Muhammad Qureshi94524cd2020-01-25 23:47:38 -080023genrule {
24 name: "statslog-Car-java-gen",
25 tools: ["stats-log-api-gen"],
26 cmd: "$(location stats-log-api-gen) --java $(out) --module car --javaPackage com.android.car"
27 + " --javaClass CarStatsLog",
28 out: ["com/android/car/CarStatsLog.java"],
29}
30
31car_service_sources = [
Max Dashouk9912ac32021-08-13 17:54:51 +000032 ":iscriptexecutor_aidl",
Muhammad Qureshi94524cd2020-01-25 23:47:38 -080033 "src/**/*.java",
34 ":statslog-Car-java-gen",
35]
Dan Harms25fbf1b2019-07-25 16:09:17 -070036
tadvanaf7746cd2019-10-04 16:02:56 -070037common_lib_deps = [
Zhomart Mukhamejanovfcfe4942021-07-08 09:28:55 -070038 "android.automotive.telemetry.internal-java", // ICarTelemetryInternal
Yuncheol Heo3e094c52021-05-03 11:15:17 -070039 "android.car.cluster.navigation",
tadvanaf7746cd2019-10-04 16:02:56 -070040 "android.car.userlib",
Eric Jeong6df075f2020-03-11 16:12:23 -070041 "android.car.watchdoglib",
Eric Jeong0d3bb4f2020-11-06 11:31:45 -080042 "android.frameworks.automotive.powerpolicy.internal-java",
tadvanaf7746cd2019-10-04 16:02:56 -070043 "android.hidl.base-V1.0-java",
44 "android.hardware.automotive.audiocontrol-V1.0-java",
Hayden Gomesd29c8db2020-03-09 13:47:28 -070045 "android.hardware.automotive.audiocontrol-V2.0-java",
Jeongik Chad589dc02021-01-28 00:49:50 +090046 "android.hardware.automotive.audiocontrol-V1-java",
tadvanaf7746cd2019-10-04 16:02:56 -070047 "android.hardware.automotive.vehicle-V2.0-java",
48 "android.hardware.health-V1.0-java",
49 "android.hardware.health-V2.0-java",
Jeongik Chad589dc02021-01-28 00:49:50 +090050 "android.hardware.automotive.occupant_awareness-V1-java",
tadvanaf7746cd2019-10-04 16:02:56 -070051 "vehicle-hal-support-lib",
52 "car-systemtest",
53 "com.android.car.procfsinspector-client",
54 "blestream-protos",
55 "SettingsLib",
56 "androidx.preference_preference",
Yan Zhufb764ac2021-02-19 22:20:52 -080057 // TODO(b/171603586): remove this after moving NewUserDisclaimerActivity
58 // to CarSettings
Felipe Leme8725a2f2020-12-09 16:04:51 -080059 "car-admin-ui-lib",
Felipe Leme701b0432021-03-24 16:25:31 -070060 "Slogf",
Max Dashoukff9ffbc2021-02-16 11:36:39 -080061 "cartelemetry-protos",
tadvanaf7746cd2019-10-04 16:02:56 -070062]
63
Dan Harms25fbf1b2019-07-25 16:09:17 -070064android_app {
65 name: "CarService",
66
67 srcs: car_service_sources,
68
69 resource_dirs: ["res"],
70
71 platform_apis: true,
72
73 // Each update should be signed by OEMs
74 certificate: "platform",
75 privileged: true,
76
77 optimize: {
78 proguard_flags_files: ["proguard.flags"],
79 enabled: false,
80 },
81
82 libs: ["android.car"],
83
tadvanaf7746cd2019-10-04 16:02:56 -070084 static_libs: common_lib_deps + [
Mayank Garg94f3eb92020-08-12 12:38:58 -070085 "com.android.car.internal.system",
Dan Harms25fbf1b2019-07-25 16:09:17 -070086 ],
87
Max Dashouk2c013db2021-06-30 17:43:54 +000088 jni_libs: [
89 "libcarservicejni",
Max Dashouk2c013db2021-06-30 17:43:54 +000090 ],
Changyeon Joc882f7a2021-03-09 08:41:41 -080091
Max Dashoukdafdd222021-08-20 10:42:25 -070092 aidl: {
93 include_dirs: [
94 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
95 ],
96 },
97
Yan Zhuca7c4592020-08-14 10:05:23 -070098 required: ["allowed_privapp_com.android.car"],
Dan Harms25fbf1b2019-07-25 16:09:17 -070099
100 // Disable build in PDK, missing aidl import breaks build
101 product_variables: {
102 pdk: {
103 enabled: false,
104 },
105 },
106}
107
Keun young Park9a91efb2019-11-15 18:10:47 -0800108java_library {
109
110 name: "car-service-common-util-static-lib",
111
112 srcs: [
113 "src/com/android/car/CarServiceBase.java",
114 "src/com/android/car/CarServiceUtils.java",
115 "src/com/android/car/CarLog.java",
Jordan Jozwiak9789ac52019-12-06 16:52:26 -0800116 "src/com/android/car/Utils.java",
Keun young Park9a91efb2019-11-15 18:10:47 -0800117 ],
118
bkchoi51076532021-06-14 14:35:01 -0700119 static_libs: [
120 "com.android.car.internal.common",
121 ],
122
Keun young Park9a91efb2019-11-15 18:10:47 -0800123 product_variables: {
124 pdk: {
125 enabled: false,
126 },
127 },
128}
129
Dan Harms25fbf1b2019-07-25 16:09:17 -0700130//####################################################################################
tadvanaf7746cd2019-10-04 16:02:56 -0700131// Build a static library to help mocking various car services in testing. This is meant to be used
132// for internal unit tests around the car service.
Dan Harms25fbf1b2019-07-25 16:09:17 -0700133//####################################################################################
134android_library {
tadvanaf7746cd2019-10-04 16:02:56 -0700135 name: "car-service-test-static-lib",
Dan Harms25fbf1b2019-07-25 16:09:17 -0700136
137 srcs: car_service_sources,
138
139 resource_dirs: ["res"],
140
141 libs: [
142 "android.car",
143 "car-frameworks-service",
144 ],
145
tadvanaf7746cd2019-10-04 16:02:56 -0700146 static_libs: common_lib_deps,
147
Max Dashoukdafdd222021-08-20 10:42:25 -0700148 aidl: {
149 include_dirs: [
150 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
151 ],
152 },
153
tadvanaf7746cd2019-10-04 16:02:56 -0700154 product_variables: {
155 pdk: {
156 enabled: false,
157 },
158 },
159}
160
161//####################################################################################
162// Build a library to help generate a testing library for external apps.
163// We do not want to use statically linked libraries, as this will bloat the output jar with classes
164// that can conflict with the user's environment.
165//####################################################################################
166android_library {
167 name: "car-service-test-lib",
168
169 srcs: car_service_sources,
170
171 resource_dirs: ["res"],
172
173 libs: common_lib_deps + [
174 "android.car",
175 "car-frameworks-service",
Dan Harms25fbf1b2019-07-25 16:09:17 -0700176 ],
177
Max Dashoukdafdd222021-08-20 10:42:25 -0700178 aidl: {
179 include_dirs: [
180 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
181 ],
182 },
183
Dan Harms25fbf1b2019-07-25 16:09:17 -0700184 product_variables: {
185 pdk: {
186 enabled: false,
187 },
188 },
189}
Max Dashouk9912ac32021-08-13 17:54:51 +0000190
191filegroup {
192 name: "iscriptexecutor_aidl",
193 srcs: [
194 "src/com/android/car/telemetry/scriptexecutorinterface/IScriptExecutor.aidl",
195 "src/com/android/car/telemetry/scriptexecutorinterface/IScriptExecutorListener.aidl",
196 ],
197 path: "src",
198}