| /* |
| * Copyright (C) 2022 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.car; |
| |
| import android.annotation.NonNull; |
| import android.car.annotation.AddedIn; |
| import android.os.Build; |
| |
| /** |
| * Represents the API version of the standard Android SDK. |
| */ |
| @AddedIn(majorVersion = 33, minorVersion = 1) |
| public final class PlatformApiVersion extends ApiVersion<PlatformApiVersion> { |
| |
| /** |
| * Helper object for main version of Android 13. |
| */ |
| @AddedIn(majorVersion = 33, minorVersion = 1) |
| @NonNull |
| public static final PlatformApiVersion TIRAMISU_0 = |
| forMajorAndMinorVersions(Build.VERSION_CODES.TIRAMISU, 0); |
| |
| /** |
| * Helper object for first minor upgrade of Android 13. |
| */ |
| @AddedIn(majorVersion = 33, minorVersion = 1) |
| @NonNull |
| public static final PlatformApiVersion TIRAMISU_1 = |
| forMajorAndMinorVersions(Build.VERSION_CODES.TIRAMISU, 1); |
| |
| /** |
| * Creates a new instance with the given major and minor versions. |
| */ |
| @AddedIn(majorVersion = 33, minorVersion = 1) |
| @NonNull |
| public static PlatformApiVersion forMajorAndMinorVersions(int majorVersion, int minorVersion) { |
| return new PlatformApiVersion(majorVersion, minorVersion); |
| } |
| |
| /** |
| * Creates a new instance for a major version (i.e., the minor version will be {@code 0}. |
| */ |
| @AddedIn(majorVersion = 33, minorVersion = 1) |
| @NonNull |
| public static PlatformApiVersion forMajorVersion(int majorVersion) { |
| return new PlatformApiVersion(majorVersion, /* minorVersion= */ 0); |
| } |
| |
| private PlatformApiVersion(int majorVersion, int minorVersion) { |
| super(majorVersion, minorVersion); |
| } |
| } |