blob: 08b3180325babfc7f534b55fe00fc59903d0ee12 [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 {
Cole Faustbe7e47f2024-10-22 16:30:58 -070025 name: "filterPowerSupplyEvents.o_non_vendor",
26 srcs: ["filterPowerSupplyEvents.c"],
27 visibility: ["//visibility:private"],
28}
29
30bpf {
Bart Van Assche5c604b92024-07-29 14:22:31 -070031 name: "filterPowerSupplyEvents.o",
32 srcs: ["filterPowerSupplyEvents.c"],
33 // "vendor: true" because all binaries that use this BPF filter are vendor
34 // binaries.
35 vendor: true,
36}
37
38// Since "required" sections are ignored in static library definitions,
39// filterPowerSupplyEvents.o has been added in
40// build/make/target/product/base_vendor.mk.
Yifan Hong50c9e252019-10-03 16:26:13 -070041cc_library_static {
42 name: "libhealthloop",
43 vendor_available: true,
44 recovery_available: true,
45 srcs: [
46 "HealthLoop.cpp",
47 "utils.cpp",
48 ],
49 shared_libs: [
Yifan Hong50c9e252019-10-03 16:26:13 -070050 "libbase",
Bart Van Asschece06c8b2024-07-22 11:20:35 -070051 "libcutils",
Yifan Hong50c9e252019-10-03 16:26:13 -070052 ],
53 header_libs: [
Bart Van Assche5c604b92024-07-29 14:22:31 -070054 "bpf_headers",
Yifan Hong50c9e252019-10-03 16:26:13 -070055 "libbatteryservice_headers",
56 "libhealthd_headers",
57 "libutils_headers",
58 ],
59 export_include_dirs: [
60 "include",
61 ],
62}
Bart Van Assche5c604b92024-07-29 14:22:31 -070063
Cole Faustbe7e47f2024-10-22 16:30:58 -070064cc_genrule {
Bart Van Assche5c604b92024-07-29 14:22:31 -070065 name: "filterPowerSupplyEvents.h",
66 out: ["filterPowerSupplyEvents.h"],
Cole Faustbe7e47f2024-10-22 16:30:58 -070067 srcs: [":filterPowerSupplyEvents.o_non_vendor"],
Bart Van Assche5c604b92024-07-29 14:22:31 -070068 cmd: "cat $(in) | od -v -tx1 | cut -c9- | grep -v '^$$' | sed 's/^/0x/;s/ /, 0x/g;s/^, //;s/$$/,/' > $(out)",
69}
70
71cc_test_host {
72 name: "filterPowerSupplyEventsTest",
73 team: "trendy_team_pixel_system_sw_storage",
74 srcs: [
75 "filterPowerSupplyEventsTest.cpp",
76 ],
77 shared_libs: [
78 "libbase",
79 "libbpf",
80 ],
81 static_libs: [
82 "libgmock",
83 ],
84 generated_headers: [
Bart Van Assche5c604b92024-07-29 14:22:31 -070085 "libbpf_headers",
86 ],
Cole Faustbe7e47f2024-10-22 16:30:58 -070087 device_first_generated_headers: [
88 "filterPowerSupplyEvents.h",
89 ],
Bart Van Assche5c604b92024-07-29 14:22:31 -070090 compile_multilib: "64",
91}