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 { |
Cole Faust | be7e47f | 2024-10-22 16:30:58 -0700 | [diff] [blame] | 25 | name: "filterPowerSupplyEvents.o_non_vendor", |
| 26 | srcs: ["filterPowerSupplyEvents.c"], |
| 27 | visibility: ["//visibility:private"], |
| 28 | } |
| 29 | |
| 30 | bpf { |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame] | 31 | 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 Hong | 50c9e25 | 2019-10-03 16:26:13 -0700 | [diff] [blame] | 41 | cc_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 Hong | 50c9e25 | 2019-10-03 16:26:13 -0700 | [diff] [blame] | 50 | "libbase", |
Bart Van Assche | ce06c8b | 2024-07-22 11:20:35 -0700 | [diff] [blame] | 51 | "libcutils", |
Yifan Hong | 50c9e25 | 2019-10-03 16:26:13 -0700 | [diff] [blame] | 52 | ], |
| 53 | header_libs: [ |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame] | 54 | "bpf_headers", |
Yifan Hong | 50c9e25 | 2019-10-03 16:26:13 -0700 | [diff] [blame] | 55 | "libbatteryservice_headers", |
| 56 | "libhealthd_headers", |
| 57 | "libutils_headers", |
| 58 | ], |
| 59 | export_include_dirs: [ |
| 60 | "include", |
| 61 | ], |
| 62 | } |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame] | 63 | |
Cole Faust | be7e47f | 2024-10-22 16:30:58 -0700 | [diff] [blame] | 64 | cc_genrule { |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame] | 65 | name: "filterPowerSupplyEvents.h", |
| 66 | out: ["filterPowerSupplyEvents.h"], |
Cole Faust | be7e47f | 2024-10-22 16:30:58 -0700 | [diff] [blame] | 67 | srcs: [":filterPowerSupplyEvents.o_non_vendor"], |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame] | 68 | cmd: "cat $(in) | od -v -tx1 | cut -c9- | grep -v '^$$' | sed 's/^/0x/;s/ /, 0x/g;s/^, //;s/$$/,/' > $(out)", |
| 69 | } |
| 70 | |
| 71 | cc_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 Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame] | 85 | "libbpf_headers", |
| 86 | ], |
Cole Faust | be7e47f | 2024-10-22 16:30:58 -0700 | [diff] [blame] | 87 | device_first_generated_headers: [ |
| 88 | "filterPowerSupplyEvents.h", |
| 89 | ], |
Bart Van Assche | 5c604b9 | 2024-07-29 14:22:31 -0700 | [diff] [blame] | 90 | compile_multilib: "64", |
| 91 | } |