Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 1 | // 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 Badour | 4da7d22 | 2021-02-22 16:14:07 -0800 | [diff] [blame] | 19 | package { |
| 20 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 21 | } |
| 22 | |
Muhammad Qureshi | 94524cd | 2020-01-25 23:47:38 -0800 | [diff] [blame] | 23 | genrule { |
| 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 | |
| 31 | car_service_sources = [ |
| 32 | "src/**/*.java", |
| 33 | ":statslog-Car-java-gen", |
| 34 | ] |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 35 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 36 | common_lib_deps = [ |
| 37 | "android.car.userlib", |
Eric Jeong | 6df075f | 2020-03-11 16:12:23 -0700 | [diff] [blame] | 38 | "android.car.watchdoglib", |
Eric Jeong | 0d3bb4f | 2020-11-06 11:31:45 -0800 | [diff] [blame] | 39 | "android.frameworks.automotive.powerpolicy.internal-java", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 40 | "android.hidl.base-V1.0-java", |
| 41 | "android.hardware.automotive.audiocontrol-V1.0-java", |
Hayden Gomes | d29c8db | 2020-03-09 13:47:28 -0700 | [diff] [blame] | 42 | "android.hardware.automotive.audiocontrol-V2.0-java", |
Jeongik Cha | d589dc0 | 2021-01-28 00:49:50 +0900 | [diff] [blame] | 43 | "android.hardware.automotive.audiocontrol-V1-java", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 44 | "android.hardware.automotive.vehicle-V2.0-java", |
| 45 | "android.hardware.health-V1.0-java", |
| 46 | "android.hardware.health-V2.0-java", |
Jeongik Cha | d589dc0 | 2021-01-28 00:49:50 +0900 | [diff] [blame] | 47 | "android.hardware.automotive.occupant_awareness-V1-java", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 48 | "vehicle-hal-support-lib", |
| 49 | "car-systemtest", |
| 50 | "com.android.car.procfsinspector-client", |
| 51 | "blestream-protos", |
| 52 | "SettingsLib", |
| 53 | "androidx.preference_preference", |
Yan Zhu | fb764ac | 2021-02-19 22:20:52 -0800 | [diff] [blame] | 54 | // TODO(b/171603586): remove this after moving NewUserDisclaimerActivity |
| 55 | // to CarSettings |
Felipe Leme | 8725a2f | 2020-12-09 16:04:51 -0800 | [diff] [blame] | 56 | "car-admin-ui-lib", |
Felipe Leme | 701b043 | 2021-03-24 16:25:31 -0700 | [diff] [blame] | 57 | "Slogf", |
Max Dashouk | ff9ffbc | 2021-02-16 11:36:39 -0800 | [diff] [blame^] | 58 | "cartelemetry-protos", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 59 | ] |
| 60 | |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 61 | android_app { |
| 62 | name: "CarService", |
| 63 | |
| 64 | srcs: car_service_sources, |
| 65 | |
| 66 | resource_dirs: ["res"], |
| 67 | |
| 68 | platform_apis: true, |
| 69 | |
| 70 | // Each update should be signed by OEMs |
| 71 | certificate: "platform", |
| 72 | privileged: true, |
| 73 | |
| 74 | optimize: { |
| 75 | proguard_flags_files: ["proguard.flags"], |
| 76 | enabled: false, |
| 77 | }, |
| 78 | |
| 79 | libs: ["android.car"], |
| 80 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 81 | static_libs: common_lib_deps + [ |
Mayank Garg | 94f3eb9 | 2020-08-12 12:38:58 -0700 | [diff] [blame] | 82 | "com.android.car.internal.system", |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 83 | ], |
| 84 | |
Changyeon Jo | c882f7a | 2021-03-09 08:41:41 -0800 | [diff] [blame] | 85 | jni_libs: ["libcarservicejni"], |
| 86 | |
Yan Zhu | ca7c459 | 2020-08-14 10:05:23 -0700 | [diff] [blame] | 87 | required: ["allowed_privapp_com.android.car"], |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 88 | |
| 89 | // Disable build in PDK, missing aidl import breaks build |
| 90 | product_variables: { |
| 91 | pdk: { |
| 92 | enabled: false, |
| 93 | }, |
| 94 | }, |
| 95 | } |
| 96 | |
Keun young Park | 9a91efb | 2019-11-15 18:10:47 -0800 | [diff] [blame] | 97 | java_library { |
| 98 | |
| 99 | name: "car-service-common-util-static-lib", |
| 100 | |
| 101 | srcs: [ |
| 102 | "src/com/android/car/CarServiceBase.java", |
| 103 | "src/com/android/car/CarServiceUtils.java", |
| 104 | "src/com/android/car/CarLog.java", |
Jordan Jozwiak | 9789ac5 | 2019-12-06 16:52:26 -0800 | [diff] [blame] | 105 | "src/com/android/car/Utils.java", |
Keun young Park | 9a91efb | 2019-11-15 18:10:47 -0800 | [diff] [blame] | 106 | ], |
| 107 | |
| 108 | product_variables: { |
| 109 | pdk: { |
| 110 | enabled: false, |
| 111 | }, |
| 112 | }, |
| 113 | } |
| 114 | |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 115 | //#################################################################################### |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 116 | // Build a static library to help mocking various car services in testing. This is meant to be used |
| 117 | // for internal unit tests around the car service. |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 118 | //#################################################################################### |
| 119 | android_library { |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 120 | name: "car-service-test-static-lib", |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 121 | |
| 122 | srcs: car_service_sources, |
| 123 | |
| 124 | resource_dirs: ["res"], |
| 125 | |
| 126 | libs: [ |
| 127 | "android.car", |
| 128 | "car-frameworks-service", |
| 129 | ], |
| 130 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 131 | static_libs: common_lib_deps, |
| 132 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 133 | product_variables: { |
| 134 | pdk: { |
| 135 | enabled: false, |
| 136 | }, |
| 137 | }, |
| 138 | } |
| 139 | |
| 140 | //#################################################################################### |
| 141 | // Build a library to help generate a testing library for external apps. |
| 142 | // We do not want to use statically linked libraries, as this will bloat the output jar with classes |
| 143 | // that can conflict with the user's environment. |
| 144 | //#################################################################################### |
| 145 | android_library { |
| 146 | name: "car-service-test-lib", |
| 147 | |
| 148 | srcs: car_service_sources, |
| 149 | |
| 150 | resource_dirs: ["res"], |
| 151 | |
| 152 | libs: common_lib_deps + [ |
| 153 | "android.car", |
| 154 | "car-frameworks-service", |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 155 | ], |
| 156 | |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 157 | product_variables: { |
| 158 | pdk: { |
| 159 | enabled: false, |
| 160 | }, |
| 161 | }, |
| 162 | } |