Yifan Hong | 50c9e25 | 2019-10-03 16:26:13 -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 | |
Bob Badour | b224b36 | 2021-02-12 20:13:01 -0800 | [diff] [blame] | 15 | package { |
| 16 | // See: http://go/android-license-faq |
| 17 | // A large-scale-change added 'default_applicable_licenses' to import |
| 18 | // all of the 'license_kinds' from "hardware_interfaces_license" |
| 19 | // to get the below license kinds: |
| 20 | // SPDX-license-identifier-Apache-2.0 |
| 21 | default_applicable_licenses: ["hardware_interfaces_license"], |
| 22 | } |
| 23 | |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame^] | 24 | bpf { |
| 25 | name: "filterPowerSupplyEvents.o", |
| 26 | srcs: ["filterPowerSupplyEvents.c"], |
| 27 | // "vendor: true" because all binaries that use this BPF filter are vendor |
| 28 | // binaries. |
| 29 | vendor: true, |
| 30 | } |
| 31 | |
| 32 | // Since "required" sections are ignored in static library definitions, |
| 33 | // filterPowerSupplyEvents.o has been added in |
| 34 | // build/make/target/product/base_vendor.mk. |
Yifan Hong | 50c9e25 | 2019-10-03 16:26:13 -0700 | [diff] [blame] | 35 | cc_library_static { |
| 36 | name: "libhealthloop", |
| 37 | vendor_available: true, |
| 38 | recovery_available: true, |
| 39 | srcs: [ |
| 40 | "HealthLoop.cpp", |
| 41 | "utils.cpp", |
| 42 | ], |
| 43 | shared_libs: [ |
Yifan Hong | 50c9e25 | 2019-10-03 16:26:13 -0700 | [diff] [blame] | 44 | "libbase", |
Bart Van Assche | ce06c8b | 2024-07-22 11:20:35 -0700 | [diff] [blame] | 45 | "libcutils", |
Yifan Hong | 50c9e25 | 2019-10-03 16:26:13 -0700 | [diff] [blame] | 46 | ], |
| 47 | header_libs: [ |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame^] | 48 | "bpf_headers", |
Yifan Hong | 50c9e25 | 2019-10-03 16:26:13 -0700 | [diff] [blame] | 49 | "libbatteryservice_headers", |
| 50 | "libhealthd_headers", |
| 51 | "libutils_headers", |
| 52 | ], |
| 53 | export_include_dirs: [ |
| 54 | "include", |
| 55 | ], |
| 56 | } |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame^] | 57 | |
| 58 | genrule { |
| 59 | name: "filterPowerSupplyEvents.h", |
| 60 | out: ["filterPowerSupplyEvents.h"], |
| 61 | srcs: [":filterPowerSupplyEvents.o"], |
| 62 | cmd: "cat $(in) | od -v -tx1 | cut -c9- | grep -v '^$$' | sed 's/^/0x/;s/ /, 0x/g;s/^, //;s/$$/,/' > $(out)", |
| 63 | } |
| 64 | |
| 65 | cc_test_host { |
| 66 | name: "filterPowerSupplyEventsTest", |
| 67 | team: "trendy_team_pixel_system_sw_storage", |
| 68 | srcs: [ |
| 69 | "filterPowerSupplyEventsTest.cpp", |
| 70 | ], |
| 71 | shared_libs: [ |
| 72 | "libbase", |
| 73 | "libbpf", |
| 74 | ], |
| 75 | static_libs: [ |
| 76 | "libgmock", |
| 77 | ], |
| 78 | generated_headers: [ |
| 79 | "filterPowerSupplyEvents.h", |
| 80 | "libbpf_headers", |
| 81 | ], |
| 82 | compile_multilib: "64", |
| 83 | } |