I have developed a library X that is based on androidx.appcompat. Now, I want to include this library as part of the Android system as a Boot Jar.
Here are my specific questions:
- Is it feasible to add androidx.appcompat as part of the bootclasspath in the Android system? Is this approach recommended or even possible from a system perspective?
- Does my library X need to statically depend on androidx.appcompat? In other words, do I need to include androidx.appcompat as part of static_libs when building the Boot Jar?
- If I statically include androidx.appcompat in the Boot Jar, will it cause conflicts with apps that might already dynamically depend on androidx.appcompat?
- How can I prevent potential classloader conflicts?
- Additionally, regarding the Boot Jar’s Hidden API checks, do I need to explicitly list all androidx.appcompat APIs in the allowlist for it to pass the Hidden API monitoring?
Looking forward to any insights or suggestions. Thanks in advance!
I’ve encountered many errors related to hidden API checks, and I’m not sure if this approach is feasible. I’d like to find out if it’s possible.
Android.bp
java_library {
name: "x",
installable: true,
sdk_version: "current",
srcs: [
"src/**/*.java",
":custom-framawork-srcs",
],
static_libs: [
"androidx.appcompat_appcompat",
"com.google.android.material_material",
],
}
prebuilt_etc {
name: "x-permission.xml",
src: "x-permission.xml",
sub_dir: "permissions",
}
car_system.mk
PRODUCT_PACKAGES +=
x
x-permission.xml
PRODUCT_BOOT_JARS +=
x
1