Home | History | Annotate | Download | only in os
      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 java.util.Map;
     20 
     21 
     22 /**
     23  * Java API for libvintf.
     24  * @hide
     25  */
     26 public class VintfObject {
     27 
     28     /// ---------- OTA
     29 
     30     /**
     31      * Slurps all device information (both manifests and both matrices)
     32      * and report them.
     33      * If any error in getting one of the manifests, it is not included in
     34      * the list.
     35      */
     36     public static native String[] report();
     37 
     38     /**
     39      * Verify that the given metadata for an OTA package is compatible with
     40      * this device.
     41      *
     42      * @param packageInfo a list of serialized form of HalManifest's /
     43      * CompatibilityMatri'ces (XML).
     44      * @return = 0 if success (compatible)
     45      *         > 0 if incompatible
     46      *         < 0 if any error (mount partition fails, illformed XML, etc.)
     47      */
     48     public static native int verify(String[] packageInfo);
     49 
     50     /**
     51      * Verify Vintf compatibility on the device without checking AVB
     52      * (Android Verified Boot). It is useful to verify a running system
     53      * image where AVB check is irrelevant.
     54      *
     55      * @return = 0 if success (compatible)
     56      *         > 0 if incompatible
     57      *         < 0 if any error (mount partition fails, illformed XML, etc.)
     58      */
     59     public static native int verifyWithoutAvb();
     60 
     61     /// ---------- CTS Device Info
     62 
     63     /**
     64      * @return a list of HAL names and versions that is supported by this
     65      * device as stated in device and framework manifests. For example,
     66      * ["android.hidl.manager (at) 1.0", "android.hardware.camera.device (at) 1.0",
     67      *  "android.hardware.camera.device (at) 3.2"]. There are no duplicates.
     68      */
     69     public static native String[] getHalNamesAndVersions();
     70 
     71     /**
     72      * @return the BOARD_SEPOLICY_VERS build flag available in device manifest.
     73      */
     74     public static native String getSepolicyVersion();
     75 
     76     /**
     77      * @return a list of VNDK snapshots supported by the framework, as
     78      * specified in framework manifest. For example,
     79      * [("27", ["libjpeg.so", "libbase.so"]),
     80      *  ("28", ["libjpeg.so", "libbase.so"])]
     81      */
     82     public static native Map<String, String[]> getVndkSnapshots();
     83 
     84     /**
     85      * @return target FCM version, a number specified in the device manifest
     86      * indicating the FCM version that the device manifest implements. Null if
     87      * device manifest doesn't specify this number (for legacy devices).
     88      */
     89     public static native Long getTargetFrameworkCompatibilityMatrixVersion();
     90 }
     91