blob: 08b3180325babfc7f534b55fe00fc59903d0ee12 [file] [log] [blame] [edit]
// Copyright (C) 2019 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["hardware_interfaces_license"],
}
bpf {
name: "filterPowerSupplyEvents.o_non_vendor",
srcs: ["filterPowerSupplyEvents.c"],
visibility: ["//visibility:private"],
}
bpf {
name: "filterPowerSupplyEvents.o",
srcs: ["filterPowerSupplyEvents.c"],
// "vendor: true" because all binaries that use this BPF filter are vendor
// binaries.
vendor: true,
}
// Since "required" sections are ignored in static library definitions,
// filterPowerSupplyEvents.o has been added in
// build/make/target/product/base_vendor.mk.
cc_library_static {
name: "libhealthloop",
vendor_available: true,
recovery_available: true,
srcs: [
"HealthLoop.cpp",
"utils.cpp",
],
shared_libs: [
"libbase",
"libcutils",
],
header_libs: [
"bpf_headers",
"libbatteryservice_headers",
"libhealthd_headers",
"libutils_headers",
],
export_include_dirs: [
"include",
],
}
cc_genrule {
name: "filterPowerSupplyEvents.h",
out: ["filterPowerSupplyEvents.h"],
srcs: [":filterPowerSupplyEvents.o_non_vendor"],
cmd: "cat $(in) | od -v -tx1 | cut -c9- | grep -v '^$$' | sed 's/^/0x/;s/ /, 0x/g;s/^, //;s/$$/,/' > $(out)",
}
cc_test_host {
name: "filterPowerSupplyEventsTest",
team: "trendy_team_pixel_system_sw_storage",
srcs: [
"filterPowerSupplyEventsTest.cpp",
],
shared_libs: [
"libbase",
"libbpf",
],
static_libs: [
"libgmock",
],
generated_headers: [
"libbpf_headers",
],
device_first_generated_headers: [
"filterPowerSupplyEvents.h",
],
compile_multilib: "64",
}