1// Copyright (C) 2024 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_visibility: [":__pkg__"],
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20filegroup {
21    name: "framework-profiling-sources",
22    defaults: ["framework-sources-module-defaults"],
23    srcs: [
24        "java/**/*.java",
25        ":framework-profiling-aidl-sources",
26    ],
27    visibility: ["//packages/modules/Profiling/framework:__subpackages__"],
28}
29
30java_sdk_library {
31    name: "framework-profiling",
32    defaults: ["framework-module-defaults"],
33    installable: true,
34
35    jarjar_rules: "jarjar-rules.txt",
36
37    srcs: [
38        ":framework-profiling-sources",
39    ],
40
41    libs: [
42        "androidx.annotation_annotation",
43    ],
44
45    aconfig_declarations: [
46        "android.os.profiling.flags-aconfig",
47    ],
48
49    static_libs: [
50        "modules-utils-build",
51        "profiling_flags_lib",
52    ],
53
54    permitted_packages: [
55        "android.app",
56        "android.os",
57        "android.util",
58        "com.android.internal.profiling",
59    ],
60
61    api_packages: [
62        "android.app",
63        "android.os",
64        "android.util",
65    ],
66
67    hostdex: true, // for hiddenapi check
68
69    impl_library_visibility: [
70        "//packages/modules/Profiling/service:__subpackages__",
71        "//packages/modules/Profiling/tests:__subpackages__",
72    ],
73
74    apex_available: [
75        "com.android.profiling",
76    ],
77    min_sdk_version: "35",
78}
79
80aconfig_declarations {
81    name: "android.os.profiling.flags-aconfig",
82    package: "android.os.profiling",
83    container: "com.android.profiling",
84    exportable: true,
85    srcs: ["java/android/os/flags.aconfig"],
86}
87
88java_aconfig_library {
89    name: "profiling_flags_lib",
90    aconfig_declarations: "android.os.profiling.flags-aconfig",
91    apex_available: [
92        "com.android.profiling",
93        "//apex_available:platform",
94    ],
95    mode: "exported",
96    min_sdk_version: "35",
97    defaults: ["framework-minus-apex-aconfig-java-defaults"],
98    visibility: [
99        "//packages/modules/Profiling:__subpackages__",
100        "//frameworks/base/services/core",
101    ],
102}
103