Steven Moreland | 1b13eea | 2017-07-10 16:05:51 -0700 | [diff] [blame] | 1 | cc_library_headers { |
| 2 | name: "libhealthd_headers", |
| 3 | vendor_available: true, |
Yifan Hong | 90fdc72 | 2018-07-10 13:02:18 -0700 | [diff] [blame] | 4 | recovery_available: true, |
Steven Moreland | 1b13eea | 2017-07-10 16:05:51 -0700 | [diff] [blame] | 5 | export_include_dirs: ["include"], |
| 6 | header_libs: ["libbatteryservice_headers"], |
| 7 | export_header_lib_headers: ["libbatteryservice_headers"], |
| 8 | } |
Yifan Hong | ffff9aa | 2017-06-01 14:34:29 -0700 | [diff] [blame] | 9 | |
| 10 | cc_library_static { |
| 11 | name: "libbatterymonitor", |
| 12 | srcs: ["BatteryMonitor.cpp"], |
Chih-Hung Hsieh | 9635266 | 2017-11-29 14:24:50 -0800 | [diff] [blame] | 13 | cflags: ["-Wall", "-Werror"], |
Yifan Hong | ffff9aa | 2017-06-01 14:34:29 -0700 | [diff] [blame] | 14 | vendor_available: true, |
Yifan Hong | 90fdc72 | 2018-07-10 13:02:18 -0700 | [diff] [blame] | 15 | recovery_available: true, |
Yifan Hong | ffff9aa | 2017-06-01 14:34:29 -0700 | [diff] [blame] | 16 | export_include_dirs: ["include"], |
| 17 | shared_libs: [ |
| 18 | "libutils", |
| 19 | "libbase", |
Yifan Hong | 1d4368b | 2019-10-07 11:18:04 -0700 | [diff] [blame] | 20 | |
| 21 | // Need latest HealthInfo definition from headers of this shared |
| 22 | // library. Clients don't need to link to this. |
| 23 | "android.hardware.health@2.1", |
Yifan Hong | ffff9aa | 2017-06-01 14:34:29 -0700 | [diff] [blame] | 24 | ], |
| 25 | header_libs: ["libhealthd_headers"], |
| 26 | export_header_lib_headers: ["libhealthd_headers"], |
| 27 | } |
Yifan Hong | 2763df8 | 2017-09-19 17:57:50 -0700 | [diff] [blame] | 28 | |
Yifan Hong | 1cf853f | 2018-04-04 14:08:57 -0700 | [diff] [blame] | 29 | cc_defaults { |
| 30 | name: "android.hardware.health@2.0-service_defaults", |
Yifan Hong | 2763df8 | 2017-09-19 17:57:50 -0700 | [diff] [blame] | 31 | |
Chih-Hung Hsieh | 9635266 | 2017-11-29 14:24:50 -0800 | [diff] [blame] | 32 | cflags: [ |
Chih-Hung Hsieh | 9635266 | 2017-11-29 14:24:50 -0800 | [diff] [blame] | 33 | "-Wall", |
| 34 | "-Werror", |
| 35 | ], |
Yifan Hong | 2763df8 | 2017-09-19 17:57:50 -0700 | [diff] [blame] | 36 | |
| 37 | static_libs: [ |
| 38 | "android.hardware.health@2.0-impl", |
| 39 | "android.hardware.health@1.0-convert", |
Yifan Hong | affa24f | 2018-01-19 15:53:25 -0800 | [diff] [blame] | 40 | "libhealthservice", |
Hridya Valsaraju | 89178e7 | 2018-01-10 16:14:28 -0800 | [diff] [blame] | 41 | "libhealthstoragedefault", |
Yifan Hong | 2763df8 | 2017-09-19 17:57:50 -0700 | [diff] [blame] | 42 | "libbatterymonitor", |
| 43 | ], |
| 44 | |
| 45 | shared_libs: [ |
| 46 | "libbase", |
| 47 | "libcutils", |
| 48 | "libhidlbase", |
Yifan Hong | 2763df8 | 2017-09-19 17:57:50 -0700 | [diff] [blame] | 49 | "liblog", |
| 50 | "libutils", |
| 51 | "android.hardware.health@2.0", |
| 52 | ], |
| 53 | } |
Yifan Hong | 12df1b9 | 2017-09-25 17:25:00 -0700 | [diff] [blame] | 54 | |
| 55 | cc_binary { |
Yifan Hong | 1cf853f | 2018-04-04 14:08:57 -0700 | [diff] [blame] | 56 | name: "android.hardware.health@2.0-service", |
| 57 | defaults: ["android.hardware.health@2.0-service_defaults"], |
Yifan Hong | 31150c1 | 2018-05-01 14:59:43 -0700 | [diff] [blame] | 58 | |
Yifan Hong | ef26fe4 | 2018-07-10 13:07:08 -0700 | [diff] [blame] | 59 | vendor: true, |
| 60 | relative_install_path: "hw", |
| 61 | init_rc: ["android.hardware.health@2.0-service.rc"], |
| 62 | srcs: [ |
| 63 | "HealthServiceDefault.cpp", |
| 64 | ], |
| 65 | |
Yifan Hong | 31150c1 | 2018-05-01 14:59:43 -0700 | [diff] [blame] | 66 | overrides: [ |
| 67 | "healthd", |
| 68 | ] |
Yifan Hong | 1cf853f | 2018-04-04 14:08:57 -0700 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | cc_binary { |
Yifan Hong | 12df1b9 | 2017-09-25 17:25:00 -0700 | [diff] [blame] | 72 | name: "healthd", |
Yifan Hong | ef26fe4 | 2018-07-10 13:07:08 -0700 | [diff] [blame] | 73 | defaults: ["android.hardware.health@2.0-service_defaults"], |
| 74 | |
Yifan Hong | fd1aa70 | 2018-04-04 14:08:04 -0700 | [diff] [blame] | 75 | init_rc: ["healthd.rc"], |
Yifan Hong | cded900 | 2017-11-06 16:47:54 -0800 | [diff] [blame] | 76 | srcs: [ |
Yifan Hong | cded900 | 2017-11-06 16:47:54 -0800 | [diff] [blame] | 77 | "HealthServiceHealthd.cpp", |
| 78 | ], |
Yifan Hong | 12df1b9 | 2017-09-25 17:25:00 -0700 | [diff] [blame] | 79 | local_include_dirs: ["include"], |
| 80 | |
Yifan Hong | 12df1b9 | 2017-09-25 17:25:00 -0700 | [diff] [blame] | 81 | shared_libs: [ |
Yifan Hong | 31cc64a | 2017-11-06 16:48:36 -0800 | [diff] [blame] | 82 | "android.hardware.health@1.0", |
Yifan Hong | 12df1b9 | 2017-09-25 17:25:00 -0700 | [diff] [blame] | 83 | ], |
| 84 | |
Yifan Hong | 3a39eec | 2018-04-27 15:03:32 -0700 | [diff] [blame] | 85 | vintf_fragments: [ |
| 86 | "manifest_healthd.xml" |
| 87 | ], |
Yifan Hong | 12df1b9 | 2017-09-25 17:25:00 -0700 | [diff] [blame] | 88 | } |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 89 | |
| 90 | cc_library_static { |
| 91 | name: "libhealthd_charger_nops", |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 92 | recovery_available: true, |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 93 | |
| 94 | srcs: [ |
| 95 | "healthd_mode_charger_nops.cpp", |
| 96 | ], |
| 97 | |
| 98 | cflags: [ |
| 99 | "-Wall", |
| 100 | "-Werror", |
| 101 | ], |
| 102 | |
| 103 | header_libs: [ |
| 104 | "libhealthd_headers", |
| 105 | ], |
| 106 | |
| 107 | static_libs: [ |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 108 | "libhealthloop", |
| 109 | "libhealth2impl", |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 110 | ], |
| 111 | |
| 112 | shared_libs: [ |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 113 | "android.hardware.health@2.1", |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 114 | "libutils", |
| 115 | ], |
| 116 | } |
Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 117 | |
| 118 | sysprop_library { |
| 119 | name: "charger_sysprop", |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 120 | recovery_available: true, |
Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 121 | srcs: ["charger.sysprop"], |
| 122 | property_owner: "Platform", |
| 123 | api_packages: ["android.sysprop"], |
| 124 | } |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 125 | |
| 126 | cc_library_static { |
| 127 | name: "libhealthd_draw", |
| 128 | export_include_dirs: ["."], |
| 129 | static_libs: [ |
| 130 | "libcharger_sysprop", |
| 131 | "libminui", |
| 132 | ], |
| 133 | shared_libs: [ |
| 134 | "libbase", |
| 135 | ], |
| 136 | header_libs: ["libbatteryservice_headers"], |
| 137 | |
| 138 | srcs: ["healthd_draw.cpp"], |
| 139 | } |
| 140 | |
| 141 | cc_library_static { |
| 142 | name: "libhealthd_charger", |
| 143 | local_include_dirs: ["include"], |
| 144 | export_include_dirs: [".", "include"], |
| 145 | |
| 146 | static_libs: [ |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 147 | "android.hardware.health@1.0-convert", |
| 148 | "libcharger_sysprop", |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 149 | "libhealthd_draw", |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 150 | "libhealthloop", |
| 151 | "libhealth2impl", |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 152 | "libminui", |
| 153 | ], |
| 154 | |
| 155 | shared_libs: [ |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 156 | "android.hardware.health@2.1", |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 157 | "libbase", |
| 158 | "libcutils", |
| 159 | "liblog", |
| 160 | "libpng", |
| 161 | "libsuspend", |
| 162 | "libutils", |
| 163 | ], |
| 164 | |
| 165 | srcs: [ |
| 166 | "healthd_mode_charger.cpp", |
| 167 | "AnimationParser.cpp", |
| 168 | ], |
| 169 | } |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 170 | |
| 171 | cc_defaults { |
| 172 | name: "charger_defaults", |
| 173 | |
| 174 | cflags: [ |
| 175 | "-Wall", |
| 176 | "-Werror", |
| 177 | ], |
| 178 | |
| 179 | shared_libs: [ |
| 180 | // common |
| 181 | "android.hardware.health@2.0", |
| 182 | "android.hardware.health@2.1", |
| 183 | "libbase", |
| 184 | "libcutils", |
| 185 | "libhidlbase", |
| 186 | "liblog", |
| 187 | "libutils", |
| 188 | |
| 189 | // system charger only |
| 190 | "libpng", |
| 191 | ], |
| 192 | |
| 193 | static_libs: [ |
| 194 | // common |
| 195 | "android.hardware.health@1.0-convert", |
| 196 | "libbatterymonitor", |
| 197 | "libcharger_sysprop", |
| 198 | "libhealthd_charger_nops", |
| 199 | "libhealthloop", |
| 200 | "libhealth2impl", |
| 201 | |
| 202 | // system charger only |
| 203 | "libhealthd_draw", |
| 204 | "libhealthd_charger", |
| 205 | "libminui", |
| 206 | "libsuspend", |
| 207 | ], |
| 208 | } |
| 209 | |
| 210 | cc_binary { |
| 211 | name: "charger", |
| 212 | defaults: ["charger_defaults"], |
| 213 | recovery_available: true, |
| 214 | srcs: [ |
| 215 | "charger.cpp", |
| 216 | "charger_utils.cpp", |
| 217 | ], |
| 218 | |
| 219 | target: { |
| 220 | recovery: { |
| 221 | // No UI and libsuspend for recovery charger. |
| 222 | cflags: [ |
| 223 | "-DCHARGER_FORCE_NO_UI=1", |
| 224 | ], |
| 225 | exclude_shared_libs: [ |
| 226 | "libpng", |
| 227 | ], |
| 228 | exclude_static_libs: [ |
| 229 | "libhealthd_draw", |
| 230 | "libhealthd_charger", |
| 231 | "libminui", |
| 232 | "libsuspend", |
| 233 | ], |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | cc_test { |
| 239 | name: "charger_test", |
| 240 | defaults: ["charger_defaults"], |
| 241 | srcs: ["charger_test.cpp"], |
| 242 | } |
Yifan Hong | 12d1575 | 2020-08-05 16:25:33 -0700 | [diff] [blame] | 243 | |
| 244 | cc_test { |
| 245 | name: "libhealthd_charger_test", |
| 246 | srcs: ["AnimationParser_test.cpp"], |
| 247 | shared_libs: [ |
| 248 | "liblog", |
| 249 | "libbase", |
| 250 | "libcutils", |
| 251 | ], |
| 252 | static_libs: [ |
| 253 | "libhealthd_charger", |
| 254 | ], |
Yifan Hong | 186b4d9 | 2020-08-05 16:30:43 -0700 | [diff] [blame^] | 255 | test_suites: [ |
| 256 | "general-tests", |
| 257 | "device-tests", |
| 258 | ], |
Yifan Hong | 12d1575 | 2020-08-05 16:25:33 -0700 | [diff] [blame] | 259 | } |