1// 2// Copyright (C) 2019 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 default_team: "trendy_team_android_permissions", 19 default_applicable_licenses: [ 20 "packages_modules_Permission_PermissionController_license", 21 ], 22} 23 24// Added automatically by a large-scale-change 25// See: http://go/android-license-faq 26license { 27 name: "packages_modules_Permission_PermissionController_license", 28 visibility: [":__subpackages__"], 29 license_kinds: [ 30 "SPDX-license-identifier-Apache-2.0", 31 ], 32 license_text: [ 33 "NOTICE", 34 ], 35} 36 37genrule { 38 name: "statslog-permissioncontroller-java-gen", 39 tools: ["stats-log-api-gen"], 40 cmd: "$(location stats-log-api-gen) --java $(out) --module permissioncontroller" + 41 " --javaPackage com.android.permissioncontroller" + 42 " --javaClass PermissionControllerStatsLog --minApiLevel 30", 43 out: ["com/android/permissioncontroller/PermissionControllerStatsLog.java"], 44} 45 46java_library { 47 name: "permissioncontroller-statsd", 48 sdk_version: "system_current", 49 min_sdk_version: "30", 50 apex_available: [ 51 "com.android.permission", 52 ], 53 srcs: [ 54 ":statslog-permissioncontroller-java-gen", 55 ], 56} 57 58java_library { 59 name: "permissioncontroller-protos", 60 sdk_version: "system_current", 61 min_sdk_version: "30", 62 srcs: [ 63 "src/**/*.proto", 64 ], 65 proto: { 66 type: "lite", 67 include_dirs: ["packages/modules/Permission/PermissionController/src/com/android/permissioncontroller"], 68 }, 69 apex_available: [ 70 "//apex_available:platform", 71 "com.android.permission", 72 ], 73} 74 75filegroup { 76 name: "PermissionController-jarjar-rules", 77 srcs: ["jarjar-rules.txt"], 78} 79 80android_library { 81 name: "PermissionController-lib", 82 sdk_version: "system_current", 83 min_sdk_version: "30", 84 use_resource_processor: true, 85 manifest: "AndroidManifest-lib.xml", 86 srcs: [ 87 "src/**/*.java", 88 "src/**/*.kt", 89 ], 90 91 //javacflags: ["-Werror"], 92 kotlin_lang_version: "1.9", 93 kotlincflags: [ 94 "-Werror", 95 "-opt-in=kotlinx.coroutines.DelicateCoroutinesApi", 96 "-Xjvm-default=all", 97 ], 98 99 libs: [ 100 "android.car-stubs", 101 "safety-center-annotations", 102 ], 103 104 static_libs: [ 105 "permissioncontroller-protos", 106 "iconloader_sc_mainline_prod", 107 "com.google.android.material_material", 108 "androidx.transition_transition", 109 "androidx-constraintlayout_constraintlayout", 110 "androidx.core_core", 111 "androidx.media_media", 112 "androidx.legacy_legacy-support-core-utils", 113 "androidx.legacy_legacy-support-core-ui", 114 "androidx.fragment_fragment", 115 "androidx.appcompat_appcompat", 116 "androidx.preference_preference", 117 "androidx.recyclerview_recyclerview", 118 "androidx.legacy_legacy-preference-v14", 119 "androidx.leanback_leanback", 120 "androidx.leanback_leanback-preference", 121 "androidx.lifecycle_lifecycle-common-java8", 122 "kotlin-stdlib", 123 "kotlinx-coroutines-android", 124 "androidx.navigation_navigation-common-ktx", 125 "androidx.navigation_navigation-fragment-ktx", 126 "androidx.navigation_navigation-runtime-ktx", 127 "androidx.navigation_navigation-ui-ktx", 128 "SettingsLibHelpUtils", 129 "SettingsLibRestrictedLockUtils", 130 "SettingsLibAppPreference", 131 "SettingsLibSearchWidget", 132 "SettingsLibLayoutPreference", 133 "SettingsLibBarChartPreference", 134 "SettingsLibBannerMessagePreference", 135 "SettingsLibActionBarShadow", 136 "SettingsLibProgressBar", 137 "SettingsLibCollapsingToolbarBaseActivity", 138 "SettingsLibActivityEmbedding", 139 "SettingsLibSettingsTheme", 140 "SettingsLibFooterPreference", 141 "SettingsLibSelectorWithWidgetPreference", 142 "SettingsLibTwoTargetPreference", 143 "SettingsLibIllustrationPreference", 144 "androidx.annotation_annotation", 145 "permissioncontroller-statsd", 146 "car-ui-lib", 147 "libprotobuf-java-lite", 148 "safety-center-internal-data", 149 "safety-center-pending-intents", 150 "SettingsLibUtils", 151 "modules-utils-build_system", 152 "safety-center-resources-lib", 153 "lottie", 154 "safety-label", 155 "role-controller", 156 "android.permission.flags-aconfig-java-export", 157 "android.xr.flags-aconfig-java-export", 158 "com.android.permission.flags-aconfig-java-export", 159 "androidx.compose.foundation_foundation", 160 "androidx.compose.runtime_runtime", 161 "androidx.compose.runtime_runtime-livedata", 162 "androidx.compose.ui_ui", 163 "androidx.wear.compose_compose-material3", 164 "android.content.pm.flags-aconfig-java-export", 165 "android.os.flags-aconfig-java-export", 166 "wear-permission-components", 167 ], 168 169 lint: { 170 error_checks: ["Recycle"], 171 baseline_filename: "lint-baseline.xml", 172 }, 173 174 apex_available: [ 175 "//apex_available:platform", 176 "com.android.permission", 177 ], 178 179 // TODO(b/313706381): Remove jarjar once flagging lib is fixed 180 jarjar_rules: ":PermissionController-jarjar-rules", 181} 182 183android_app { 184 name: "PermissionController", 185 // Compiling against "module_current" would allow using non-APIs within the permission APEX 186 // boundaries, which may be unsafe because PermissionController is also shipped as a standalone 187 // artifact. See also b/209458854. 188 sdk_version: "system_current", 189 min_sdk_version: "30", 190 updatable: true, 191 privileged: true, 192 certificate: "platform", 193 use_resource_processor: true, 194 rename_resources_package: false, 195 privapp_allowlist: ":privapp_allowlist_com.android.permissioncontroller.xml", 196 197 static_libs: ["PermissionController-lib"], 198 199 lint: { 200 error_checks: ["Recycle"], 201 }, 202 203 optimize: { 204 proguard_compatibility: false, // TODO(b/215530220): remove when this is default behavior 205 proguard_flags_files: ["proguard.flags"], 206 }, 207 208 apex_available: [ 209 "//apex_available:platform", 210 "com.android.permission", 211 ], 212} 213