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 import android.util.Log;
22 
23 /**
24  * Java API for libvintf.
25  * @hide
26  */
27 public class VintfObject {
28 
29     /// ---------- OTA
30 
31     /**
32      * Slurps all device information (both manifests and both matrices)
33      * and report them.
34      * If any error in getting one of the manifests, it is not included in
35      * the list.
36      */
report()37     public static native String[] report();
38 
39     /**
40      * Verify that the given metadata for an OTA package is compatible with
41      * this device.
42      *
43      * @param packageInfo a list of serialized form of HalMaanifest's /
44      * CompatibilityMatri'ces (XML).
45      * @return = 0 if success (compatible)
46      *         > 0 if incompatible
47      *         < 0 if any error (mount partition fails, illformed XML, etc.)
48      */
verify(String[] packageInfo)49     public static native int verify(String[] packageInfo);
50 
51     /// ---------- CTS Device Info
52 
53     /**
54      * @return a list of HAL names and versions that is supported by this
55      * device as stated in device and framework manifests. For example,
56      * ["android.hidl.manager@1.0", "android.hardware.camera.device@1.0",
57      *  "android.hardware.camera.device@3.2"]. There are no duplicates.
58      */
getHalNamesAndVersions()59     public static native String[] getHalNamesAndVersions();
60 
61     /**
62      * @return the BOARD_SEPOLICY_VERS build flag available in device manifest.
63      */
getSepolicyVersion()64     public static native String getSepolicyVersion();
65 
66     /**
67      * @return a list of VNDK snapshots supported by the framework, as
68      * specified in framework manifest. For example,
69      * [("25.0.5", ["libjpeg.so", "libbase.so"]),
70      *  ("25.1.3", ["libjpeg.so", "libbase.so"])]
71      */
getVndkSnapshots()72     public static native Map<String, String[]> getVndkSnapshots();
73 }
74