-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathAndroid.bp
More file actions
120 lines (102 loc) · 4.7 KB
/
Copy pathAndroid.bp
File metadata and controls
120 lines (102 loc) · 4.7 KB
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
// Copyright (C) 2021 The BoringDroid 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"],
}
android_app {
name: "BoringdroidSystemUI",
srcs: ["app/src/main/java/**/*.kt"],
resource_dirs: [
"app/src/main/res",
// Shared attribute/bool declarations copied from SystemUI shared resources.
"app/src/main/SystemUISharedRes",
],
manifest: "app/src/main/AndroidManifest.xml",
// Plugin interfaces (OverlayPlugin, @Requires, etc.) – compile-time only,
// provided by the SystemUI host process at runtime.
libs: [
"SystemUIPluginLib",
],
// SystemUISharedLib is bundled as static_libs so that ActivityManagerWrapper,
// TaskStackChangeListeners, etc. are available in the plugin APK. When compiled
// via Android.bp the R.id fields are generated as proper final int constants
// (unlike the pre-built JAR which has non-final fields that stay 0 at runtime
// and caused the View.setTag IllegalArgumentException in PoolingContainer).
static_libs: [
"SystemUISharedLib",
"androidx.annotation_annotation",
"androidx.compose.foundation_foundation",
"androidx.compose.material_material-icons-extended",
"androidx.compose.material3_material3",
"androidx.compose.runtime_runtime",
"androidx.compose.ui_ui",
"androidx.core_core-ktx",
// Needed because the AllAppsLayout uses ComposeView inside a window
// attached via WindowManager.addView — without a LifecycleOwner on
// the view tree, AbstractComposeView.onAttachedToWindow throws
// IllegalStateException "ViewTreeLifecycleOwner not found".
"androidx.lifecycle_lifecycle-runtime-ktx",
"androidx.savedstate_savedstate",
"androidx.recyclerview_recyclerview",
// NotificationFeed exposes a kotlinx.coroutines.flow.StateFlow so the
// action center UI can observe NotificationListenerService callbacks
// without a binder hop.
"kotlinx_coroutines_android",
],
// Required to access platform APIs used via SystemUISharedLib
// (e.g. ActivityManagerWrapper, TaskStackChangeListeners).
platform_apis: true,
certificate: "platform",
// Privileged so FORCE_STOP_PACKAGES (signature|privileged), declared in
// AndroidManifest.xml, gets granted via the matching allowlist at
// /system/etc/permissions/. The plugin joins
// sharedUserId="android.uid.systemui" so that grant reaches the SystemUI
// process — see SystemUIOverlay.refreshHomeLauncherForNewInsets.
//
// Lives in /system/priv-app (not /product/priv-app) because platform_apis
// is incompatible with product_specific under PRODUCT_ENFORCE_PRODUCT_
// PARTITION_INTERFACE — the plugin needs internal SystemUI hooks.
privileged: true,
kotlincflags: ["-Xjvm-default=enable"],
optimize: {
enabled: false,
},
}
// UiAutomator-based instrumentation tests. Build with `m BoringdroidSystemUITests`
// and run with .claude/scripts/run-boringdroid-tests.sh.
android_test {
name: "BoringdroidSystemUITests",
srcs: ["app/src/androidTest/java/**/*.kt"],
manifest: "app/src/androidTest/AndroidManifest.xml",
static_libs: [
"androidx.test.ext.junit",
"androidx.test.rules",
"androidx.test.runner",
"androidx.test.uiautomator_uiautomator",
"junit",
"truth-prebuilt",
// BoringdroidSystemUI inherits an InitializationProvider <provider>
// from its recyclerview transitive manifest merge, but does not ship
// the class (it's a SystemUI plugin — the provider is never actually
// instantiated in production). `am instrument` tries to instantiate
// it at ActivityThread#handleBindApplication, so ship the class from
// the test APK which sits on the same dex path at instrumentation time.
"androidx.startup_startup-runtime",
],
// Matches BoringdroidSystemUI — we use the same platform certificate so the
// test APK can signal platform-protected broadcasts if a test needs to.
platform_apis: true,
certificate: "platform",
test_suites: ["general-tests"],
}