blob: 4ebc57512f4d8a8f887f5c42d5b801a252558b55 [file] [log] [blame]
Yifan Hong50c9e252019-10-03 16:26:13 -07001// 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 Badourb224b362021-02-12 20:13:01 -080015package {
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 Assche5c604b92024-07-29 14:22:31 -070024bpf {
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 Hong50c9e252019-10-03 16:26:13 -070035cc_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 Hong50c9e252019-10-03 16:26:13 -070044 "libbase",
Bart Van Asschece06c8b2024-07-22 11:20:35 -070045 "libcutils",
Yifan Hong50c9e252019-10-03 16:26:13 -070046 ],
47 header_libs: [
Bart Van Assche5c604b92024-07-29 14:22:31 -070048 "bpf_headers",
Yifan Hong50c9e252019-10-03 16:26:13 -070049 "libbatteryservice_headers",
50 "libhealthd_headers",
51 "libutils_headers",
52 ],
53 export_include_dirs: [
54 "include",
55 ],
56}
Bart Van Assche5c604b92024-07-29 14:22:31 -070057
58genrule {
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
65cc_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}