| 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 | |
| 29 | private VintfRuntimeInfo() {} |
| 30 | |
| 31 | /** |
| 32 | * @return /sys/fs/selinux/policyvers, via security_policyvers() native call |
| 33 | * |
| 34 | * @hide |
| 35 | */ |
| 36 | public static native long getKernelSepolicyVersion(); |
| 37 | /** |
| 38 | * @return content of /proc/cpuinfo |
| 39 | * |
| 40 | * @hide |
| 41 | */ |
| 42 | @TestApi |
| 43 | public static native String getCpuInfo(); |
| 44 | /** |
| 45 | * @return os name extracted from uname() native call |
| 46 | * |
| 47 | * @hide |
| 48 | */ |
| 49 | @TestApi |
| 50 | public static native String getOsName(); |
| 51 | /** |
| 52 | * @return node name extracted from uname() native call |
| 53 | * |
| 54 | * @hide |
| 55 | */ |
| 56 | @TestApi |
| 57 | public static native String getNodeName(); |
| 58 | /** |
| 59 | * @return os release extracted from uname() native call |
| 60 | * |
| 61 | * @hide |
| 62 | */ |
| 63 | @TestApi |
| 64 | public static native String getOsRelease(); |
| 65 | /** |
| 66 | * @return os version extracted from uname() native call |
| 67 | * |
| 68 | * @hide |
| 69 | */ |
| 70 | @TestApi |
| 71 | public static native String getOsVersion(); |
| 72 | /** |
| 73 | * @return hardware id extracted from uname() native call |
| 74 | * |
| 75 | * @hide |
| 76 | */ |
| 77 | @TestApi |
| 78 | public static native String getHardwareId(); |
| 79 | /** |
| 80 | * @return kernel version extracted from uname() native call. Format is |
| 81 | * {@code x.y.z}. |
| 82 | * |
| 83 | * @hide |
| 84 | */ |
| 85 | @TestApi |
| 86 | public static native String getKernelVersion(); |
| 87 | /** |
| 88 | * @return libavb version in OS. Format is {@code x.y}. |
| 89 | * |
| 90 | * @hide |
| 91 | */ |
| 92 | public static native String getBootAvbVersion(); |
| 93 | /** |
| 94 | * @return libavb version in bootloader. Format is {@code x.y}. |
| 95 | * |
| 96 | * @hide |
| 97 | */ |
| 98 | public static native String getBootVbmetaAvbVersion(); |
| 99 | } |