1 
2 /*
3  * Copyright (C) 2018 The Android Open Source Project
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 package libcore.api;
19 
20 import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
21 import static java.lang.annotation.ElementType.CONSTRUCTOR;
22 import static java.lang.annotation.ElementType.FIELD;
23 import static java.lang.annotation.ElementType.METHOD;
24 import static java.lang.annotation.ElementType.TYPE;
25 
26 import java.lang.annotation.Retention;
27 import java.lang.annotation.RetentionPolicy;
28 import java.lang.annotation.Target;
29 
30 /**
31  * Indicates an API is part of a contract provided by the "core" set of
32  * libraries to select parts of the Android software stack.
33  *
34  * <p>This annotation should only appear on either (a) classes that are hidden by <pre>@hide</pre>
35  * javadoc tags or equivalent annotations, or (b) members of such classes. It is for use with
36  * metalava's {@code --show-single-annotation} option and so must be applied at the class level and
37  * applied again each member that is to be made part of the API. Members that are not part of the
38  * API do not have to be explicitly hidden.
39  *
40  * @hide
41  */
42 @IntraCoreApi
43 @Target({TYPE, FIELD, METHOD, CONSTRUCTOR, ANNOTATION_TYPE})
44 @Retention(RetentionPolicy.SOURCE)
45 public @interface CorePlatformApi {
46 
47     /** Enumeration of the possible statuses of the API in the core/platform API surface. */
48     @IntraCoreApi
49     enum Status {
50 
51         /**
52          * This API is considered stable, and so present in both the stable and legacy version of
53          * the API surface.
54         */
55         @IntraCoreApi
56         STABLE,
57 
58         /**
59          * This API is not (yet) considered stable, and so only present in the legacy version of
60          * the API surface.
61          */
62         @IntraCoreApi
63         LEGACY_ONLY
64     }
65 
66     /** The status of the API in the core/platform API surface. */
67     @IntraCoreApi
status()68     Status status() default libcore.api.CorePlatformApi.Status.LEGACY_ONLY;
69 }
70