1 /* 2 * Copyright (C) 2021 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 android.car.annotation; 18 19 import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 20 import static java.lang.annotation.ElementType.FIELD; 21 import static java.lang.annotation.ElementType.METHOD; 22 import static java.lang.annotation.ElementType.TYPE; 23 import static java.lang.annotation.RetentionPolicy.SOURCE; 24 25 import java.lang.annotation.Retention; 26 import java.lang.annotation.Target; 27 28 /** 29 * Minimum platform sdk version this method / type / field can be used. 30 * 31 * @deprecated use {@link ApiRequirements} instead. 32 * 33 * @hide 34 */ 35 @Retention(SOURCE) 36 @Target({ANNOTATION_TYPE, FIELD, TYPE, METHOD}) 37 @Deprecated 38 public @interface MinimumPlatformSdkVersion { 39 40 /** 41 * Represents the minimum version of Android Platform required to call this API. 42 * 43 * <p> Represents the minimum version of the Android platform (as defined by 44 * {@link android.os.Build.VERSION#SDK_INT}) that is required to call this API. 45 */ majorVersion()46 int majorVersion(); 47 48 /** 49 * Represents the minor version of the Android platform required to call this API. 50 * 51 * <p> Represents the minimum minor version of the Android platform (as defined by 52 * {@link android.car.Car#PLATFORM_VERSION_MINOR_INT}) that is required to call this API. 53 * 54 * <p> The standard Android SDK doesn't provide an API to check incremental versions of the 55 * platform, but Car needs them as the Car APIs can be updated separately from the platform, and 56 * in some cases some APIs might depend on services that are not updatable by Car. This version 57 * would be incresed when Car API version is changed with the same {@link #majorVersion}. 58 */ minorVersion()59 int minorVersion() default 0; 60 } 61