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 17 package android.car.builtin; 18 19 import android.annotation.SystemApi; 20 import android.car.builtin.annotation.AddedIn; 21 import android.car.builtin.annotation.PlatformVersion; 22 import android.os.SystemProperties; 23 24 /** 25 * Class to hold car builtin library's common stuffs. 26 * 27 * @hide 28 */ 29 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) 30 public final class CarBuiltin { 31 /** 32 * System property to define platform minor version. 33 * 34 * <p>Value is int string. Check {@link #PROPERTY_PLATFORM_MINOR_VERSION} for further details. 35 * If not set, default value of {@code 0} is assumed. 36 */ 37 private static final String PROPERTY_PLATFORM_MINOR_VERSION = 38 "ro.android.car.version.platform_minor"; 39 40 /** 41 * Represents a minor version change of car platform for the same 42 * {@link android.os.Build.VERSION#SDK_INT}. 43 * 44 * <p>It will reset to {@code 0} whenever {@link android.os.Build.VERSION#SDK_INT} is updated 45 * and will increase by {@code 1} if car builtin or or other car platform part is changed with 46 * the same {@link android.os.Build.VERSION#SDK_INT}. Client should check this version to use 47 * APIs which were added in a minor only version update. 48 */ 49 @AddedIn(PlatformVersion.TIRAMISU_0) 50 public static final int PLATFORM_VERSION_MINOR_INT = SystemProperties.getInt( 51 PROPERTY_PLATFORM_MINOR_VERSION, /* def= */ 0); 52 CarBuiltin()53 private CarBuiltin() { 54 throw new UnsupportedOperationException(); 55 } 56 } 57