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
19java_sdk_library {
20    name: "service-ondeviceintelligence",
21    srcs: [
22        ":service-ondeviceintelligence-sources",
23        "proto/*.proto",
24    ],
25    defaults: ["framework-system-server-module-defaults"],
26    sdk_version: "system_server_current",
27    apex_available: [
28        "com.android.neuralnetworks",
29        "//apex_available:platform",
30    ],
31    impl_library_visibility: [
32        "//packages/modules/NeuralNetworks:__subpackages__",
33        "//frameworks/base:__subpackages__",
34    ],
35    proto: {
36        type: "nano",
37    },
38    static_libs: [
39        "android.app.ondeviceintelligence-aconfig-java",
40        "modules-utils-shell-command-handler",
41        "modules-utils-backgroundthread",
42    ],
43    permitted_packages: [
44        "com.android.server.ondeviceintelligence",
45        "com.android.neuralnetworks",
46        "com.android.modules.utils",
47    ],
48    min_sdk_version: "35",
49    libs: [
50        "framework-ondeviceintelligence.impl",
51        "framework-configinfrastructure.stubs.module_lib",
52        "modules-utils-infra",
53    ],
54    jarjar_rules: "jarjar-rules.txt",
55    errorprone: {
56        extra_check_modules: [
57            "//external/nullaway:nullaway_plugin",
58        ],
59        javacflags: [
60            "-XepExcludedPaths:.*/out/soong/.*",
61            "-Xep:NullAway:ERROR",
62            "-XepOpt:NullAway:AnnotatedPackages=android.app.ondeviceintelligence",
63            "-XepOpt:NullAway:AnnotatedPackages=android.service.ondeviceintelligence",
64        ],
65    },
66}
67