blob: 38b235896ce566b14e83ab7eac75fb5481eee660 [file]
// Copyright (C) 2026 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_applicable_licenses: [
"Android-Apache-2.0",
],
}
// For framework code that wants to compile with this extension
// it should include this target in the `libs:[]` block, but should
// not statically compile this extension into its classpath.
java_library {
name: "safetyevaluator.extension",
srcs: [
":safetyevaluator.extension.stubs",
],
sdk_version: "core_platform",
libs: [
"framework-annotations-lib",
"framework",
],
visibility: [
// Add targets which need to reference this extension here to avoid
// making this globally visible to the entire platform.
"//frameworks/base/libs/safetyevaluator:__subpackages__",
"//frameworks/base/services/appinteraction",
"//frameworks/base/services/appfunctions",
"//cts/tests/appfunctions:__subpackages__",
"//cts/tests/appinteraction:__subpackages__",
],
}
java_library {
name: "safetyevaluator-internal-lib",
srcs: [
"src/com/android/extensions/safetyevaluator/**/*.java",
"src/com/android/extensions/safetyevaluator/**/*.aidl",
],
aidl: {
local_include_dirs: ["src"],
},
sdk_version: "core_platform",
libs: [
"androidx.annotation_annotation",
"framework-annotations-lib",
"framework",
],
visibility: [
"//frameworks/base/libs/safetyevaluator:__subpackages__",
],
}
java_library {
name: "com.android.extensions.safetyevaluator",
static_libs: [
"safetyevaluator-internal-lib",
],
installable: true,
sdk_version: "core_platform",
system_ext_specific: true,
required: ["safetyevaluator.extension.xml"],
}
prebuilt_etc {
name: "safetyevaluator.extension.xml",
system_ext_specific: true,
sub_dir: "permissions",
src: "safetyevaluator.extension.xml",
filename_from_src: true,
}
java_library {
name: "services.safetyevaluator",
srcs: [
"services/com/android/server/safetyevaluator/**/*.java",
],
static_libs: [
"safetyevaluator-internal-lib",
],
libs: [
"services.core",
"framework",
],
}
droidstubs {
name: "safetyevaluator.extension.stubs",
srcs: [
"src/com/android/extensions/safetyevaluator/**/*.java",
],
libs: [
"androidx.annotation_annotation",
"framework",
"framework-annotations-lib",
],
flags: [
"--hide InternalClasses",
"--hide UnflaggedApi",
"--hide HiddenSuperclass",
"--hide InheritChangesSignature",
],
check_api: {
current: {
api_file: "api_extension/current.txt",
removed_api_file: "api_extension/removed.txt",
},
last_released: {
api_file: ":safetyevaluator.extension.api.latest",
removed_api_file: "api_extension/removed.txt",
baseline_file: "api_extension/incompatibilities.txt",
},
api_lint: {
enabled: true,
new_since: ":safetyevaluator.extension.api.latest",
},
},
api_surface: "public",
}
genrule {
name: "safetyevaluator.extension.api.latest",
srcs: ["api_extension/*.txt"],
cmd: "cp -f $$(echo $(in) | tr ' ' '\\n' | sort -n | grep '[0-9][.]txt$$' | tail -1) $(genDir)/last-released-api.txt",
out: [
"last-released-api.txt",
],
}