1// Copyright (C) 2016-2020 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 "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
24cc_library_static {
25    name: "android.hardware.drm@1.0-helper",
26    vendor_available: true,
27    defaults: ["hidl_defaults"],
28    srcs: [
29        "SharedLibrary.cpp",
30    ],
31    cflags: [
32        "-Werror",
33        "-Wextra",
34        "-Wall",
35        "-Wthread-safety",
36    ],
37    shared_libs: [
38        "liblog",
39    ],
40    header_libs: [
41        "libutils_headers",
42    ],
43    export_header_lib_headers: [
44        "libutils_headers",
45    ],
46    export_include_dirs: ["include"],
47}
48
49soong_config_module_type {
50    name: "android_hardware_drm_1_0_multilib",
51    module_type: "cc_defaults",
52    config_namespace: "ANDROID",
53    bool_variables: ["TARGET_ENABLE_MEDIADRM_64"],
54    properties: ["compile_multilib"],
55}
56
57android_hardware_drm_1_0_multilib {
58    name: "android.hardware.drm@1.0-multilib-lib",
59    compile_multilib: "prefer32",
60    soong_config_variables: {
61        TARGET_ENABLE_MEDIADRM_64: {
62            compile_multilib: "both",
63        },
64    },
65}
66
67android_hardware_drm_1_0_multilib {
68    name: "android.hardware.drm@1.0-multilib-exe",
69    compile_multilib: "prefer32",
70    soong_config_variables: {
71        TARGET_ENABLE_MEDIADRM_64: {
72            compile_multilib: "first",
73        },
74    },
75}
76
77cc_defaults {
78    name: "android.hardware.drm@1.0-service-defaults",
79    proprietary: true,
80    relative_install_path: "hw",
81    include_dirs: ["hardware/interfaces/drm"],
82    header_libs: ["media_plugin_headers"],
83    static_libs: ["android.hardware.drm@1.0-helper"],
84
85    shared_libs: [
86        "android.hardware.drm@1.0",
87        "android.hidl.memory@1.0",
88        "libhidlbase",
89        "libhardware",
90        "liblog",
91        "libutils",
92        "libbinder",
93    ],
94}
95
96//############ Build legacy drm service ############
97
98cc_binary {
99    name: "android.hardware.drm@1.0-service",
100    defaults: [
101        "android.hardware.drm@1.0-multilib-exe",
102        "android.hardware.drm@1.0-service-defaults",
103    ],
104    init_rc: ["android.hardware.drm@1.0-service.rc"],
105    srcs: ["service.cpp"],
106}
107
108//############ Build legacy drm lazy service ############
109
110cc_binary {
111    name: "android.hardware.drm@1.0-service-lazy",
112    defaults: [
113        "android.hardware.drm@1.0-multilib-exe",
114        "android.hardware.drm@1.0-service-defaults",
115    ],
116    overrides: ["android.hardware.drm@1.0-service"],
117    init_rc: ["android.hardware.drm@1.0-service-lazy.rc"],
118    srcs: ["serviceLazy.cpp"],
119}
120
121//############ Build legacy drm impl library ############
122
123cc_library_shared {
124    name: "android.hardware.drm@1.0-impl",
125    defaults: ["android.hardware.drm@1.0-multilib-lib"],
126    proprietary: true,
127    relative_install_path: "hw",
128
129    include_dirs: [
130        "frameworks/native/include",
131        "frameworks/av/include",
132    ],
133
134    shared_libs: [
135        "android.hardware.drm@1.0",
136        "android.hidl.memory@1.0",
137        "libcutils",
138        "libhidlbase",
139        "libhidlmemory",
140        "liblog",
141        "libstagefright_foundation",
142        "libutils",
143    ],
144
145    static_libs: ["android.hardware.drm@1.0-helper"],
146
147    srcs: [
148        "DrmFactory.cpp",
149        "DrmPlugin.cpp",
150        "CryptoFactory.cpp",
151        "CryptoPlugin.cpp",
152        "LegacyPluginPath.cpp",
153        "TypeConvert.cpp",
154    ],
155}
156