blob: d752f7823afcbe7274d90228da19a29a9ba56175 [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
Muhammad Qureshi94524cd2020-01-25 23:47:38 -080019genrule {
20 name: "statslog-Car-java-gen",
21 tools: ["stats-log-api-gen"],
22 cmd: "$(location stats-log-api-gen) --java $(out) --module car --javaPackage com.android.car"
23 + " --javaClass CarStatsLog",
24 out: ["com/android/car/CarStatsLog.java"],
25}
26
27car_service_sources = [
28 "src/**/*.java",
29 ":statslog-Car-java-gen",
30]
Dan Harms25fbf1b2019-07-25 16:09:17 -070031
tadvanaf7746cd2019-10-04 16:02:56 -070032common_lib_deps = [
33 "android.car.userlib",
Eric Jeong6df075f2020-03-11 16:12:23 -070034 "android.car.watchdoglib",
Eric Jeong0d3bb4f2020-11-06 11:31:45 -080035 "android.frameworks.automotive.powerpolicy.internal-java",
tadvanaf7746cd2019-10-04 16:02:56 -070036 "android.hidl.base-V1.0-java",
37 "android.hardware.automotive.audiocontrol-V1.0-java",
Hayden Gomesd29c8db2020-03-09 13:47:28 -070038 "android.hardware.automotive.audiocontrol-V2.0-java",
Hayden Gomesa4aac772020-10-26 16:13:38 -070039 "android.hardware.automotive.audiocontrol-java",
tadvanaf7746cd2019-10-04 16:02:56 -070040 "android.hardware.automotive.vehicle-V2.0-java",
41 "android.hardware.health-V1.0-java",
42 "android.hardware.health-V2.0-java",
Michael Kellerc0f0bdb2019-12-11 14:58:19 -080043 "android.hardware.automotive.occupant_awareness-java",
tadvanaf7746cd2019-10-04 16:02:56 -070044 "vehicle-hal-support-lib",
45 "car-systemtest",
46 "com.android.car.procfsinspector-client",
47 "blestream-protos",
48 "SettingsLib",
49 "androidx.preference_preference",
Felipe Leme8725a2f2020-12-09 16:04:51 -080050 // TODO(b/175057848): car-admin-ui-lib is need by NewUserDisclaimerActivity;
51 // it might be better to move that class to CarSystemUI instead.
52 "car-admin-ui-lib",
tadvanaf7746cd2019-10-04 16:02:56 -070053]
54
Dan Harms25fbf1b2019-07-25 16:09:17 -070055android_app {
56 name: "CarService",
57
58 srcs: car_service_sources,
59
60 resource_dirs: ["res"],
61
62 platform_apis: true,
63
64 // Each update should be signed by OEMs
65 certificate: "platform",
66 privileged: true,
67
68 optimize: {
69 proguard_flags_files: ["proguard.flags"],
70 enabled: false,
71 },
72
73 libs: ["android.car"],
74
tadvanaf7746cd2019-10-04 16:02:56 -070075 static_libs: common_lib_deps + [
Mayank Garg94f3eb92020-08-12 12:38:58 -070076 "com.android.car.internal.system",
Dan Harms25fbf1b2019-07-25 16:09:17 -070077 ],
78
Yan Zhuca7c4592020-08-14 10:05:23 -070079 required: ["allowed_privapp_com.android.car"],
Dan Harms25fbf1b2019-07-25 16:09:17 -070080
81 // Disable build in PDK, missing aidl import breaks build
82 product_variables: {
83 pdk: {
84 enabled: false,
85 },
86 },
87}
88
Keun young Park9a91efb2019-11-15 18:10:47 -080089java_library {
90
91 name: "car-service-common-util-static-lib",
92
93 srcs: [
94 "src/com/android/car/CarServiceBase.java",
95 "src/com/android/car/CarServiceUtils.java",
96 "src/com/android/car/CarLog.java",
Jordan Jozwiak9789ac52019-12-06 16:52:26 -080097 "src/com/android/car/Utils.java",
Keun young Park9a91efb2019-11-15 18:10:47 -080098 ],
99
100 product_variables: {
101 pdk: {
102 enabled: false,
103 },
104 },
105}
106
Dan Harms25fbf1b2019-07-25 16:09:17 -0700107//####################################################################################
tadvanaf7746cd2019-10-04 16:02:56 -0700108// Build a static library to help mocking various car services in testing. This is meant to be used
109// for internal unit tests around the car service.
Dan Harms25fbf1b2019-07-25 16:09:17 -0700110//####################################################################################
111android_library {
tadvanaf7746cd2019-10-04 16:02:56 -0700112 name: "car-service-test-static-lib",
Dan Harms25fbf1b2019-07-25 16:09:17 -0700113
114 srcs: car_service_sources,
115
116 resource_dirs: ["res"],
117
118 libs: [
119 "android.car",
120 "car-frameworks-service",
121 ],
122
tadvanaf7746cd2019-10-04 16:02:56 -0700123 static_libs: common_lib_deps,
124
tadvanaf7746cd2019-10-04 16:02:56 -0700125 product_variables: {
126 pdk: {
127 enabled: false,
128 },
129 },
130}
131
132//####################################################################################
133// Build a library to help generate a testing library for external apps.
134// We do not want to use statically linked libraries, as this will bloat the output jar with classes
135// that can conflict with the user's environment.
136//####################################################################################
137android_library {
138 name: "car-service-test-lib",
139
140 srcs: car_service_sources,
141
142 resource_dirs: ["res"],
143
144 libs: common_lib_deps + [
145 "android.car",
146 "car-frameworks-service",
Dan Harms25fbf1b2019-07-25 16:09:17 -0700147 ],
148
149 min_sdk_version: "25",
150
151 product_variables: {
152 pdk: {
153 enabled: false,
154 },
155 },
156}
tadvanaf7746cd2019-10-04 16:02:56 -0700157