blob: 05de3e8caa3fb82406559a202cb581097832c299 [file] [log] [blame]
Mathew Inwood2e615902018-06-26 14:06:27 +01001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package android.annotation;
17
18import static java.lang.annotation.ElementType.CONSTRUCTOR;
19import static java.lang.annotation.ElementType.FIELD;
20import static java.lang.annotation.ElementType.METHOD;
21import static java.lang.annotation.RetentionPolicy.CLASS;
22
23import java.lang.annotation.Retention;
24import java.lang.annotation.Target;
25
26/**
27 * Indicates that a class member, that is not part of the SDK, is used by apps.
28 * Since the member is not part of the SDK, such use is not supported.
29 *
30 * This annotation acts as a heads up that changing a given method or field
31 * may affect apps, potentially breaking them when the next Android version is
32 * released. In some cases, for members that are heavily used, this annotation
33 * may imply restrictions on changes to the member.
34 *
35 * This annotation also results in access to the member being permitted by the
36 * runtime, with a warning being generated in debug builds.
37 *
38 * For more details, see go/UnsupportedAppUsage.
39 *
40 * {@hide}
41 */
42@Retention(CLASS)
43@Target({CONSTRUCTOR, METHOD, FIELD})
44public @interface UnsupportedAppUsage {
45
46 /**
47 * Associates a bug tracking the work to add a public alternative to this API. Optional.
48 *
49 * @return ID of the associated tracking bug
50 */
51 long trackingBug() default 0;
52
53 /**
54 * For debug use only. The expected dex signature to be generated for this API, used to verify
55 * parts of the build process.
56 *
57 * @return A dex API signature.
58 */
59 String expectedSignature() default "";
60}