diff options
| -rw-r--r-- | core/java/android/annotation/UnsupportedAppUsage.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/core/java/android/annotation/UnsupportedAppUsage.java b/core/java/android/annotation/UnsupportedAppUsage.java new file mode 100644 index 000000000000..05de3e8caa3f --- /dev/null +++ b/core/java/android/annotation/UnsupportedAppUsage.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.annotation; + +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.CLASS; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Indicates that a class member, that is not part of the SDK, is used by apps. + * Since the member is not part of the SDK, such use is not supported. + * + * This annotation acts as a heads up that changing a given method or field + * may affect apps, potentially breaking them when the next Android version is + * released. In some cases, for members that are heavily used, this annotation + * may imply restrictions on changes to the member. + * + * This annotation also results in access to the member being permitted by the + * runtime, with a warning being generated in debug builds. + * + * For more details, see go/UnsupportedAppUsage. + * + * {@hide} + */ +@Retention(CLASS) +@Target({CONSTRUCTOR, METHOD, FIELD}) +public @interface UnsupportedAppUsage { + + /** + * Associates a bug tracking the work to add a public alternative to this API. Optional. + * + * @return ID of the associated tracking bug + */ + long trackingBug() default 0; + + /** + * For debug use only. The expected dex signature to be generated for this API, used to verify + * parts of the build process. + * + * @return A dex API signature. + */ + String expectedSignature() default ""; +} |