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 | ], |
Yifan Hong | 12df1b9 | 2017-09-25 17:25:00 -0700 | [diff] [blame] | 65 | } |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 66 | |
| 67 | cc_library_static { |
| 68 | name: "libhealthd_charger_nops", |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 69 | recovery_available: true, |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 70 | |
| 71 | srcs: [ |
| 72 | "healthd_mode_charger_nops.cpp", |
| 73 | ], |
| 74 | |
| 75 | cflags: [ |
| 76 | "-Wall", |
| 77 | "-Werror", |
| 78 | ], |
| 79 | |
| 80 | header_libs: [ |
| 81 | "libhealthd_headers", |
| 82 | ], |
| 83 | |
| 84 | static_libs: [ |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 85 | "libhealthloop", |
| 86 | "libhealth2impl", |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 87 | ], |
| 88 | |
| 89 | shared_libs: [ |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 90 | "android.hardware.health@2.1", |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 91 | "libutils", |
| 92 | ], |
| 93 | } |
Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 94 | |
| 95 | sysprop_library { |
| 96 | name: "charger_sysprop", |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 97 | recovery_available: true, |
Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 98 | srcs: ["charger.sysprop"], |
| 99 | property_owner: "Platform", |
| 100 | api_packages: ["android.sysprop"], |
| 101 | } |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 102 | |
| 103 | cc_library_static { |
| 104 | name: "libhealthd_draw", |
| 105 | export_include_dirs: ["."], |
| 106 | static_libs: [ |
| 107 | "libcharger_sysprop", |
| 108 | "libminui", |
| 109 | ], |
| 110 | shared_libs: [ |
| 111 | "libbase", |
| 112 | ], |
| 113 | header_libs: ["libbatteryservice_headers"], |
| 114 | |
| 115 | srcs: ["healthd_draw.cpp"], |
| 116 | } |
| 117 | |
| 118 | cc_library_static { |
| 119 | name: "libhealthd_charger", |
| 120 | local_include_dirs: ["include"], |
| 121 | export_include_dirs: [".", "include"], |
| 122 | |
| 123 | static_libs: [ |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 124 | "android.hardware.health@1.0-convert", |
| 125 | "libcharger_sysprop", |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 126 | "libhealthd_draw", |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 127 | "libhealthloop", |
| 128 | "libhealth2impl", |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 129 | "libminui", |
| 130 | ], |
| 131 | |
| 132 | shared_libs: [ |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 133 | "android.hardware.health@2.1", |
Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 134 | "libbase", |
| 135 | "libcutils", |
| 136 | "liblog", |
| 137 | "libpng", |
| 138 | "libsuspend", |
| 139 | "libutils", |
| 140 | ], |
| 141 | |
| 142 | srcs: [ |
| 143 | "healthd_mode_charger.cpp", |
| 144 | "AnimationParser.cpp", |
| 145 | ], |
| 146 | } |
Yifan Hong | 7dcf7b0 | 2019-10-08 17:27:11 -0700 | [diff] [blame] | 147 | |
| 148 | cc_defaults { |
| 149 | name: "charger_defaults", |
| 150 | |
| 151 | cflags: [ |
| 152 | "-Wall", |
| 153 | "-Werror", |
| 154 | ], |
| 155 | |
| 156 | shared_libs: [ |
| 157 | // common |
| 158 | "android.hardware.health@2.0", |
| 159 | "android.hardware.health@2.1", |
| 160 | "libbase", |
| 161 | "libcutils", |
| 162 | "libhidlbase", |
| 163 | "liblog", |
| 164 | "libutils", |
| 165 | |
| 166 | // system charger only |
| 167 | "libpng", |
| 168 | ], |
| 169 | |
| 170 | static_libs: [ |
| 171 | // common |
| 172 | "android.hardware.health@1.0-convert", |
| 173 | "libbatterymonitor", |
| 174 | "libcharger_sysprop", |
| 175 | "libhealthd_charger_nops", |
| 176 | "libhealthloop", |
| 177 | "libhealth2impl", |
| 178 | |
| 179 | // system charger only |
| 180 | "libhealthd_draw", |
| 181 | "libhealthd_charger", |
| 182 | "libminui", |
| 183 | "libsuspend", |
| 184 | ], |
| 185 | } |
| 186 | |
| 187 | cc_binary { |
| 188 | name: "charger", |
| 189 | defaults: ["charger_defaults"], |
| 190 | recovery_available: true, |
| 191 | srcs: [ |
| 192 | "charger.cpp", |
| 193 | "charger_utils.cpp", |
| 194 | ], |
| 195 | |
| 196 | target: { |
| 197 | recovery: { |
| 198 | // No UI and libsuspend for recovery charger. |
| 199 | cflags: [ |
| 200 | "-DCHARGER_FORCE_NO_UI=1", |
| 201 | ], |
| 202 | exclude_shared_libs: [ |
| 203 | "libpng", |
| 204 | ], |
| 205 | exclude_static_libs: [ |
| 206 | "libhealthd_draw", |
| 207 | "libhealthd_charger", |
| 208 | "libminui", |
| 209 | "libsuspend", |
| 210 | ], |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | cc_test { |
| 216 | name: "charger_test", |
| 217 | defaults: ["charger_defaults"], |
| 218 | srcs: ["charger_test.cpp"], |
| 219 | } |
Yifan Hong | 12d1575 | 2020-08-05 16:25:33 -0700 | [diff] [blame] | 220 | |
| 221 | cc_test { |
| 222 | name: "libhealthd_charger_test", |
Yifan Hong | c2bed97 | 2020-08-07 16:27:49 -0700 | [diff] [blame] | 223 | defaults: ["charger_defaults"], |
| 224 | srcs: [ |
| 225 | "AnimationParser_test.cpp", |
| 226 | "healthd_mode_charger_test.cpp" |
Yifan Hong | 12d1575 | 2020-08-05 16:25:33 -0700 | [diff] [blame] | 227 | ], |
| 228 | static_libs: [ |
Yifan Hong | c2bed97 | 2020-08-07 16:27:49 -0700 | [diff] [blame] | 229 | "libgmock", |
Yifan Hong | 12d1575 | 2020-08-05 16:25:33 -0700 | [diff] [blame] | 230 | ], |
Yifan Hong | 186b4d9 | 2020-08-05 16:30:43 -0700 | [diff] [blame] | 231 | test_suites: [ |
| 232 | "general-tests", |
| 233 | "device-tests", |
| 234 | ], |
Yifan Hong | c2bed97 | 2020-08-07 16:27:49 -0700 | [diff] [blame] | 235 | data: [ |
| 236 | ":libhealthd_charger_test_data", |
| 237 | ], |
| 238 | require_root: true, |
Yifan Hong | 12d1575 | 2020-08-05 16:25:33 -0700 | [diff] [blame] | 239 | } |
Yifan Hong | 5109c8c | 2020-08-05 18:24:25 -0700 | [diff] [blame] | 240 | |
| 241 | // /system/etc/res/images/charger/battery_fail.png |
| 242 | prebuilt_etc { |
| 243 | name: "system_core_charger_res_images_battery_fail.png", |
| 244 | src: "images/battery_fail.png", |
| 245 | relative_install_path: "res/images/charger", |
| 246 | filename: "battery_fail.png", |
| 247 | } |
| 248 | |
| 249 | // /system/etc/res/images/charger/battery_scale.png |
| 250 | prebuilt_etc { |
| 251 | name: "system_core_charger_res_images_battery_scale.png", |
| 252 | src: "images/battery_scale.png", |
| 253 | relative_install_path: "res/images/charger", |
| 254 | filename: "battery_scale.png", |
| 255 | } |
| 256 | |
| 257 | phony { |
| 258 | name: "charger_res_images", |
| 259 | required: [ |
| 260 | "system_core_charger_res_images_battery_fail.png", |
| 261 | "system_core_charger_res_images_battery_scale.png", |
| 262 | ], |
| 263 | } |