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", |
| 29 | ":statslog-Car-java-gen", |
| 30 | ] |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 31 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 32 | common_lib_deps = [ |
| 33 | "android.car.userlib", |
Eric Jeong | 6df075f | 2020-03-11 16:12:23 -0700 | [diff] [blame] | 34 | "android.car.watchdoglib", |
Eric Jeong | 0d3bb4f | 2020-11-06 11:31:45 -0800 | [diff] [blame] | 35 | "android.frameworks.automotive.powerpolicy.internal-java", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 36 | "android.hidl.base-V1.0-java", |
| 37 | "android.hardware.automotive.audiocontrol-V1.0-java", |
Hayden Gomes | d29c8db | 2020-03-09 13:47:28 -0700 | [diff] [blame] | 38 | "android.hardware.automotive.audiocontrol-V2.0-java", |
Hayden Gomes | a4aac77 | 2020-10-26 16:13:38 -0700 | [diff] [blame] | 39 | "android.hardware.automotive.audiocontrol-java", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 40 | "android.hardware.automotive.vehicle-V2.0-java", |
| 41 | "android.hardware.health-V1.0-java", |
| 42 | "android.hardware.health-V2.0-java", |
Michael Keller | c0f0bdb | 2019-12-11 14:58:19 -0800 | [diff] [blame] | 43 | "android.hardware.automotive.occupant_awareness-java", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 44 | "vehicle-hal-support-lib", |
| 45 | "car-systemtest", |
| 46 | "com.android.car.procfsinspector-client", |
| 47 | "blestream-protos", |
| 48 | "SettingsLib", |
| 49 | "androidx.preference_preference", |
Felipe Leme | 8725a2f | 2020-12-09 16:04:51 -0800 | [diff] [blame] | 50 | // 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", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 53 | ] |
| 54 | |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 55 | android_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 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 75 | static_libs: common_lib_deps + [ |
Mayank Garg | 94f3eb9 | 2020-08-12 12:38:58 -0700 | [diff] [blame] | 76 | "com.android.car.internal.system", |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 77 | ], |
| 78 | |
Yan Zhu | ca7c459 | 2020-08-14 10:05:23 -0700 | [diff] [blame] | 79 | required: ["allowed_privapp_com.android.car"], |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 80 | |
| 81 | // Disable build in PDK, missing aidl import breaks build |
| 82 | product_variables: { |
| 83 | pdk: { |
| 84 | enabled: false, |
| 85 | }, |
| 86 | }, |
| 87 | } |
| 88 | |
Keun young Park | 9a91efb | 2019-11-15 18:10:47 -0800 | [diff] [blame] | 89 | java_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 Jozwiak | 9789ac5 | 2019-12-06 16:52:26 -0800 | [diff] [blame] | 97 | "src/com/android/car/Utils.java", |
Keun young Park | 9a91efb | 2019-11-15 18:10:47 -0800 | [diff] [blame] | 98 | ], |
| 99 | |
| 100 | product_variables: { |
| 101 | pdk: { |
| 102 | enabled: false, |
| 103 | }, |
| 104 | }, |
| 105 | } |
| 106 | |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 107 | //#################################################################################### |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 108 | // 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 Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 110 | //#################################################################################### |
| 111 | android_library { |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 112 | name: "car-service-test-static-lib", |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 113 | |
| 114 | srcs: car_service_sources, |
| 115 | |
| 116 | resource_dirs: ["res"], |
| 117 | |
| 118 | libs: [ |
| 119 | "android.car", |
| 120 | "car-frameworks-service", |
| 121 | ], |
| 122 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 123 | static_libs: common_lib_deps, |
| 124 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 125 | 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 | //#################################################################################### |
| 137 | android_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 Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 147 | ], |
| 148 | |
| 149 | min_sdk_version: "25", |
| 150 | |
| 151 | product_variables: { |
| 152 | pdk: { |
| 153 | enabled: false, |
| 154 | }, |
| 155 | }, |
| 156 | } |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 157 | |