blob: 01488d3c57beea725463c749236ab4903b428ccf [file] [log] [blame]
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -07001//
Arian5f3ded72020-07-29 16:01:55 +02002// Copyright (C) 2018-2021 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",
Sam Mortimere8814c52019-09-05 14:07:27 -070054 "sdk/res/res",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070055 ],
56
57 // Create package-export.apk, which other packages can use to get
58 // PRODUCT-agnostic resource data like IDs and type definitions.
59 export_package_resources: true,
60}
61
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070062// The LineageOS Platform Framework Library
63// ============================================================
64
65lineage_sdk_src = "sdk/src/java/lineageos"
66lineage_sdk_internal_src = "sdk/src/java/org/lineageos/internal"
67library_src = "lineage/lib/main/java"
68
Sam Mortimer3533d382019-05-13 15:28:04 -070069lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES = [
70 "androidx.preference_preference",
Bruno Martins01d0bae2021-12-31 19:43:27 +000071 "SettingsLibMainSwitchPreference",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070072]
73
Paul Keithb49ed552019-01-18 17:58:26 +010074lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES = [
Luca Stefaniefe6d132021-11-16 12:26:45 +010075 "android.hardware.usb-V1.3-java",
Paul Keithb49ed552019-01-18 17:58:26 +010076 "vendor.lineage.livedisplay-V2.0-java",
Arian5f3ded72020-07-29 16:01:55 +020077 "vendor.lineage.livedisplay-V2.1-java",
Paul Keithb49ed552019-01-18 17:58:26 +010078 "vendor.lineage.touch-V1.0-java",
LuK13372cb9a5d2019-09-06 23:51:36 +020079 "vendor.lineage.trust-V1.0-java",
Paul Keithb49ed552019-01-18 17:58:26 +010080]
81
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070082// READ ME: ########################################################
83//
84// When updating this list of aidl files, consider if that aidl is
85// part of the SDK API. If it is, also add it to the list below that
86// is preprocessed and distributed with the SDK. This list should
87// not contain any aidl files for parcelables, but the one below should
88// if you intend for 3rd parties to be able to send those objects
89// across process boundaries.
90//
91// READ ME: ########################################################
92
93java_library {
94 name: "org.lineageos.platform",
LuK133785463df2019-09-07 00:55:40 +020095 installable: true,
LuK1337fcfcf5d2020-09-14 10:50:41 +020096 sdk_version: "core_platform",
Bruno Martins7bf74322020-10-08 11:49:27 +010097 static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -070098
99 libs: [
LuK1337fcfcf5d2020-09-14 10:50:41 +0200100 "framework",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700101 "services",
Sam Mortimer3533d382019-05-13 15:28:04 -0700102 ],
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700103
104 srcs: [
105 lineage_sdk_src + "/**/*.java",
106 lineage_sdk_internal_src + "/**/*.java",
107 library_src + "/**/*.java",
108 lineage_sdk_src + "/**/I*.aidl",
109 lineage_sdk_internal_src + "/**/I*.aidl",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200110
111 // For the generated R.java and Manifest.java
112 ":org.lineageos.platform-res{.aapt.srcjar}",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700113 ],
114
115 // Include aidl files from lineageos.app namespace as well as internal src aidl files
116 aidl: {
117 local_include_dirs: ["sdk/src/java"],
118 },
119}
120
121// Full target for use by platform apps
122// ============================================================
123
Sam Mortimere8814c52019-09-05 14:07:27 -0700124java_library {
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700125 name: "org.lineageos.platform.internal",
126 required: ["services"],
Bruno Martins7bf74322020-10-08 11:49:27 +0100127 static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700128
129 srcs: [
130 lineage_sdk_src + "/**/*.java",
131 lineage_sdk_internal_src + "/**/*.java",
132 lineage_sdk_src + "/**/I*.aidl",
133 lineage_sdk_internal_src + "/**/I*.aidl",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200134
135 // For the generated R.java and Manifest.java
136 ":org.lineageos.platform-res{.aapt.srcjar}",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700137 ],
138
139 aidl: {
140 local_include_dirs: ["sdk/src/java"],
141 },
142}
143
144// The SDK
145// ============================================================
146
147// Included aidl files from lineageos.app namespace
148
Sam Mortimere8814c52019-09-05 14:07:27 -0700149java_library {
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700150 name: "org.lineageos.platform.sdk",
151 required: ["services"],
Sam Mortimer3533d382019-05-13 15:28:04 -0700152 static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700153
154 srcs: [
155 lineage_sdk_src + "/**/*.java",
156 lineage_sdk_src + "/**/I*.aidl",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200157
158 // For the generated R.java and Manifest.java
159 ":org.lineageos.platform-res{.aapt.srcjar}",
Rashed Abdel-Tawab703249a2018-08-09 16:47:40 -0700160 ],
161
162 aidl: {
163 local_include_dirs: ["sdk/src/java"],
164 },
165}
Sam Mortimer89f20372020-12-10 15:59:40 -0800166
167// Minimal LineageSettings lib for apex use.
168// ============================================================
169
170java_library {
171 name: "org.lineageos.platform.lineagesettings",
Oliver Scott55652b72021-11-08 15:45:35 -0500172 min_sdk_version: "30",
Sam Mortimer89f20372020-12-10 15:59:40 -0800173
174 // LineageSettings is our main target, the rest are deps.
175 srcs: [
176 lineage_sdk_src + "/app/LineageContextConstants.java",
177 lineage_sdk_src + "/providers/LineageSettings.java",
178 lineage_sdk_src + "/trust/ITrustInterface.aidl",
179 lineage_sdk_src + "/trust/TrustInterface.java",
Luca Stefani04c0fc12021-10-12 18:00:43 +0200180
181 // For the generated R.java and Manifest.java
182 ":org.lineageos.platform-res{.aapt.srcjar}",
Sam Mortimer89f20372020-12-10 15:59:40 -0800183 ],
184
185 // List of apex modules that can link against this lib
186 apex_available: [
187 "com.android.tethering",
188 ],
189}