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 "hardware_interfaces_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["hardware_interfaces_license"],
8}
9
10cc_library_static {
11    name: "libcasexampleimpl",
12    vendor_available: true,
13
14    srcs: [
15        "CasImpl.cpp",
16        "DescramblerImpl.cpp",
17        "MediaCasService.cpp",
18        "SharedLibrary.cpp",
19        "TypeConvert.cpp",
20    ],
21
22    shared_libs: [
23        "android.hardware.cas-V1-ndk",
24        "libbase",
25        "libbinder_ndk",
26        "liblog",
27        "libutils",
28        "libcutils",
29        "libvndksupport",
30    ],
31    static_libs: [
32        "libaidlcommonsupport",
33    ],
34    header_libs: [
35        "libstagefright_foundation_headers",
36        "media_plugin_headers",
37    ],
38}
39
40cc_defaults {
41    name: "cas_service_example_defaults",
42    vendor: true,
43    relative_install_path: "hw",
44
45    srcs: ["service.cpp"],
46
47    stl: "c++_static",
48    static_libs: [
49        "android.hardware.cas-V1-ndk",
50        "android.hardware.common-V2-ndk",
51        "libaidlcommonsupport",
52        "libbase",
53        "libcasexampleimpl",
54        "libcutils",
55        "libutils",
56    ],
57    shared_libs: [
58        "libbinder_ndk",
59        "liblog",
60    ],
61    header_libs: ["media_plugin_headers"],
62}
63
64cc_binary {
65    name: "android.hardware.cas-service.example",
66    defaults: ["cas_service_example_defaults"],
67    // Installed in APEX
68    installable: false,
69}
70
71// TODO(b/297467514) Convert to VAPEX
72cc_binary {
73    name: "android.hardware.cas-service.example-lazy",
74    defaults: ["cas_service_example_defaults"],
75    init_rc: ["cas-default-lazy.rc"],
76    vintf_fragments: ["android.hardware.cas-service.xml"],
77    cflags: ["-DLAZY_SERVICE"],
78    overrides: ["com.android.hardware.cas"],
79}
80
81cc_fuzz {
82    name: "android.hardware.cas-service_fuzzer",
83    // TODO(b/307611931): avoid fuzzing on vendor until hermiticity issue is fixed
84    // vendor: true,
85
86    defaults: ["service_fuzzer_defaults"],
87    srcs: ["fuzzer.cpp"],
88
89    shared_libs: [
90        "android.hardware.cas-V1-ndk",
91        "libcutils",
92        "liblog",
93        "libvndksupport",
94    ],
95    static_libs: [
96        "libaidlcommonsupport",
97        "libcasexampleimpl",
98    ],
99    header_libs: ["media_plugin_headers"],
100    fuzz_config: {
101        componentid: 1344,
102    },
103}
104
105apex {
106    name: "com.android.hardware.cas",
107    manifest: "manifest.json",
108    file_contexts: "file_contexts",
109    key: "com.android.hardware.key",
110    certificate: ":com.android.hardware.certificate",
111    updatable: false,
112    vendor: true,
113
114    binaries: [
115        "android.hardware.cas-service.example",
116    ],
117    prebuilts: [
118        "cas-default.rc",
119        "android.hardware.cas-service.xml",
120    ],
121}
122
123prebuilt_etc {
124    name: "cas-default.rc",
125    src: "cas-default.rc",
126    installable: false,
127}
128
129prebuilt_etc {
130    name: "android.hardware.cas-service.xml",
131    src: "android.hardware.cas-service.xml",
132    sub_dir: "vintf",
133    installable: false,
134}
135