1// Copyright (C) 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    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20// The dex jar produced by this is used in the APEX but otherwise this is not
21// used.
22java_library {
23    name: "updatable-media",
24
25    static_libs: [
26        "framework-media.impl",
27    ],
28
29    permitted_packages: [
30        "android.media",
31    ],
32
33    // Optimize the dex jar for the APEX.
34    optimize: {
35        enabled: true,
36        shrink: true,
37        proguard_flags_files: ["updatable-media-proguard.flags"],
38    },
39
40    installable: true,
41
42    sdk_version: "module_current",
43
44    hostdex: true, // for hiddenapi check
45    apex_available: [
46        "com.android.media",
47        "test_com.android.media",
48    ],
49    min_sdk_version: "29",
50    visibility: [
51        // This MUST not be used for compilation within the media module, use
52        // framework-media.impl instead.
53        "//frameworks/av/apex:__subpackages__",
54
55        // DO NOT REMOVE: Legacy visibility, needed for snapshots that are
56        // generated for the S build.
57        "//frameworks/base",
58        "//frameworks/base/apex/media/service",
59    ],
60}
61
62filegroup {
63    name: "updatable-media-srcs",
64    defaults: ["framework-sources-module-defaults"],
65    srcs: [
66        "java/android/media/MediaFrameworkInitializer.java",
67        ":media-aidl-srcs",
68        ":mediaparceledlistslice-java-srcs",
69        ":mediaparser-srcs",
70        ":mediasession2-java-srcs",
71        ":mediatranscoding-srcs",
72    ],
73}
74
75filegroup {
76    name: "mediasession2-java-srcs",
77    srcs: [
78        "java/android/media/Controller2Link.java",
79        "java/android/media/MediaConstants.java",
80        "java/android/media/MediaController2.java",
81        "java/android/media/MediaSession2.java",
82        "java/android/media/MediaSession2Service.java",
83        "java/android/media/Session2Command.java",
84        "java/android/media/Session2CommandGroup.java",
85        "java/android/media/Session2Link.java",
86        "java/android/media/Session2Token.java",
87        "java/android/media/MediaCommunicationManager.java",
88    ],
89    path: "java",
90}
91
92filegroup {
93    name: "mediaparceledlistslice-java-srcs",
94    srcs: [
95        "java/android/media/MediaParceledListSlice.java",
96        "java/android/media/BaseMediaParceledListSlice.java",
97    ],
98    path: "java",
99}
100
101filegroup {
102    name: "mediaparser-srcs",
103    srcs: [
104        "java/android/media/MediaParser.java",
105    ],
106    path: "java",
107}
108
109filegroup {
110    name: "mediatranscoding-srcs",
111    srcs: [
112        "java/android/media/ApplicationMediaCapabilities.java",
113        "java/android/media/MediaFeature.java",
114        "java/android/media/MediaTranscodingManager.java",
115    ],
116    path: "java",
117}
118
119java_sdk_library {
120    name: "framework-media",
121    defaults: ["framework-module-defaults"],
122
123    srcs: [
124        ":updatable-media-srcs",
125    ],
126
127    impl_library_visibility: [
128        "//frameworks/base/api", // For framework-all
129        "//packages/modules/Media:__subpackages__",
130    ],
131
132    sdk_version: "module_current",
133    impl_only_libs: [
134        "androidx.annotation_annotation",
135        "framework-annotations-lib",
136    ],
137    impl_only_static_libs: [
138        "exoplayer-media_apex",
139        "mediatranscoding_aidl_interface-java",
140        "modules-annotation-minsdk",
141        "modules-utils-build",
142    ],
143    jarjar_rules: "jarjar_rules.txt",
144
145    apex_available: [
146        "com.android.media",
147        "test_com.android.media",
148    ],
149    lint: {
150        strict_updatability_linting: true,
151    },
152    min_sdk_version: "29",
153    permitted_packages: [
154        "android.media",
155    ],
156    static_libs: [
157        "media_mainline_flags_java_lib",
158    ]
159}
160
161cc_library_shared {
162    name: "libmediaparser-jni",
163    srcs: [
164        "jni/android_media_MediaParserJNI.cpp",
165    ],
166    header_libs: ["jni_headers"],
167    shared_libs: [
168        "libandroid",
169        "liblog",
170        "libmediametrics",
171    ],
172    cflags: [
173        "-Wall",
174        "-Werror",
175        "-Wno-unused-parameter",
176        "-Wunreachable-code",
177        "-Wunused",
178    ],
179    apex_available: [
180        "com.android.media",
181    ],
182    min_sdk_version: "29",
183}
184