blob: 9a35f3bb3269a9901dca814be87d8dde2b92a9fa [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"
66library_src = "lineage/lib/main/java"
67
Paul Keithb49ed552019-01-18 17:58:26 +010068lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES = [
Luofan Chen3ee21022023-03-01 19:12:53 +080069 "vendor.lineage.health-V1-java",
Paul Keithb49ed552019-01-18 17:58:26 +010070 "vendor.lineage.livedisplay-V2.0-java",
Arian5f3ded72020-07-29 16:01:55 +020071 "vendor.lineage.livedisplay-V2.1-java",
Paul Keithb49ed552019-01-18 17:58:26 +010072 "vendor.lineage.touch-V1.0-java",
LuK13372cb9a5d2019-09-06 23:51:36 +020073 "vendor.lineage.trust-V1.0-java",
Paul Keithb49ed552019-01-18 17:58:26 +010074]
75
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070076// READ ME: ########################################################
77//
78// When updating this list of aidl files, consider if that aidl is
79// part of the SDK API. If it is, also add it to the list below that
80// is preprocessed and distributed with the SDK. This list should
81// not contain any aidl files for parcelables, but the one below should
82// if you intend for 3rd parties to be able to send those objects
83// across process boundaries.
84//
85// READ ME: ########################################################
86
87java_library {
88 name: "org.lineageos.platform",
LuK133785463df2019-09-07 00:55:40 +020089 installable: true,
LuK1337fcfcf5d2020-09-14 10:50:41 +020090 sdk_version: "core_platform",
LuK1337514848c2022-08-30 09:24:33 +020091 static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070092
93 libs: [
LuK1337fcfcf5d2020-09-14 10:50:41 +020094 "framework",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070095 "services",
Sam Mortimer3533d382019-05-13 15:28:04 -070096 ],
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070097
98 srcs: [
99 lineage_sdk_src + "/**/*.java",
100 lineage_sdk_internal_src + "/**/*.java",
101 library_src + "/**/*.java",
102 lineage_sdk_src + "/**/I*.aidl",
103 lineage_sdk_internal_src + "/**/I*.aidl",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200104
105 // For the generated R.java and Manifest.java
106 ":org.lineageos.platform-res{.aapt.srcjar}",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700107 ],
108
109 // Include aidl files from lineageos.app namespace as well as internal src aidl files
110 aidl: {
111 local_include_dirs: ["sdk/src/java"],
112 },
113}
114
115// Full target for use by platform apps
116// ============================================================
117
Sam Mortimere8814c52019-09-05 14:07:27 -0700118java_library {
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700119 name: "org.lineageos.platform.internal",
120 required: ["services"],
LuK1337514848c2022-08-30 09:24:33 +0200121 static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700122
123 srcs: [
124 lineage_sdk_src + "/**/*.java",
125 lineage_sdk_internal_src + "/**/*.java",
126 lineage_sdk_src + "/**/I*.aidl",
127 lineage_sdk_internal_src + "/**/I*.aidl",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200128
129 // For the generated R.java and Manifest.java
130 ":org.lineageos.platform-res{.aapt.srcjar}",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700131 ],
132
133 aidl: {
134 local_include_dirs: ["sdk/src/java"],
135 },
136}
137
LuK13376ba68052022-11-02 12:47:48 +0100138// Resources only target for use by core
139// ============================================================
140
141java_library {
142 name: "org.lineageos.platform.resources",
143
144 srcs: [
145 // For the generated R.java and Manifest.java
146 ":org.lineageos.platform-res{.aapt.srcjar}",
147 ],
148
149 sdk_version: "core_current",
150}
151
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700152// The SDK
153// ============================================================
154
155// Included aidl files from lineageos.app namespace
156
Sam Mortimere8814c52019-09-05 14:07:27 -0700157java_library {
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700158 name: "org.lineageos.platform.sdk",
159 required: ["services"],
LuK1337514848c2022-08-30 09:24:33 +0200160 static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700161
162 srcs: [
163 lineage_sdk_src + "/**/*.java",
164 lineage_sdk_src + "/**/I*.aidl",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200165
166 // For the generated R.java and Manifest.java
167 ":org.lineageos.platform-res{.aapt.srcjar}",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700168 ],
169
170 aidl: {
171 local_include_dirs: ["sdk/src/java"],
172 },
173}
Sam Mortimer89f20372020-12-10 15:59:40 -0800174
175// Minimal LineageSettings lib for apex use.
176// ============================================================
177
178java_library {
179 name: "org.lineageos.platform.lineagesettings",
Oliver Scott55652b72021-11-08 15:45:35 -0500180 min_sdk_version: "30",
Sam Mortimer89f20372020-12-10 15:59:40 -0800181
182 // LineageSettings is our main target, the rest are deps.
183 srcs: [
184 lineage_sdk_src + "/app/LineageContextConstants.java",
185 lineage_sdk_src + "/providers/LineageSettings.java",
186 lineage_sdk_src + "/trust/ITrustInterface.aidl",
187 lineage_sdk_src + "/trust/TrustInterface.java",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200188
189 // For the generated R.java and Manifest.java
190 ":org.lineageos.platform-res{.aapt.srcjar}",
Sam Mortimer89f20372020-12-10 15:59:40 -0800191 ],
192
193 // List of apex modules that can link against this lib
194 apex_available: [
195 "com.android.tethering",
196 ],
197}