1 /*
2  * Copyright (C) 2017 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.os;
18 
19 import android.annotation.TestApi;
20 
21 /**
22  * Java API for ::android::vintf::RuntimeInfo. Methods return null / 0 on any error.
23  *
24  * @hide
25  */
26 @TestApi
27 public class VintfRuntimeInfo {
28 
VintfRuntimeInfo()29     private VintfRuntimeInfo() {}
30 
31     static {
32         System.loadLibrary("vintf_jni");
33     }
34 
35     /**
36      * @return /sys/fs/selinux/policyvers, via security_policyvers() native call
37      *
38      * @hide
39      */
getKernelSepolicyVersion()40     public static native long getKernelSepolicyVersion();
41     /**
42      * @return content of /proc/cpuinfo
43      *
44      * @hide
45      */
46     @TestApi
getCpuInfo()47     public static native String getCpuInfo();
48     /**
49      * @return os name extracted from uname() native call
50      *
51      * @hide
52      */
53     @TestApi
getOsName()54     public static native String getOsName();
55     /**
56      * @return node name extracted from uname() native call
57      *
58      * @hide
59      */
60     @TestApi
getNodeName()61     public static native String getNodeName();
62     /**
63      * @return os release extracted from uname() native call
64      *
65      * @hide
66      */
67     @TestApi
getOsRelease()68     public static native String getOsRelease();
69     /**
70      * @return os version extracted from uname() native call
71      *
72      * @hide
73      */
74     @TestApi
getOsVersion()75     public static native String getOsVersion();
76     /**
77      * @return hardware id extracted from uname() native call
78      *
79      * @hide
80      */
81     @TestApi
getHardwareId()82     public static native String getHardwareId();
83     /**
84      * @return kernel version extracted from uname() native call. Format is
85      * {@code x.y.z}.
86      *
87      * @hide
88      */
89     @TestApi
getKernelVersion()90     public static native String getKernelVersion();
91     /**
92      * @return libavb version in OS. Format is {@code x.y}.
93      *
94      * @hide
95      */
getBootAvbVersion()96     public static native String getBootAvbVersion();
97     /**
98      * @return libavb version in bootloader. Format is {@code x.y}.
99      *
100      * @hide
101      */
getBootVbmetaAvbVersion()102     public static native String getBootVbmetaAvbVersion();
103 }
104