1 /* 2 * Copyright (C) 2022 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 */ 16 package android.annotation; 17 18 import static java.lang.annotation.ElementType.CONSTRUCTOR; 19 import static java.lang.annotation.ElementType.FIELD; 20 import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 21 import static java.lang.annotation.ElementType.METHOD; 22 import static java.lang.annotation.ElementType.PACKAGE; 23 import static java.lang.annotation.ElementType.PARAMETER; 24 import static java.lang.annotation.ElementType.TYPE; 25 import static java.lang.annotation.RetentionPolicy.SOURCE; 26 27 import java.lang.annotation.Retention; 28 import java.lang.annotation.Target; 29 30 /** 31 * The annotated element is considered deprecated in the public SDK. This will be turned into a 32 * plain @Deprecated annotation in the SDK. 33 * 34 * <p>The value parameter should be the message to include in the documentation as a @deprecated 35 * comment. 36 * 37 * @hide 38 */ 39 @Retention(SOURCE) 40 @Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE}) 41 public @interface DeprecatedForSdk { 42 /** 43 * The message to include in the documentation, which will be merged in as a @deprecated 44 * tag. 45 */ value()46 String value(); 47 48 /** 49 * If specified, one or more annotation classes corresponding to particular API surfaces where 50 * the API will <b>not</b> be marked as deprecated, such as {@link SystemApi} or {@link 51 * TestApi}. 52 */ allowIn()53 Class<?>[] allowIn() default {}; 54 } 55