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