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_app { 32 name: "AdExtServicesApk", 33 sdk_version: "module_current", 34 min_sdk_version: "30", 35 // This is not enforced by PackageManager but we keep this 36 // here since this APK is used for S- only. 37 // TODO(b/263904312): Support for max_sdk_version. 38 max_sdk_version: "32", 39 certificate: ":com.android.adservices.api.certificate", 40 privileged: true, 41 srcs: [ 42 "java/**/*.java", 43 ], 44 libs: ["android.ext.adservices"], 45 optional_uses_libs: ["android.ext.adservices"], 46 manifest: "AdExtServicesManifest.xml", 47 package_name: "com.android.ext.adservices.api", 48 static_libs: [ 49 "adservices-service-core", 50 "androidx-constraintlayout_constraintlayout", 51 "androidx.preference_preference", 52 "androidx.fragment_fragment", 53 "androidx.recyclerview_recyclerview", 54 // TODO(b/230653497): Try to remove this. 55 "androidx.room_room-runtime", 56 "mobile_data_downloader_lib", 57 "tflite_support_classifiers_java", 58 "SettingsLibActionBarShadow", 59 "SettingsLibSettingsTheme", 60 "SettingsLibCollapsingToolbarBaseActivity", 61 "SettingsLibMainSwitchPreference", 62 ], 63 // TODO(b/269145496): Remove dex_preopt: false. 64 dex_preopt: { 65 enabled: false, 66 }, 67 jarjar_rules: "jarjar_rules.txt", 68 resource_dirs: ["res"], 69 aaptflags: [ 70 // Don't compress *.tflite files. Compressed models cannot be loaded on device. 71 "-0 .tflite", 72 ], 73 optimize: { 74 proguard_flags_files: ["proguard.flags"], 75 }, 76 required: ["privapp_allowlist_com.android.adservices.api.xml"], 77 apex_available: ["com.android.extservices"], 78} 79 80android_app { 81 name: "AdServicesApk", 82 sdk_version: "module_current", 83 min_sdk_version: "Tiramisu", 84 certificate: ":com.android.adservices.api.certificate", 85 privileged: true, 86 srcs: [ 87 "java/**/*.java", 88 ], 89 libs: [ 90 // Need it to access hidden stuff in framework-adservices. 91 "framework-adservices.impl", 92 ], 93 static_libs: [ 94 "adservices-service-core", 95 "androidx-constraintlayout_constraintlayout", 96 "androidx.preference_preference", 97 "androidx.fragment_fragment", 98 "androidx.recyclerview_recyclerview", 99 // TODO(b/230653497): Try to remove this. 100 "androidx.room_room-runtime", 101 "mobile_data_downloader_lib", 102 "tflite_support_classifiers_java", 103 "SettingsLibActionBarShadow", 104 "SettingsLibSettingsTheme", 105 "SettingsLibCollapsingToolbarBaseActivity", 106 "SettingsLibMainSwitchPreference", 107 ], 108 jarjar_rules: "jarjar_rules.txt", 109 resource_dirs: [ 110 "res", 111 "publicres", 112 ], 113 aaptflags: [ 114 // Don't compress *.tflite files. Compressed models cannot be loaded on device. 115 "-0 .tflite", 116 ], 117 optimize: { 118 shrink_resources: true, 119 proguard_flags_files: ["proguard.flags"], 120 }, 121 required: ["privapp_allowlist_com.android.adservices.api.xml"], 122 apex_available: ["com.android.adservices"], 123} 124 125// Assets needs to be bundled via this android_library since our classes in service-core needs to 126// load assets. 127android_library { 128 name: "adservices-assets", 129 sdk_version: "module_current", 130 min_sdk_version: "30", 131 static_libs: [ 132 "androidx-constraintlayout_constraintlayout", 133 "SettingsLibSettingsTheme", 134 ], 135 asset_dirs: [ 136 "assets", 137 ], 138 aaptflags: [ 139 // Don't compress *.tflite files. Compressed models cannot be loaded on device. 140 "-0 .tflite", 141 ], 142 // Must use EmptyManifest.xml since "adservices-assets" will also be used by the 143 // service-core tests. If we use the normal "AndroidManifest.xml", we will redeclare permissions 144 // in the tests. 145 // See b/228270294 for the error about duplicated permissions. 146 manifest: "EmptyManifest.xml", 147} 148