blob: f17039ba9bf48be55c7ca5506ebe2e699eaa6220 [file] [log] [blame]
Yifan Hong1bda6732017-04-26 11:38:01 -07001/*
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
17package android.os;
18
Yifan Hong58578702019-01-11 16:35:50 -080019import android.annotation.TestApi;
20
Yifan Hong1bda6732017-04-26 11:38:01 -070021/**
22 * Java API for ::android::vintf::RuntimeInfo. Methods return null / 0 on any error.
23 *
24 * @hide
25 */
Yifan Hong58578702019-01-11 16:35:50 -080026@TestApi
Yifan Hong1bda6732017-04-26 11:38:01 -070027public class VintfRuntimeInfo {
28
29 private VintfRuntimeInfo() {}
30
31 /**
32 * @return /sys/fs/selinux/policyvers, via security_policyvers() native call
Yifan Hong58578702019-01-11 16:35:50 -080033 *
34 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070035 */
36 public static native long getKernelSepolicyVersion();
37 /**
38 * @return content of /proc/cpuinfo
Yifan Hong58578702019-01-11 16:35:50 -080039 *
40 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070041 */
Yifan Hong58578702019-01-11 16:35:50 -080042 @TestApi
Yifan Hong1bda6732017-04-26 11:38:01 -070043 public static native String getCpuInfo();
44 /**
45 * @return os name extracted from uname() native call
Yifan Hong58578702019-01-11 16:35:50 -080046 *
47 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070048 */
Yifan Hong58578702019-01-11 16:35:50 -080049 @TestApi
Yifan Hong1bda6732017-04-26 11:38:01 -070050 public static native String getOsName();
51 /**
52 * @return node name extracted from uname() native call
Yifan Hong58578702019-01-11 16:35:50 -080053 *
54 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070055 */
Yifan Hong58578702019-01-11 16:35:50 -080056 @TestApi
Yifan Hong1bda6732017-04-26 11:38:01 -070057 public static native String getNodeName();
58 /**
59 * @return os release extracted from uname() native call
Yifan Hong58578702019-01-11 16:35:50 -080060 *
61 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070062 */
Yifan Hong58578702019-01-11 16:35:50 -080063 @TestApi
Yifan Hong1bda6732017-04-26 11:38:01 -070064 public static native String getOsRelease();
65 /**
66 * @return os version extracted from uname() native call
Yifan Hong58578702019-01-11 16:35:50 -080067 *
68 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070069 */
Yifan Hong58578702019-01-11 16:35:50 -080070 @TestApi
Yifan Hong1bda6732017-04-26 11:38:01 -070071 public static native String getOsVersion();
72 /**
73 * @return hardware id extracted from uname() native call
Yifan Hong58578702019-01-11 16:35:50 -080074 *
75 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070076 */
Yifan Hong58578702019-01-11 16:35:50 -080077 @TestApi
Yifan Hong1bda6732017-04-26 11:38:01 -070078 public static native String getHardwareId();
79 /**
80 * @return kernel version extracted from uname() native call. Format is
81 * {@code x.y.z}.
Yifan Hong58578702019-01-11 16:35:50 -080082 *
83 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070084 */
Yifan Hong58578702019-01-11 16:35:50 -080085 @TestApi
Yifan Hong1bda6732017-04-26 11:38:01 -070086 public static native String getKernelVersion();
87 /**
88 * @return libavb version in OS. Format is {@code x.y}.
Yifan Hong58578702019-01-11 16:35:50 -080089 *
90 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070091 */
92 public static native String getBootAvbVersion();
93 /**
94 * @return libavb version in bootloader. Format is {@code x.y}.
Yifan Hong58578702019-01-11 16:35:50 -080095 *
96 * @hide
Yifan Hong1bda6732017-04-26 11:38:01 -070097 */
98 public static native String getBootVbmetaAvbVersion();
Yifan Hong1bda6732017-04-26 11:38:01 -070099}