1 /*
2  * Copyright 2023 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 
17 package androidx.window.extensions;
18 
19 import androidx.annotation.IntRange;
20 import androidx.annotation.RestrictTo;
21 
22 import java.lang.annotation.ElementType;
23 import java.lang.annotation.Retention;
24 import java.lang.annotation.RetentionPolicy;
25 import java.lang.annotation.Target;
26 
27 /**
28  * The annotation used to document the minimum supported vendor API level of the denoted target.
29  */
30 @Retention(value = RetentionPolicy.RUNTIME)
31 @Target({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.FIELD})
32 @RestrictTo(RestrictTo.Scope.LIBRARY)
33 public @interface RequiresVendorApiLevel {
34 
35     /** The minimum required vendor API level of the denoted target. */
36     @IntRange(from = 1)
level()37     int level();
38 
39     /**
40      * The vendor API level that the denoted target started to deprecated, which defaults to
41      * {@link #VENDOR_API_LEVEL_NOT_SET}.
42      */
deprecatedSince()43     int deprecatedSince() default VENDOR_API_LEVEL_NOT_SET;
44 
45     /** Indicates the denoted target is not deprecated. */
46     int VENDOR_API_LEVEL_NOT_SET = -1;
47 }
48