1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "art_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["art_license"],
8}
9
10cc_defaults {
11    name: "libnativebridge-defaults",
12    defaults: ["art_defaults"],
13    header_libs: [
14        "jni_headers",
15        "libnativebridge-headers",
16    ],
17    export_header_lib_headers: [
18        "jni_headers",
19        "libnativebridge-headers",
20    ],
21}
22
23cc_library_headers {
24    name: "libnativebridge-headers",
25
26    host_supported: true,
27    export_include_dirs: ["include"],
28
29    apex_available: [
30        "//apex_available:platform",
31        "com.android.art",
32        "com.android.art.debug",
33        "com.android.media",
34    ],
35    min_sdk_version: "S",
36}
37
38art_cc_library {
39    name: "libnativebridge",
40    defaults: ["libnativebridge-defaults"],
41    visibility: [
42        "//frameworks/base/cmds/app_process",
43        // TODO(b/133140750): Clean this up.
44        "//frameworks/base/native/webview/loader/libwebviewchromium_loader",
45    ],
46    apex_available: [
47        "com.android.art",
48        "com.android.art.debug",
49    ],
50
51    host_supported: true,
52    srcs: ["native_bridge.cc"],
53    header_libs: [
54        "libbase_headers",
55    ],
56    shared_libs: [
57        "liblog",
58    ],
59    // TODO(jiyong): remove this line after aosp/885921 lands
60    export_include_dirs: ["include"],
61
62    target: {
63        android: {
64            header_libs: [
65                "libnativeloader-headers", // For dlext_namespaces.h
66            ],
67            shared_libs: ["libdl_android"],
68        },
69    },
70
71    stubs: {
72        symbol_file: "libnativebridge.map.txt",
73        versions: ["1"],
74    },
75}
76
77// TODO(b/124250621): eliminate the need for this library
78cc_library {
79    name: "libnativebridge_lazy",
80    defaults: ["libnativebridge-defaults"],
81    visibility: [
82        "//art/libnativebridge/tests",
83        "//frameworks/base/core/jni",
84        "//frameworks/native/opengl/libs",
85        "//frameworks/native/vulkan/libvulkan",
86    ],
87    apex_available: [
88        "//apex_available:platform",
89        "com.android.media",
90        "com.android.media.swcodec",
91    ],
92
93    host_supported: false,
94    srcs: ["native_bridge_lazy.cc"],
95    runtime_libs: ["libnativebridge"],
96    shared_libs: ["liblog"],
97}
98
99subdirs = ["tests"]
100