summaryrefslogtreecommitdiff
path: root/core/java/android/annotation/SystemApi.java
Commit message (Collapse)AuthorAgeFilesLines
* Remove annotations that have been relocatedChris Wailes2021-04-261-80/+0
| | | | | | | | | These annotations have been relocated to frameworks/libs/modules-utils. This CL removes the files and updates necessary build rules. Bug: 183133670 Test: m Change-Id: I834b9f5320e0b6fe8cb9feb7194c82085b805e07
* Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIsMakoto Onuki2020-07-141-2/+0
| | | | | | Test: build / treehugger Bug: 146727827 Change-Id: Ie1ad6711c490c679ebcfacd97154380a8810ba1c
* Finalize @SystemApi annotationMakoto Onuki2020-02-041-32/+4
| | | | | | Bug: 148177503 Test: Build & tree hugger Change-Id: I4f2394afcc25cdb2b03d58ebcc8d3fb1e4962e1e
* Merge "SystemApi is @Repeatable"Treehugger Robot2020-01-281-0/+12
|\
| * SystemApi is @RepeatableJiyong Park2020-01-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to annotate a class as below: /** @hide */ @SystemApi @SystemApi(client=MODULE_APPS) public class SomeClass { /** @hide */ @SystemApi public void foo() {...} /** @hide */ @SystemApi(client=MODULE_APPS) public void bar() {...} } SomeClass is already annotated as @SystemApi. And we want to make bar() method in it as SystemApi(MODULE_APPS). To do so, the containing class SomeClass has additionally to be annotated as SystemApi(MODULE_APPS), resulting SystemApi annotation to be repeated. Bug: N/A Test: add @SystemApi(client=MODULE_APPS) to an hidden method of an existing SystemApi class (e.g. SystemProperties.set()) and execute `m updata-api`. -> api/module-app-current.txt is updated while api/system-current.txt is unchanged Change-Id: Ifd4d32a6983cfc38f0dd13618652439f6162e0d3
* | Preparing to finalize @SystemApiMakoto Onuki2020-01-271-13/+22
|/ | | | | | | | | | | - MODULE_APPS is considered to be too confusing, we're going to remove it, and may revive it once ART is able to support runtime protection - Change SYSTEM_SERVER to a "client". Test: Build / treehugger Bug: 148177503 Change-Id: Id847e29ab211c4c009c234a2e1e469575914e12e
* Add more enums for the client and process attributes of SystemApiJiyong Park2019-12-191-1/+21
| | | | | | | | | | | | | | | | | | | | | | | For the client attribute, we have - MODULE_APPS for representing APKs implementing modules which are considered part of the platform - MODULE_LIBRARIES for representing jars inside modules. For the process attribute, we have - SYSTEM_SERVER for representing the system_server process. For example, @SystemApi(client=MODULE_LIBRARIES,process=ALL) actually means that the API is meant to be available for classes in the bootclasspath but not to the classes from the app classloader. Bug: 140202860 Test: m Exempt-From-Owner-Approval: cherry-picked from internal Merged-In: Iba6a564a0967e4d109164849ee6d6500d46469de (cherry picked from commit 88d5e494c48318c2de047511ea7494428e4aeb1e) Change-Id: Iba6a564a0967e4d109164849ee6d6500d46469de
* SystemApi is parameterizedJiyong Park2019-12-171-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have decided to reuse the existing annotation @SystemApi for all Java APIs regardless of whether they are for apps or platform internal modules. This was because introducing new annotation types every time when we have to create new API surfaces will only increase the confusion without giving much benefit. Instead, to differenciate the different API surfaces of @SystemApi, the annotation type is parameterized. Specifically, it has to axises. client: specifies the intended client of the API. process: specifies the process(es) that the API is available. The default for client and process are priv-apps and all, respectively, which corresponds to the today's @SystemApi for privileged apps like GMS. Exempt-From-Owner-Approval: cherry-pick from internal Bug: 140202860 Test: m Merged-In: I3305b71e22970e80db95f3daf3d7713603c7d68d (cherry picked from commit 119afc0695cf7632700119bab62a965793c34fd1) Change-Id: I3305b71e22970e80db95f3daf3d7713603c7d68d
* Make SystemApi retained at runtimeJiyong Park2018-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename PrivateApi annotation to SystemApi.Jeff Brown2014-06-061-0/+44
Change-Id: I97b473884f81ad375d0733e4766afe091dfdd854