blob: 0abaffbf993e695fbfd493b0c94c3cff44d7ddca [file] [log] [blame]
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -07001//
Luofan Chen3ee21022023-03-01 19:12:53 +08002// Copyright (C) 2018-2023 The LineageOS Project
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -07003//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17android_app {
18 name: "org.lineageos.platform-res",
Paul Duffin374e4df2019-06-12 13:47:18 +010019 sdk_version: "core_platform",
Luca Stefani50ff6742021-10-12 18:00:26 +020020 certificate: "platform",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070021
Luca Stefani50ff6742021-10-12 18:00:26 +020022 manifest: "lineage/res/AndroidManifest.xml",
23
24 // Disable dexpreopt and verify_uses_libraries check as the app
25 // contains no Java code to be dexpreopted.
26 enforce_uses_libs: false,
27 dex_preopt: {
28 enabled: false,
29 },
30
31 // Soong special-cases org.lineageos.platform-res to install this alongside
32 // the libraries at /system_ext/framework/org.lineageos.platform-res.apk.
33
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070034 aaptflags: [
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070035 "--private-symbols",
36 "org.lineageos.platform.internal",
37
38 // Framework doesn't need versioning since it IS the platform.
39 "--no-auto-version",
40
Luca Stefani50ff6742021-10-12 18:00:26 +020041 // Allow overlay to add resource
42 "--auto-add-overlay",
43
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070044 // Tell aapt to create "extending (non-application)" resource IDs,
45 // since these resources will be used by many apps.
46 "--allow-reserved-package-id",
47 // Use id 0x3f (one less than app id).
48 "--package-id",
49 "63",
50 ],
51
52 resource_dirs: [
53 "lineage/res/res",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070054 ],
55
56 // Create package-export.apk, which other packages can use to get
57 // PRODUCT-agnostic resource data like IDs and type definitions.
58 export_package_resources: true,
59}
60
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070061// The LineageOS Platform Framework Library
62// ============================================================
63
64lineage_sdk_src = "sdk/src/java/lineageos"
65lineage_sdk_internal_src = "sdk/src/java/org/lineageos/internal"
Dominik Baronelli74901e12024-06-23 18:36:36 +020066lineage_sdk_minimal_internal_src = "sdk/src/java/org/lineageos/internal/minimal"
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070067library_src = "lineage/lib/main/java"
68
Paul Keithb49ed552019-01-18 17:58:26 +010069lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES = [
Luofan Chen3ee21022023-03-01 19:12:53 +080070 "vendor.lineage.health-V1-java",
Paul Keithb49ed552019-01-18 17:58:26 +010071 "vendor.lineage.livedisplay-V2.0-java",
Arian5f3ded72020-07-29 16:01:55 +020072 "vendor.lineage.livedisplay-V2.1-java",
Paul Keithb49ed552019-01-18 17:58:26 +010073 "vendor.lineage.touch-V1.0-java",
LuK13372cb9a5d2019-09-06 23:51:36 +020074 "vendor.lineage.trust-V1.0-java",
Paul Keithb49ed552019-01-18 17:58:26 +010075]
76
Dominik Baronelli74901e12024-06-23 18:36:36 +020077java_library {
Dominik Baronelli320b3b52024-07-14 10:31:47 +020078 name: "services",
Dominik Baronelli74901e12024-06-23 18:36:36 +020079 installable: true,
80 sdk_version: "core_platform",
81 static_libs: [
Dominik Baronelli320b3b52024-07-14 10:31:47 +020082 "original.services",
Dominik Baronelli74901e12024-06-23 18:36:36 +020083 ] + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
84
85 libs: [
86 "framework",
87 ],
88
89 srcs: [
90 library_src + "/**/*.java",
91 lineage_sdk_minimal_internal_src + "/**/*.java",
92 lineage_sdk_src + "/**/*.java",
93 lineage_sdk_src + "/app/I*.aidl",
94 lineage_sdk_src + "/**/I*.aidl",
95 ],
96 // Include aidl files from lineageos.app namespace as well as internal src aidl files
97 aidl: {
98 local_include_dirs: ["sdk/src/java"],
99 },
100}
101
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700102// READ ME: ########################################################
103//
104// When updating this list of aidl files, consider if that aidl is
105// part of the SDK API. If it is, also add it to the list below that
106// is preprocessed and distributed with the SDK. This list should
107// not contain any aidl files for parcelables, but the one below should
108// if you intend for 3rd parties to be able to send those objects
109// across process boundaries.
110//
111// READ ME: ########################################################
112
113java_library {
114 name: "org.lineageos.platform",
LuK133785463df2019-09-07 00:55:40 +0200115 installable: true,
LuK1337fcfcf5d2020-09-14 10:50:41 +0200116 sdk_version: "core_platform",
LuK1337514848c2022-08-30 09:24:33 +0200117 static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700118
119 libs: [
LuK1337fcfcf5d2020-09-14 10:50:41 +0200120 "framework",
Dominik Baronelli320b3b52024-07-14 10:31:47 +0200121 "original.services",
Sam Mortimer3533d382019-05-13 15:28:04 -0700122 ],
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700123
124 srcs: [
125 lineage_sdk_src + "/**/*.java",
126 lineage_sdk_internal_src + "/**/*.java",
127 library_src + "/**/*.java",
128 lineage_sdk_src + "/**/I*.aidl",
129 lineage_sdk_internal_src + "/**/I*.aidl",
130 ],
131
132 // Include aidl files from lineageos.app namespace as well as internal src aidl files
133 aidl: {
134 local_include_dirs: ["sdk/src/java"],
135 },
136}
137
138// Full target for use by platform apps
139// ============================================================
140
Sam Mortimere8814c52019-09-05 14:07:27 -0700141java_library {
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700142 name: "org.lineageos.platform.internal",
Dominik Baronelli320b3b52024-07-14 10:31:47 +0200143 required: ["original.services"],
LuK1337514848c2022-08-30 09:24:33 +0200144 static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700145
146 srcs: [
147 lineage_sdk_src + "/**/*.java",
148 lineage_sdk_internal_src + "/**/*.java",
149 lineage_sdk_src + "/**/I*.aidl",
150 lineage_sdk_internal_src + "/**/I*.aidl",
151 ],
152
153 aidl: {
154 local_include_dirs: ["sdk/src/java"],
155 },
156}
157
LuK13376ba68052022-11-02 12:47:48 +0100158// Resources only target for use by core
159// ============================================================
160
161java_library {
162 name: "org.lineageos.platform.resources",
163
164 srcs: [
165 // For the generated R.java and Manifest.java
166 ":org.lineageos.platform-res{.aapt.srcjar}",
167 ],
168
169 sdk_version: "core_current",
170}
171
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700172// The SDK
173// ============================================================
174
175// Included aidl files from lineageos.app namespace
176
Sam Mortimere8814c52019-09-05 14:07:27 -0700177java_library {
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700178 name: "org.lineageos.platform.sdk",
Dominik Baronelli320b3b52024-07-14 10:31:47 +0200179 required: ["original.services"],
LuK1337514848c2022-08-30 09:24:33 +0200180 static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700181
182 srcs: [
183 lineage_sdk_src + "/**/*.java",
184 lineage_sdk_src + "/**/I*.aidl",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200185
186 // For the generated R.java and Manifest.java
187 ":org.lineageos.platform-res{.aapt.srcjar}",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700188 ],
189
190 aidl: {
191 local_include_dirs: ["sdk/src/java"],
192 },
193}
Sam Mortimer89f20372020-12-10 15:59:40 -0800194
195// Minimal LineageSettings lib for apex use.
196// ============================================================
197
198java_library {
199 name: "org.lineageos.platform.lineagesettings",
Oliver Scott55652b72021-11-08 15:45:35 -0500200 min_sdk_version: "30",
Sam Mortimer89f20372020-12-10 15:59:40 -0800201
202 // LineageSettings is our main target, the rest are deps.
203 srcs: [
204 lineage_sdk_src + "/app/LineageContextConstants.java",
205 lineage_sdk_src + "/providers/LineageSettings.java",
206 lineage_sdk_src + "/trust/ITrustInterface.aidl",
207 lineage_sdk_src + "/trust/TrustInterface.java",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200208
209 // For the generated R.java and Manifest.java
210 ":org.lineageos.platform-res{.aapt.srcjar}",
Sam Mortimer89f20372020-12-10 15:59:40 -0800211 ],
212
213 // List of apex modules that can link against this lib
214 apex_available: [
215 "com.android.tethering",
216 ],
217}