1// 2// Copyright (C) 2022 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_applicable_licenses: [ 19 "packages_modules_DeviceLock_DeviceLockController_license", 20 ], 21} 22 23license { 24 name: "packages_modules_DeviceLock_DeviceLockController_license", 25 visibility: [":__subpackages__"], 26 license_kinds: [ 27 "SPDX-license-identifier-Apache-2.0", 28 ], 29 license_text: [ 30 "NOTICE", 31 ], 32} 33 34filegroup { 35 name: "devicelockcontroller-grpc-impl-sources", 36 srcs: [ 37 "src/com/android/devicelockcontroller/provision/grpc/impl/*.java", 38 ], 39} 40 41java_library { 42 name: "devicelockcontroller-interface", 43 sdk_version: "module_current", 44 min_sdk_version: "33", // AIDL compiler does not know about UpsideDownCake 45 srcs: ["src/**/*.aidl"], 46 apex_available: [ 47 "com.android.devicelock", 48 ], 49 visibility: [ 50 "//packages/modules/DeviceLock:__subpackages__", 51 ], 52} 53 54java_library { 55 name: "devicelockcontroller-common-lib", 56 srcs: [ 57 "src/com/android/devicelockcontroller/common/*.java", 58 "src/com/android/devicelockcontroller/util/*.java", 59 ], 60 sdk_version: "module_current", 61 min_sdk_version: "UpsideDownCake", 62 apex_available: ["com.android.devicelock"], 63 static_libs: [ 64 "androidx.annotation_annotation", 65 ], 66 visibility: [ 67 "//packages/modules/DeviceLock:__subpackages__", 68 ], 69} 70 71java_library { 72 name: "devicelockcontroller-grpc-interface-lib", 73 srcs: ["src/com/android/devicelockcontroller/provision/grpc/*.java"], 74 sdk_version: "module_current", 75 min_sdk_version: "UpsideDownCake", 76 apex_available: ["com.android.devicelock"], 77 static_libs: [ 78 "devicelockcontroller-common-lib", 79 "androidx.annotation_annotation", 80 "grpc-java-core-android", 81 "grpc-java-okhttp-client-lite", 82 "libprotobuf-java-lite", 83 "opencensus-java-api", 84 "opencensus-java-contrib-grpc-metrics", 85 ], 86 visibility: [ 87 "//packages/modules/DeviceLock:__subpackages__", 88 "//vendor:__subpackages__", 89 ], 90} 91 92// Library with all dependencies for building DeviceLockController 93android_library { 94 name: "devicelockcontroller-lib", 95 sdk_version: "module_current", 96 min_sdk_version: "UpsideDownCake", 97 srcs: ["src/**/*.java"], 98 exclude_srcs: [":devicelockcontroller-grpc-impl-sources"], 99 resource_dirs: ["res"], 100 libs: [ 101 "framework-annotations-lib", 102 "framework-devicelock.impl", 103 "org.apache.http.legacy", 104 ], 105 static_libs: [ 106 "androidx.annotation_annotation", 107 "androidx.collection_collection", 108 "androidx.lifecycle_lifecycle-extensions", 109 "androidx.preference_preference", 110 "androidx.work_work-runtime", 111 "devicelockcontroller-grpc-interface-lib", 112 "devicelockcontroller-interface", 113 // TODO: Check if we have an alternate for this 114 "com.google.android.material_material", 115 "guava", 116 "jsr330", 117 "dagger2", 118 "SettingsLibCollapsingToolbarBaseActivity", 119 "SettingsLibTopIntroPreference", 120 ], 121 manifest: "AndroidManifestBase.xml", 122 apex_available: [ 123 "com.android.devicelock", 124 ], 125 visibility: [ 126 "//packages/modules/DeviceLock:__subpackages__", 127 "//vendor:__subpackages__", 128 ], 129} 130 131android_app { 132 name: "DeviceLockController", 133 sdk_version: "module_current", 134 min_sdk_version: "UpsideDownCake", 135 updatable: true, 136 privileged: true, 137 certificate: "platform", 138 rename_resources_package: false, 139 required: ["privapp_allowlist_com.android.devicelockcontroller.xml"], 140 141 srcs: [":devicelockcontroller-grpc-impl-sources"], 142 143 static_libs: [ 144 "devicelockcontroller-lib", 145 "devicelockcontroller-grpc-interface-lib", 146 "devicelockcontroller-proto-lite", 147 ], 148 149 lint: { 150 strict_updatability_linting: true, 151 }, 152 153 optimize: { 154 proguard_flags_files: ["proguard.flags"], 155 shrink_resources: true, 156 }, 157 158 apex_available: [ 159 "//apex_available:platform", 160 "com.android.devicelock", 161 ], 162} 163 164android_app { 165 name: "DeviceLockControllerDebug", 166 sdk_version: "module_current", 167 min_sdk_version: "UpsideDownCake", 168 updatable: true, 169 privileged: true, 170 certificate: "platform", 171 rename_resources_package: false, 172 required: ["privapp_allowlist_com.android.devicelockcontroller.xml"], 173 174 srcs: [":devicelockcontroller-grpc-impl-sources"], 175 176 static_libs: [ 177 "devicelockcontroller-debug-lib", 178 "devicelockcontroller-grpc-interface-lib", 179 "devicelockcontroller-proto-lite", 180 ], 181 182 lint: { 183 strict_updatability_linting: true, 184 }, 185 186 optimize: { 187 proguard_flags_files: ["proguard.flags"], 188 shrink_resources: true, 189 }, 190 191 apex_available: [ 192 "//apex_available:platform", 193 "com.android.devicelock", 194 ], 195} 196