From 14a1ab1b9d4a1d61a626526ebcb46a8b6d0e956f Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Mon, 27 Jan 2020 08:38:11 -0800 Subject: Preparing to finalize @SystemApi - 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 --- core/java/android/annotation/SystemApi.java | 35 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/core/java/android/annotation/SystemApi.java b/core/java/android/annotation/SystemApi.java index 2cb93e4f8cea..1a8b78ff08cf 100644 --- a/core/java/android/annotation/SystemApi.java +++ b/core/java/android/annotation/SystemApi.java @@ -44,35 +44,43 @@ public @interface SystemApi { enum Client { /** * Specifies that the intended clients of a SystemApi are privileged apps. - * This is the default value for {@link #client}. This implies - * MODULE_APPS and MODULE_LIBRARIES as well, which means that APIs will also - * be available to module apps and jars. + * This is the default value for {@link #client}. + * TODO Update the javadoc according to the final spec */ PRIVILEGED_APPS, /** - * Specifies that the intended clients of a SystemApi are modules implemented - * as apps, like the NetworkStack app. This implies MODULE_LIBRARIES as well, - * which means that APIs will also be available to module jars. + * DO NOT USE. Use PRIVILEGED_APPS instead. + * (This would provide no further protection over PRIVILEGED_APPS; do not rely on it) + * @deprecated Use #PRIVILEGED_APPS instead */ + @Deprecated MODULE_APPS, /** * Specifies that the intended clients of a SystemApi are modules implemented * as libraries, like the conscrypt.jar in the conscrypt APEX. + * TODO Update the javadoc according to the final spec */ - MODULE_LIBRARIES - } + MODULE_LIBRARIES, - enum Process { /** - * Specifies that the SystemAPI is available in every Java processes. - * This is the default value for {@link #process}. + * Specifies that the system API is available only in the system server process. + * Use this to expose APIs from code loaded by the system server process but + * not in
BOOTCLASSPATH
. + * TODO(b/148177503) Update "services-stubs" and actually use it. */ + SYSTEM_SERVER + } + + /** @deprecated do not use */ + @Deprecated + enum Process { + /** @deprecated do not use */ ALL, /** - * Specifies that the SystemAPI is available only in the system server process. + * @deprecated use Client#SYSTEM_SERVER instead */ SYSTEM_SERVER } @@ -83,7 +91,8 @@ public @interface SystemApi { Client client() default android.annotation.SystemApi.Client.PRIVILEGED_APPS; /** - * The process(es) that this SystemAPI is available + * @deprecated use Client#SYSTEM_SERVER instead for system_server APIs */ + @Deprecated Process process() default android.annotation.SystemApi.Process.ALL; } -- cgit v1.2.3-59-g8ed1b