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
15package {
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 "bootable_recovery_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["bootable_recovery_license"],
22}
23
24cc_defaults {
25    name: "librecovery_utils_defaults",
26
27    defaults: [
28        "recovery_defaults",
29    ],
30
31    shared_libs: [
32        "android.hardware.health@2.0",
33        "libbase",
34        "libext4_utils",
35        "libfs_mgr",
36        "libhidlbase",
37        "libselinux",
38        "libutils",
39    ],
40
41    static_libs: [
42        "libotautil",
43
44        // External dependencies.
45        "libfstab",
46        "libhealthhalutils",
47    ],
48}
49
50// A utility lib that's local to recovery (in contrast, libotautil is exposed to device-specific
51// recovery_ui lib as well as device-specific updater).
52cc_library_static {
53    name: "librecovery_utils",
54
55    recovery_available: true,
56
57    defaults: [
58        "librecovery_utils_defaults",
59    ],
60
61    srcs: [
62        "battery_utils.cpp",
63        "logging.cpp",
64        "parse_install_logs.cpp",
65        "roots.cpp",
66        "thermalutil.cpp",
67    ],
68
69    header_libs: [
70        "libvold_headers",
71    ],
72
73    export_include_dirs: [
74        "include",
75    ],
76
77    export_static_lib_headers: [
78        // roots.h includes <fstab/fstab.h>.
79        "libfstab",
80    ],
81
82    // Should avoid exposing to the libs that might be used in device-specific codes (e.g.
83    // libedify, libotautil, librecovery_ui).
84    visibility: [
85        "//bootable/recovery",
86        "//bootable/recovery/install",
87        "//bootable/recovery/minadbd",
88        "//bootable/recovery/tests",
89    ],
90}
91