• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2019 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    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "packages_modules_appsearch_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["packages_modules_appsearch_license"],
22}
23
24genrule {
25    name: "statslog-appsearch-java-gen",
26    tools: ["stats-log-api-gen"],
27    cmd: "$(location stats-log-api-gen) --java $(out) --module appsearch --javaPackage com.android.server.appsearch.stats --javaClass AppSearchStatsLog",
28    out: ["com/android/server/appsearch/stats/AppSearchStatsLog.java"],
29}
30
31java_library {
32    name: "statslog-appsearch-lib",
33    srcs: [":statslog-appsearch-java-gen"],
34    libs: [
35        // needed for restricted atoms.
36        "androidx.annotation_annotation",
37        // add StatsLog as a dependency of the generated file.
38        "framework-statsd.stubs.module_lib",
39    ],
40    sdk_version: "module_current",
41    min_sdk_version: "Tiramisu",
42    apex_available: ["com.android.appsearch"],
43}
44
45java_defaults {
46    name: "service-appsearch-defaults",
47    srcs: [
48        "java/**/*.java",
49    ],
50    sdk_version: "system_server_current",
51    min_sdk_version: "Tiramisu",
52    static_libs: [
53        "com.android.appsearch.isolated_storage_service.aidl-java",
54        "com.android.isolated_storage_service.aidl-java",
55        "icing-java-proto-lite",
56        "libicing-java",
57        "statslog-appsearch-lib",
58
59        // Entries below this line are outside of the appsearch package tree and must be kept in
60        // sync with jarjar.txt
61        "appsearch_flags_java_lib",
62        "modules-utils-preconditions",
63    ],
64    libs: [
65        "framework-appsearch.impl",
66        "framework-configinfrastructure.stubs.module_lib",
67        "framework-permission-s.stubs.module_lib",
68        "framework-statsd.stubs.module_lib",
69        "framework-virtualization.stubs.module_lib",
70        "jspecify",
71    ],
72    optimize: {
73        proguard_flags_files: ["proguard.flags"],
74    },
75    defaults: [
76        "framework-system-server-module-defaults",
77        "framework-system-server-module-optimize-defaults",
78    ],
79    permitted_packages: [
80        "com.android.isolated_storage_service",
81        "com.android.server.appsearch",
82        "com.google.android.icing",
83    ],
84    jarjar_rules: "jarjar-rules.txt",
85    visibility: [
86        // These are required until appsearch is properly unbundled.
87        "//frameworks/base/services/tests/mockingservicestests",
88        "//frameworks/base/services/tests/servicestests",
89    ],
90    apex_available: ["com.android.appsearch"],
91}
92
93// A special library created strictly for use by the tests as they need the implementation library
94// but that is not available when building from prebuilts. Using a library with a different name to
95// what is used by the prebuilts ensures that this will never depend on the prebuilt.
96// Switching service-appsearch to a java_sdk_library would also have worked as that has built in
97// support for managing this but that is too big a change at this point.
98java_library {
99    name: "service-appsearch-for-tests",
100    defaults: ["service-appsearch-defaults"],
101}
102
103java_library {
104    name: "service-appsearch",
105    defaults: ["service-appsearch-defaults"],
106    installable: true,
107}
108