summaryrefslogtreecommitdiff
path: root/framework/Android.bp
blob: e40f1af6f4d0837f5eab3c208e233c5de25b5c65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

filegroup {
    name: "framework-bluetooth-sources",
    defaults: ["framework-sources-module-defaults"],
    srcs: [
        "java/**/*.aidl",
        "java/**/*.java",
    ],
    path: "java",
    visibility: ["//packages/modules/Bluetooth/framework/tests/unit"],
}

// defaults shared between `framework-bluetooth` & `framework-bluetooth-pre-jarjar`
// java_sdk_library `framework-bluetooth` needs sources to generate stubs, so it cannot reuse
// `framework-bluetooth-pre-jarjar`
java_defaults {
    name: "framework-bluetooth-defaults",
    static_libs: [
        "PlatformProperties",
        "bluetooth_constants_java",
        "bluetooth_flags_java_lib",
        "modules-utils-build",
        "modules-utils-expresslog",
        "service-bluetooth-binder-aidl",
    ],
    libs: [
        "app-compat-annotations",
        "framework-tethering.stubs.module_lib",
        "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
    ],
    stub_only_libs: [
        // TODO: b/332362688 --- Metalava should already ignore our library
        "bluetooth_flags_java_lib",
        "framework-tethering.stubs.module_lib",
    ],
    srcs: [
        ":Bluetooth-binder-aidl",
        ":framework-bluetooth-sources",
    ],
    min_sdk_version: "Tiramisu",
}

// bluetooth-service needs pre-jarjared version of framework-bluetooth so it can reference copied utility
// classes before they are renamed.
java_library {
    name: "framework-bluetooth-pre-jarjar",
    defaults: ["framework-bluetooth-defaults"],
    sdk_version: "module_current",
    libs: ["framework-annotations-lib"],
    installable: false,
    visibility: ["//packages/modules/Bluetooth:__subpackages__"],
}

// post-jarjar version of framework-bluetooth
java_sdk_library {
    name: "framework-bluetooth",
    defaults: [
        "bluetooth_framework_errorprone_rules",
        "framework-bluetooth-defaults",
        "framework-module-defaults",
    ],

    jarjar_rules: ":bluetooth-jarjar-rules",
    installable: true,
    optimize: {
        enabled: false,
    },
    hostdex: true, // for hiddenapi check

    impl_library_visibility: [
        "//external/sl4a/Common",
        "//packages/modules/Bluetooth/android/app:__subpackages__",
        "//packages/modules/Bluetooth/android/pandora/server",
        "//packages/modules/Bluetooth/framework/tests/bumble",
        "//packages/modules/Bluetooth/service",
        "//packages/services/Car/car-builtin-lib",
        // TODO(240720385)
        "//packages/services/Car/tests/CarBuiltinLibUnitTest",
        ":__subpackages__",
    ],

    apex_available: ["com.android.bt"],

    permitted_packages: [
        "android.bluetooth",
        "com.android.bluetooth.jarjar",
    ],
    aconfig_declarations: [
        "bluetooth_aconfig_flags",
    ],
    lint: {
        error_checks: [
            "Autofill",
            "DefaultLocale",
            "DuplicateDefinition",
            "ExtraText",
            "ExtraTranslation",
            "FlaggedApi",
            "GestureBackNavigation",
            "GuardedLogInvocation",
            "HandlerLeak",
            "InflateParams",
            "LabelFor",
            "MissingClass",
            "MonochromeLauncherIcon",
            "NewApi",
            "ObsoleteSdkInt",
            "Recycle",
            "RtlHardcoded",
            "RtlSymmetry",
            "ScrollViewSize",
            "SetTextI18n",
            "SimpleDateFormat",
            "StaticFieldLeak",
            "StringFormatCount",
            "StringFormatInvalid",
            "SupportAnnotationUsage",
            "TextFields",
            "TypographyEllipsis",
            "UseSparseArrays",
            "UseValueOf",
            "VectorPath",
            "VisibleForTests",
            "Wakelock",
            "WakelockTimeout",
            "WrongConstant",
        ],
        strict_updatability_linting: true,
        baseline_filename: "lint-baseline.xml",
    },
}

// defaults for tests that need to build against framework-bluetooths's @hide APIs
java_defaults {
    name: "framework-bluetooth-tests-defaults",
    sdk_version: "core_platform",
    libs: [
        // order matters: classes in framework-bluetooth are resolved before framework, meaning
        // @hide APIs in framework-bluetooth are resolved before @SystemApi stubs in framework
        "framework-bluetooth.impl",

        "framework",
        // if sdk_version="" this gets automatically included, but here we need to add manually.
        "framework-res",
    ],
    defaults_visibility: ["//packages/modules/Bluetooth:__subpackages__"],
}

filegroup {
    name: "bluetooth-jarjar-rules",
    srcs: ["jarjar-rules.txt"],
}

platform_compat_config {
    name: "framework-bluetooth-compat-config",
    src: ":framework-bluetooth",
}