1// Copyright 2006 The Android Open Source Project
2
3package {
4    default_applicable_licenses: ["hardware_libhardware_license"],
5}
6
7// Added automatically by a large-scale-change that took the approach of
8// 'apply every license found to every target'. While this makes sure we respect
9// every license restriction, it may not be entirely correct.
10//
11// e.g. GPL in an MIT project might only apply to the contrib/ directory.
12//
13// Please consider splitting the single license below into multiple licenses,
14// taking care not to lose any license_kind information, and overriding the
15// default license using the 'licenses: [...]' property on targets as needed.
16//
17// For unused files, consider creating a 'fileGroup' with "//visibility:private"
18// to attach the license to, and including a comment whether the files may be
19// used in the current project.
20// See: http://go/android-license-faq
21license {
22    name: "hardware_libhardware_license",
23    visibility: [":__subpackages__"],
24    license_kinds: [
25        "SPDX-license-identifier-Apache-2.0",
26        "SPDX-license-identifier-BSD",
27    ],
28    license_text: [
29        "NOTICE",
30    ],
31}
32
33cc_library_headers {
34    name: "libhardware_headers",
35
36    header_libs: [
37        "libaudio_system_headers",
38        "libsystem_headers",
39        "libcutils_headers",
40    ],
41    export_header_lib_headers: [
42        "libaudio_system_headers",
43        "libsystem_headers",
44        "libcutils_headers",
45    ],
46
47    recovery_available: true,
48    vendor_available: true,
49    // TODO(b/153609531): remove when no longer needed.
50    native_bridge_supported: true,
51
52    // There are three include directories currently:
53    // - include: this directory is the original location of libhardware headers. It is globally
54    //       available (even if you do not depend on libhardware). Many locations also use
55    //       LOCAL_C_INCLUDES or include_dirs to access these from a global namespace. These processes
56    //       should replace this dependency with a direct dependency on libhardware(_headers)?.
57    // - include_all: this directory is for system and vendor include files. Gradually, the number of
58    //       files here should be reduced to 0 by moving them to vendor as old code is phased out.
59    // - include_vendor: this directory is the current designated resting place for these headers.
60    //       They are kept around to try to help insure existing codebases can function.
61    export_include_dirs: ["include_all"],
62
63    target: {
64        recovery: {
65            exclude_header_libs: [
66                "libaudio_system_headers",
67            ],
68        },
69        windows: {
70            enabled: true,
71        },
72        vendor: {
73            override_export_include_dirs: [
74                "include_all",
75                "include_vendor",
76            ],
77        },
78    },
79    apex_available: [
80        "//apex_available:platform",
81        "com.android.btservices",
82        "com.android.media",
83        "com.android.media.swcodec",
84    ],
85    min_sdk_version: "29",
86    host_supported: true,
87
88}
89
90cc_library_shared {
91    name: "libhardware",
92
93    srcs: ["hardware.c"],
94    shared_libs: [
95        "libapexsupport",
96        "libcutils",
97        "liblog",
98        "libvndksupport",
99    ],
100    cflags: [
101        "-DQEMU_HARDWARE",
102        "-Wall",
103        "-Werror",
104    ],
105
106    header_libs: ["libhardware_headers"],
107    export_header_lib_headers: ["libhardware_headers"],
108
109    host_supported: true,
110    recovery_available: true,
111    vendor_available: true,
112    double_loadable: true,
113    target: {
114        host: {
115            exclude_shared_libs: [
116                "libapexsupport",
117                "libvndksupport",
118            ],
119        },
120        recovery: {
121            exclude_shared_libs: [
122                "libapexsupport",
123                "libvndksupport",
124            ],
125        },
126        non_apex: {
127            exclude_shared_libs: [
128                "libapexsupport",
129            ],
130        },
131    },
132    min_sdk_version: "29",
133}
134