xref: /aosp_15_r20/frameworks/av/apex/Android.bp (revision ec779b8e0859a360c3d303172224686826e6e0e1)
1// Copyright (C) 2018 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 "frameworks_av_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["frameworks_av_license"],
22}
23
24apex_defaults {
25    name: "com.android.media-defaults",
26    bootclasspath_fragments: ["com.android.media-bootclasspath-fragment"],
27    systemserverclasspath_fragments: ["com.android.media-systemserverclasspath-fragment"],
28    multilib: {
29        first: {
30            // Extractor process runs only with the primary ABI.
31            native_shared_libs: [
32                // Extractor plugins
33                "libaacextractor",
34                "libamrextractor",
35                "libflacextractor",
36                "libmidiextractor",
37                "libmkvextractor",
38                "libmp3extractor",
39                "libmp4extractor",
40                "libmpeg2extractor",
41                "liboggextractor",
42                "libwavextractor",
43            ],
44            // Transcoding service only run with primary ABI.
45            binaries: [
46                "mediatranscoding",
47            ],
48        },
49    },
50    // JNI
51    native_shared_libs: [
52        "libmediaparser-jni",
53        "libmediaformatshaper",
54    ],
55    compile_multilib: "both",
56    prebuilts: [
57        "code_coverage.policy",
58        "com.android.media-mediatranscoding.rc",
59        "com.android.media-mediatranscoding.32rc",
60        "crash_dump.policy",
61        "mediaextractor.policy",
62        "media-linker-config",
63    ],
64    key: "com.android.media.key",
65    certificate: ":com.android.media.certificate",
66
67    // Use a custom AndroidManifest.xml used for API targeting.
68    androidManifest: ":com.android.media-androidManifest",
69
70    // IMPORTANT: q-launched-dcla-enabled-apex-module enables the build system to make
71    // sure the package compatible to Android 10 in two ways(if flag APEX_BUILD_FOR_PRE_S_DEVICES=1
72    // is set):
73    // - build the APEX package compatible to Android 10
74    //   so that the package can be installed.
75    // - build artifacts (lib/javalib/bin) against Android 10 SDK
76    //   so that the artifacts can run.
77    // If the flag is not set, the package is built to be compatible with Android 12.
78    defaults: ["q-launched-dcla-enabled-apex-module"],
79    // Indicates that pre-installed version of this apex can be compressed.
80    // Whether it actually will be compressed is controlled on per-device basis.
81    compressible: true,
82}
83
84apex {
85    name: "com.android.media",
86    manifest: "manifest.json",
87    defaults: ["com.android.media-defaults"],
88    prebuilts: ["current_sdkinfo"],
89}
90
91linker_config {
92    name: "media-linker-config",
93    src: "linker.config.json",
94    installable: false,
95}
96
97// Encapsulate the contributions made by the com.android.media to the bootclasspath.
98bootclasspath_fragment {
99    name: "com.android.media-bootclasspath-fragment",
100    contents: ["updatable-media"],
101    apex_available: ["com.android.media"],
102
103    api: {
104        stub_libs: [
105            // Stubs for the APIs provided by updatable-media. This has to be
106            // specified explicitly because updatable-media is not a
107            // java_sdk_library.
108            "framework-media",
109        ],
110    },
111
112    // The bootclasspath_fragments that provide APIs on which this depends.
113    fragments: [
114        {
115            apex: "com.android.art",
116            module: "art-bootclasspath-fragment",
117        },
118    ],
119
120    // Additional stubs libraries that this fragment's contents use which are
121    // not provided by another bootclasspath_fragment.
122    additional_stubs: [
123        "android-non-updatable",
124    ],
125
126    // Additional hidden API flag files to override the defaults. This must only be
127    // modified by the Soong or platform compat team.
128    hidden_api: {
129        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
130
131        // The following packages contain classes from other modules on the
132        // bootclasspath. That means that the hidden API flags for this module
133        // has to explicitly list every single class this module provides in
134        // that package to differentiate them from the classes provided by other
135        // modules. That can include private classes that are not part of the
136        // API.
137        split_packages: [
138            "android.media",
139        ],
140
141        // The following packages and all their subpackages currently only
142        // contain classes from this bootclasspath_fragment. Listing a package
143        // here won't prevent other bootclasspath modules from adding classes in
144        // any of those packages but it will prevent them from adding those
145        // classes into an API surface, e.g. public, system, etc.. Doing so will
146        // result in a build failure due to inconsistent flags.
147        package_prefixes: [
148            "android.media.internal",
149        ],
150    },
151}
152
153// Encapsulate the contributions made by the com.android.media to the systemserverclasspath.
154systemserverclasspath_fragment {
155    name: "com.android.media-systemserverclasspath-fragment",
156    contents: ["service-media-s"],
157    apex_available: ["com.android.media"],
158}
159
160filegroup {
161    name: "com.android.media-androidManifest",
162    srcs: ["AndroidManifest-media.xml"],
163}
164
165filegroup {
166    name: "com.android.media.swcodec-androidManifest",
167    srcs: ["AndroidManifest-swcodec.xml"],
168}
169
170apex_defaults {
171    name: "com.android.media.swcodec-defaults",
172    binaries: [
173        "mediaswcodec",
174    ],
175    native_shared_libs: [
176        "libapexcodecs",
177        "[email protected]",
178        "[email protected]",
179        "[email protected]",
180        "libstagefright_foundation",
181    ],
182    prebuilts: [
183        "com.android.media.swcodec-mediaswcodec.rc",
184        "com.android.media.swcodec-mediaswcodec.32rc",
185        "com.android.media.swcodec-ld.config.txt",
186        "mediaswcodec.policy",
187        "code_coverage.policy",
188        "crash_dump.policy",
189        "mediaswcodec.xml",
190    ],
191    key: "com.android.media.swcodec.key",
192    certificate: ":com.android.media.swcodec.certificate",
193
194    // Use a custom AndroidManifest.xml used for API targeting.
195    androidManifest: ":com.android.media.swcodec-androidManifest",
196
197    // IMPORTANT: q-launched-dcla-enabled-apex-module enables the build system to make
198    // sure the package compatible to Android 10 in two ways(if flag APEX_BUILD_FOR_PRE_S_DEVICES=1
199    // is set):
200    // - build the APEX package compatible to Android 10
201    //   so that the package can be installed.
202    // - build artifacts (lib/javalib/bin) against Android 10 SDK
203    //   so that the artifacts can run.
204    // If the flag is not set, the package is built to be compatible with Android 12.
205    defaults: ["q-launched-dcla-enabled-apex-module"],
206    // Indicates that pre-installed version of this apex can be compressed.
207    // Whether it actually will be compressed is controlled on per-device basis.
208    compressible: true,
209}
210
211// install as mediatranscoding.* and mediaswcodec.* instead of init.*
212// so we are ready for day we have more than 1 *rc file within the apex.
213
214prebuilt_etc {
215    name: "com.android.media-mediatranscoding.rc",
216    src: "mediatranscoding.rc",
217    filename: "mediatranscoding.rc",
218    installable: false,
219}
220
221prebuilt_etc {
222    name: "com.android.media-mediatranscoding.32rc",
223    src: "mediatranscoding.32rc",
224    filename: "mediatranscoding.32rc",
225    installable: false,
226}
227
228prebuilt_etc {
229    name: "com.android.media.swcodec-mediaswcodec.rc",
230    src: "mediaswcodec.rc",
231    filename: "mediaswcodec.rc",
232    installable: false,
233}
234
235prebuilt_etc {
236    name: "com.android.media.swcodec-mediaswcodec.32rc",
237    src: "mediaswcodec.32rc",
238    filename: "mediaswcodec.32rc",
239    installable: false,
240}
241
242prebuilt_etc {
243    name: "com.android.media.swcodec-ld.config.txt",
244    src: "ld.config.txt",
245    filename: "ld.config.txt",
246    installable: false,
247}
248
249apex {
250    name: "com.android.media.swcodec",
251    manifest: "manifest_codec.json",
252    defaults: ["com.android.media.swcodec-defaults"],
253}
254
255apex_key {
256    name: "com.android.media.key",
257    public_key: "com.android.media.avbpubkey",
258    private_key: "com.android.media.pem",
259}
260
261apex_key {
262    name: "com.android.media.swcodec.key",
263    public_key: "com.android.media.swcodec.avbpubkey",
264    private_key: "com.android.media.swcodec.pem",
265}
266
267android_app_certificate {
268    name: "com.android.media.certificate",
269    certificate: "com.android.media",
270}
271
272android_app_certificate {
273    name: "com.android.media.swcodec.certificate",
274    certificate: "com.android.media.swcodec",
275}
276