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