Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 1 | // |
Arian | 5f3ded7 | 2020-07-29 16:01:55 +0200 | [diff] [blame] | 2 | // Copyright (C) 2018-2021 The LineageOS Project |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 3 | // |
| 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 | |
| 17 | android_app { |
| 18 | name: "org.lineageos.platform-res", |
Paul Duffin | 374e4df | 2019-06-12 13:47:18 +0100 | [diff] [blame] | 19 | sdk_version: "core_platform", |
Luca Stefani | 50ff674 | 2021-10-12 18:00:26 +0200 | [diff] [blame] | 20 | certificate: "platform", |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 21 | |
Luca Stefani | 50ff674 | 2021-10-12 18:00:26 +0200 | [diff] [blame] | 22 | 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-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 34 | aaptflags: [ |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 35 | "--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 Stefani | 50ff674 | 2021-10-12 18:00:26 +0200 | [diff] [blame] | 41 | // Allow overlay to add resource |
| 42 | "--auto-add-overlay", |
| 43 | |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 44 | // 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 Mortimer | e8814c5 | 2019-09-05 14:07:27 -0700 | [diff] [blame] | 54 | "sdk/res/res", |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 55 | ], |
| 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-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 62 | // The LineageOS Platform Framework Library |
| 63 | // ============================================================ |
| 64 | |
| 65 | lineage_sdk_src = "sdk/src/java/lineageos" |
| 66 | lineage_sdk_internal_src = "sdk/src/java/org/lineageos/internal" |
| 67 | library_src = "lineage/lib/main/java" |
| 68 | |
Sam Mortimer | 3533d38 | 2019-05-13 15:28:04 -0700 | [diff] [blame] | 69 | lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES = [ |
| 70 | "androidx.preference_preference", |
Bruno Martins | 01d0bae | 2021-12-31 19:43:27 +0000 | [diff] [blame] | 71 | "SettingsLibMainSwitchPreference", |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 72 | ] |
| 73 | |
Paul Keith | b49ed55 | 2019-01-18 17:58:26 +0100 | [diff] [blame] | 74 | lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES = [ |
Luca Stefani | efe6d13 | 2021-11-16 12:26:45 +0100 | [diff] [blame] | 75 | "android.hardware.usb-V1.3-java", |
Paul Keith | b49ed55 | 2019-01-18 17:58:26 +0100 | [diff] [blame] | 76 | "vendor.lineage.livedisplay-V2.0-java", |
Arian | 5f3ded7 | 2020-07-29 16:01:55 +0200 | [diff] [blame] | 77 | "vendor.lineage.livedisplay-V2.1-java", |
Paul Keith | b49ed55 | 2019-01-18 17:58:26 +0100 | [diff] [blame] | 78 | "vendor.lineage.touch-V1.0-java", |
LuK1337 | 2cb9a5d | 2019-09-06 23:51:36 +0200 | [diff] [blame] | 79 | "vendor.lineage.trust-V1.0-java", |
Paul Keith | b49ed55 | 2019-01-18 17:58:26 +0100 | [diff] [blame] | 80 | ] |
| 81 | |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 82 | // 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 | |
| 93 | java_library { |
| 94 | name: "org.lineageos.platform", |
LuK1337 | 85463df | 2019-09-07 00:55:40 +0200 | [diff] [blame] | 95 | installable: true, |
LuK1337 | fcfcf5d | 2020-09-14 10:50:41 +0200 | [diff] [blame] | 96 | sdk_version: "core_platform", |
Bruno Martins | 7bf7432 | 2020-10-08 11:49:27 +0100 | [diff] [blame] | 97 | static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES, |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 98 | |
| 99 | libs: [ |
LuK1337 | fcfcf5d | 2020-09-14 10:50:41 +0200 | [diff] [blame] | 100 | "framework", |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 101 | "services", |
Sam Mortimer | 3533d38 | 2019-05-13 15:28:04 -0700 | [diff] [blame] | 102 | ], |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 103 | |
| 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 Stefani | 04c0fc1 | 2021-10-12 18:00:43 +0200 | [diff] [blame] | 110 | |
| 111 | // For the generated R.java and Manifest.java |
| 112 | ":org.lineageos.platform-res{.aapt.srcjar}", |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 113 | ], |
| 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 Mortimer | e8814c5 | 2019-09-05 14:07:27 -0700 | [diff] [blame] | 124 | java_library { |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 125 | name: "org.lineageos.platform.internal", |
| 126 | required: ["services"], |
Bruno Martins | 7bf7432 | 2020-10-08 11:49:27 +0100 | [diff] [blame] | 127 | static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES, |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 128 | |
| 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 Stefani | 04c0fc1 | 2021-10-12 18:00:43 +0200 | [diff] [blame] | 134 | |
| 135 | // For the generated R.java and Manifest.java |
| 136 | ":org.lineageos.platform-res{.aapt.srcjar}", |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 137 | ], |
| 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 Mortimer | e8814c5 | 2019-09-05 14:07:27 -0700 | [diff] [blame] | 149 | java_library { |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 150 | name: "org.lineageos.platform.sdk", |
| 151 | required: ["services"], |
Sam Mortimer | 3533d38 | 2019-05-13 15:28:04 -0700 | [diff] [blame] | 152 | static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES, |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 153 | |
| 154 | srcs: [ |
| 155 | lineage_sdk_src + "/**/*.java", |
| 156 | lineage_sdk_src + "/**/I*.aidl", |
Luca Stefani | 04c0fc1 | 2021-10-12 18:00:43 +0200 | [diff] [blame] | 157 | |
| 158 | // For the generated R.java and Manifest.java |
| 159 | ":org.lineageos.platform-res{.aapt.srcjar}", |
Rashed Abdel-Tawab | 703249a | 2018-08-09 16:47:40 -0700 | [diff] [blame] | 160 | ], |
| 161 | |
| 162 | aidl: { |
| 163 | local_include_dirs: ["sdk/src/java"], |
| 164 | }, |
| 165 | } |
Sam Mortimer | 89f2037 | 2020-12-10 15:59:40 -0800 | [diff] [blame] | 166 | |
| 167 | // Minimal LineageSettings lib for apex use. |
| 168 | // ============================================================ |
| 169 | |
| 170 | java_library { |
| 171 | name: "org.lineageos.platform.lineagesettings", |
Oliver Scott | 55652b7 | 2021-11-08 15:45:35 -0500 | [diff] [blame] | 172 | min_sdk_version: "30", |
Sam Mortimer | 89f2037 | 2020-12-10 15:59:40 -0800 | [diff] [blame] | 173 | |
| 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 Stefani | 04c0fc1 | 2021-10-12 18:00:43 +0200 | [diff] [blame] | 180 | |
| 181 | // For the generated R.java and Manifest.java |
| 182 | ":org.lineageos.platform-res{.aapt.srcjar}", |
Sam Mortimer | 89f2037 | 2020-12-10 15:59:40 -0800 | [diff] [blame] | 183 | ], |
| 184 | |
| 185 | // List of apex modules that can link against this lib |
| 186 | apex_available: [ |
| 187 | "com.android.tethering", |
| 188 | ], |
| 189 | } |