• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2022 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    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19filegroup {
20    name: "adservicesapk-filegroup",
21    srcs: [
22        "java/**/*.java",
23    ],
24}
25
26android_app_certificate {
27    name: "com.android.adservices.api.certificate",
28    certificate: "com.android.adservices.api",
29}
30
31android_library {
32    name: "AdServicesLib",
33    sdk_version: "module_current",
34    min_sdk_version: "30",
35    srcs: [
36        "java/**/*.java",
37    ],
38    libs: [
39        "android.ext.adservices",
40        "framework-annotations-lib",
41    ],
42    optional_uses_libs: ["android.ext.adservices"],
43    manifest: "EmptyManifest.xml",
44    static_libs: [
45        "adservices-service-core",
46        "androidx-constraintlayout_constraintlayout",
47        "androidx.preference_preference",
48        "androidx.fragment_fragment",
49        "androidx.recyclerview_recyclerview",
50        // TODO(b/230653497): Try to remove this.
51        "androidx.room_room-runtime",
52        "mobile_data_downloader_lib",
53        "tflite_support_classifiers_java",
54        "SettingsLibActionBarShadow",
55        "SettingsLibSettingsTheme",
56        "SettingsLibCollapsingToolbarBaseActivity",
57        "SettingsLibMainSwitchPreference",
58    ],
59    // TODO(b/269145496): Remove dex_preopt: false.
60    dex_preopt: {
61        enabled: false,
62    },
63    jarjar_rules: "jarjar_rules.txt",
64    resource_dirs: ["res"],
65    aaptflags: [
66        // Don't compress *.tflite files. Compressed models cannot be loaded on device.
67        "-0 .tflite",
68    ],
69    apex_available: [
70        "com.android.adservices",
71        "com.android.extservices",
72    ],
73    lint: {
74        extra_check_modules: ["AdServicesProdLintChecker"],
75    },
76}
77
78android_library {
79    name: "AdServices-core",
80    sdk_version: "module_current",
81    // This is not enforced by PackageManager but we keep this
82    // here since this APK is used for S- only.
83    // TODO(b/263904312): Support for max_sdk_version.
84    max_sdk_version: "32",
85    min_sdk_version: "30",
86    static_libs: ["AdServicesLib"],
87    manifest: "AdExtServicesManifest.xml",
88    apex_available: ["com.android.extservices"],
89}
90
91android_app {
92    name: "AdServicesApk",
93    sdk_version: "module_current",
94    min_sdk_version: "Tiramisu",
95    certificate: ":com.android.adservices.api.certificate",
96    privileged: true,
97    privapp_allowlist: ":privapp_allowlist_com.android.adservices.api.xml",
98    srcs: [],
99    static_libs: [
100        "AdServicesLib",
101    ],
102    jarjar_rules: "jarjar_rules.txt",
103    resource_dirs: ["publicres"],
104    aaptflags: [
105        // Don't compress *.tflite files. Compressed models cannot be loaded on device.
106        "-0 .tflite",
107    ],
108    optimize: {
109        shrink_resources: true,
110    },
111    apex_available: ["com.android.adservices"],
112    updatable: true,
113}
114
115// Assets needs to be bundled via this android_library since our classes in service-core needs to
116// load assets.
117android_library {
118    name: "adservices-assets",
119    sdk_version: "module_current",
120    min_sdk_version: "30",
121    static_libs: [
122        "androidx-constraintlayout_constraintlayout",
123        "SettingsLibSettingsTheme",
124    ],
125    asset_dirs: [
126        "assets",
127    ],
128    aaptflags: [
129        // Don't compress *.tflite files. Compressed models cannot be loaded on device.
130        "-0 .tflite",
131    ],
132    // Must use EmptyManifest.xml since "adservices-assets" will also be used by the
133    // service-core tests. If we use the normal "AndroidManifest.xml", we will redeclare permissions
134    // in the tests.
135    // See b/228270294 for the error about duplicated permissions.
136    manifest: "EmptyManifest.xml",
137}
138