Add services.permission java_library_static with Kotlin.
The permission and app op subsystems turned out to have a lot more hidden references throughout the system server and it's infeasible to define system APIs for all those references in U. So to allow utilizing the new unified subsystem for them, we need to keep the new subsystem in the non-updatable platform for now. The Kotlin usage for the new subsystem was approved for the APEX system server JAR inside Permission Mainline module, and we can achieve the same criteria with a standalone Java library module in the non-updatable platform, so that Kotlin is still jarjar'ed, shrunk and only available within this module. A caveat is that because R8 converts Java byte code to Dalvik byte code, it can only be run when producing the final services.jar, instead of directly when compiling this new java_library_static module. Fortunately, services.jar has already enabled R8 shrinking when SYSTEM_OPTIMIZE_JAVA is enabled, and when it's disabled due to dependent JARs, we can still safely confine the shrinking within the new module with a negated rule since no other JARs can depend on the new code. The BloatBuster check showed that on AAOS (with SYSTEM_OPTIMIZE_JAVA disabled), the size of services.odex increased by 1 MB (21.3 MB -> 22.4 MB), but looking at installed-files.json from its build output, the size of services.jar actually decreased by 2 MB (21.8 MB -> 19.4 MB). Since both of them are pinned in memory, and the new ODEX will actually have better performance due to better optimization, it's still a net improvement from the current situation. More details about this is available at b/258943585#comment14. An alternative is to create a standalone system server JAR that's also loaded into SSCP. However, that approach is said to be causing a slight boot time regression in b/155631167. Bug: 182523293 Test: presubmit Test: AyeAye BloatBuster Test: CtsStrictJavaPackagesTestCases Change-Id: Id35e19b941e9abbba0d039f993bbf4ec183554ab
Loading
Please register or sign in to comment