1/*
2 * Copyright (C) 2024 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    // See: http://go/android-license-faq
19    default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
22apex {
23    name: "com.android.mediaprovider",
24    defaults: ["com.android.mediaprovider-defaults"],
25    manifest: "apex_manifest.json",
26    apps: ["MediaProvider"],
27    compat_configs: [
28        "media-provider-platform-compat-config",
29        "framework-pdf-v-platform-compat-config",
30    ],
31    jni_libs: [
32        "libpdfclient",
33    ],
34    compile_multilib: "both",
35}
36
37apex_defaults {
38    name: "com.android.mediaprovider-defaults",
39    required: ["preinstalled-packages-com.android.providers.media.module.xml"],
40    bootclasspath_fragments: ["com.android.mediaprovider-bootclasspath-fragment"],
41    sh_binaries: [
42        // MediaProvider CLI (cli/media_provider_cli_wrapper.sh)
43        "media_provider",
44    ],
45    prebuilts: ["current_sdkinfo"],
46    key: "com.android.mediaprovider.key",
47    certificate: ":com.android.mediaprovider.certificate",
48    file_contexts: ":com.android.mediaprovider-file_contexts",
49    defaults: ["r-launched-apex-module"],
50    // Indicates that pre-installed version of this apex can be compressed.
51    // Whether it actually will be compressed is controlled on per-device basis.
52    compressible: true,
53}
54
55apex_key {
56    name: "com.android.mediaprovider.key",
57    public_key: "com.android.mediaprovider.avbpubkey",
58    private_key: "com.android.mediaprovider.pem",
59}
60
61android_app_certificate {
62    name: "com.android.mediaprovider.certificate",
63    certificate: "com.android.mediaprovider",
64}
65
66sdk {
67    name: "mediaprovider-module-sdk",
68    apexes: [
69        // Adds exportable dependencies of the APEX to the sdk,
70        // e.g. *classpath_fragments.
71        "com.android.mediaprovider",
72    ],
73}
74
75// Encapsulate the contributions made by the com.android.mediaprovider to the bootclasspath.
76bootclasspath_fragment {
77    name: "com.android.mediaprovider-bootclasspath-fragment",
78    contents: [
79        "framework-mediaprovider",
80        "framework-pdf",
81        "framework-pdf-v",
82    ],
83    apex_available: ["com.android.mediaprovider"],
84    // The bootclasspath_fragments that provide APIs on which this depends.
85    fragments: [
86        {
87            apex: "com.android.art",
88            module: "art-bootclasspath-fragment",
89        },
90    ],
91    // Additional stubs libraries that this fragment's contents use which are
92    // not provided by another bootclasspath_fragment.
93    additional_stubs: [
94        "android-non-updatable",
95    ],
96    // Additional hidden API flag files to override the defaults. This must only be
97    // modified by the Soong or platform compat team.
98    hidden_api: {
99        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
100
101        // The following packages contain classes from other modules on the
102        // bootclasspath. That means that the hidden API flags for this module
103        // has to explicitly list every single class this module provides in
104        // that package to differentiate them from the classes provided by other
105        // modules. That can include private classes that are not part of the
106        // API.
107        split_packages: [
108            "android.graphics.pdf",
109            "android.graphics.pdf.flags",
110            "android.provider",
111            "android.provider.mediacognitionutils",
112            "android.provider.media.internal.flags",
113            "android.graphics.pdf.common",
114            "android.graphics.pdf.concurrency",
115            "android.graphics.pdf.converters",
116            "android.graphics.pdf.internal.javax.annotation",
117            "android.graphics.pdf.internal.javax.annotation.concurrent",
118            "android.graphics.pdf.internal.javax.annotation.meta",
119            "android.graphics.pdf.models",
120            "android.graphics.pdf.utils",
121            "android.graphics.pdf.content",
122            "android.graphics.pdf.models.jni",
123            "android.graphics.pdf.models.selection",
124            "android.graphics.pdf.logging",
125        ],
126    },
127}
128