Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e331390d authored by Yifan Hong's avatar Yifan Hong Committed by Android (Google) Code Review
Browse files

Merge "Add VintfObject / VintfRuntimeInfo methods to TestApi."

parents fd39d8f9 58578707
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -1118,6 +1118,24 @@ package android.os {
    field public static final android.os.Parcelable.Creator<android.os.VibrationEffect.Waveform> CREATOR;
  }

  public class VintfObject {
    method public static java.lang.String[] getHalNamesAndVersions();
    method public static java.lang.String getSepolicyVersion();
    method public static java.lang.Long getTargetFrameworkCompatibilityMatrixVersion();
    method public static java.util.Map<java.lang.String, java.lang.String[]> getVndkSnapshots();
    method public static java.lang.String[] report();
  }

  public class VintfRuntimeInfo {
    method public static java.lang.String getCpuInfo();
    method public static java.lang.String getHardwareId();
    method public static java.lang.String getKernelVersion();
    method public static java.lang.String getNodeName();
    method public static java.lang.String getOsName();
    method public static java.lang.String getOsRelease();
    method public static java.lang.String getOsVersion();
  }

  public class WorkSource implements android.os.Parcelable {
    ctor public WorkSource(int);
    method public boolean add(int);
+0 −12
Original line number Diff line number Diff line
@@ -1108,18 +1108,6 @@ Landroid/os/UserManager;->isUserUnlocked(I)Z
Landroid/os/UserManager;->mService:Landroid/os/IUserManager;
Landroid/os/UserManager;->removeUser(I)Z
Landroid/os/Vibrator;-><init>()V
Landroid/os/VintfObject;->getHalNamesAndVersions()[Ljava/lang/String;
Landroid/os/VintfObject;->getSepolicyVersion()Ljava/lang/String;
Landroid/os/VintfObject;->getTargetFrameworkCompatibilityMatrixVersion()Ljava/lang/Long;
Landroid/os/VintfObject;->getVndkSnapshots()Ljava/util/Map;
Landroid/os/VintfObject;->report()[Ljava/lang/String;
Landroid/os/VintfRuntimeInfo;->getCpuInfo()Ljava/lang/String;
Landroid/os/VintfRuntimeInfo;->getHardwareId()Ljava/lang/String;
Landroid/os/VintfRuntimeInfo;->getKernelVersion()Ljava/lang/String;
Landroid/os/VintfRuntimeInfo;->getNodeName()Ljava/lang/String;
Landroid/os/VintfRuntimeInfo;->getOsName()Ljava/lang/String;
Landroid/os/VintfRuntimeInfo;->getOsRelease()Ljava/lang/String;
Landroid/os/VintfRuntimeInfo;->getOsVersion()Ljava/lang/String;
Landroid/os/WorkSource;-><init>(Landroid/os/Parcel;)V
Landroid/os/WorkSource;->mNames:[Ljava/lang/String;
Landroid/os/WorkSource;->mNum:I
+29 −8
Original line number Diff line number Diff line
@@ -16,23 +16,27 @@

package android.os;

import java.util.Map;
import android.annotation.TestApi;

import java.util.Map;

/**
 * Java API for libvintf.
 *
 * @hide
 */
@TestApi
public class VintfObject {

    /// ---------- OTA

    /**
     * Slurps all device information (both manifests and both matrices)
     * and report them.
     * If any error in getting one of the manifests, it is not included in
     * the list.
     *
     * @hide
     */
    @TestApi
    public static native String[] report();

    /**
@@ -44,6 +48,8 @@ public class VintfObject {
     * @return = 0 if success (compatible)
     *         > 0 if incompatible
     *         < 0 if any error (mount partition fails, illformed XML, etc.)
     *
     * @hide
     */
    public static native int verify(String[] packageInfo);

@@ -55,22 +61,28 @@ public class VintfObject {
     * @return = 0 if success (compatible)
     *         > 0 if incompatible
     *         < 0 if any error (mount partition fails, illformed XML, etc.)
     *
     * @hide
     */
    public static native int verifyWithoutAvb();

    /// ---------- CTS Device Info

    /**
     * @return a list of HAL names and versions that is supported by this
     * device as stated in device and framework manifests. For example,
     * ["android.hidl.manager@1.0", "android.hardware.camera.device@1.0",
     *  "android.hardware.camera.device@3.2"]. There are no duplicates.
     *
     * @hide
     */
    @TestApi
    public static native String[] getHalNamesAndVersions();

    /**
     * @return the BOARD_SEPOLICY_VERS build flag available in device manifest.
     *
     * @hide
     */
    @TestApi
    public static native String getSepolicyVersion();

    /**
@@ -78,13 +90,22 @@ public class VintfObject {
     * specified in framework manifest. For example,
     * [("27", ["libjpeg.so", "libbase.so"]),
     *  ("28", ["libjpeg.so", "libbase.so"])]
     *
     * @hide
     */
    @TestApi
    public static native Map<String, String[]> getVndkSnapshots();

    /**
     * @return target FCM version, a number specified in the device manifest
     * indicating the FCM version that the device manifest implements. Null if
     * device manifest doesn't specify this number (for legacy devices).
     * @return Target Framework Compatibility Matrix (FCM) version, a number
     * specified in the device manifest indicating the FCM version that the
     * device manifest implements. Null if device manifest doesn't specify this
     * number (for legacy devices).
     *
     * @hide
     */
    @TestApi
    public static native Long getTargetFrameworkCompatibilityMatrixVersion();

    private VintfObject() {}
}
+30 −1
Original line number Diff line number Diff line
@@ -16,55 +16,84 @@

package android.os;

import android.annotation.TestApi;

/**
 * Java API for ::android::vintf::RuntimeInfo. Methods return null / 0 on any error.
 *
 * @hide
 */
@TestApi
public class VintfRuntimeInfo {

    private VintfRuntimeInfo() {}

    /**
     * @return /sys/fs/selinux/policyvers, via security_policyvers() native call
     *
     * @hide
     */
    public static native long getKernelSepolicyVersion();
    /**
     * @return content of /proc/cpuinfo
     *
     * @hide
     */
    @TestApi
    public static native String getCpuInfo();
    /**
     * @return os name extracted from uname() native call
     *
     * @hide
     */
    @TestApi
    public static native String getOsName();
    /**
     * @return node name extracted from uname() native call
     *
     * @hide
     */
    @TestApi
    public static native String getNodeName();
    /**
     * @return os release extracted from uname() native call
     *
     * @hide
     */
    @TestApi
    public static native String getOsRelease();
    /**
     * @return os version extracted from uname() native call
     *
     * @hide
     */
    @TestApi
    public static native String getOsVersion();
    /**
     * @return hardware id extracted from uname() native call
     *
     * @hide
     */
    @TestApi
    public static native String getHardwareId();
    /**
     * @return kernel version extracted from uname() native call. Format is
     * {@code x.y.z}.
     *
     * @hide
     */
    @TestApi
    public static native String getKernelVersion();
    /**
     * @return libavb version in OS. Format is {@code x.y}.
     *
     * @hide
     */
    public static native String getBootAvbVersion();
    /**
     * @return libavb version in bootloader. Format is {@code x.y}.
     *
     * @hide
     */
    public static native String getBootVbmetaAvbVersion();

}