Make SystemApi retained at runtime
SystemApi annotation is now retained at runtime in order for the CtsSignatureTest to extract the list of System APIs from the device and compare it with the known list of the APIs. Until now, the test only ensured that the known list of the APIs exist in the device, but didn't ensured the opposite. In order words, it was possible for device manufacturers to revive the APIs that were once deleted. This will become a problem when SystemAPIs will be allowed to non-system partitions such as vendor. An apk in the vendor partition which is using the revived-but-officially-deleted System API will break when the system partition is replaced with the Generic System Image (GSI) built from AOSP, which doesn't have the deleted API. (Running CTS on GSI is part of the Treble compliance tests) The overhead of retaining this annotation at runtime is small, because the relationship from an entity (a class, a field, a member, etc) to the annotation is recorded as a 4 byte offset field [1]. [1] https://source.android.com/devices/tech/dalvik/dex-format#annotations-directory Bug: 70832217 Bug: 67891551 Test: measure the size increment before and after. framework.jar was increased by 2964 byte. Change-Id: I679b19ac5ce57d33ce59e32b3b1753f8a1962e11
Loading
Please register or sign in to comment