diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/os/Build.java | 4 | ||||
| -rw-r--r-- | core/java/android/os/VintfObject.java | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index 3c1cdc9d6da9..a352cdb55615 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -938,7 +938,9 @@ public class Build { if (IS_ENG) return true; if (IS_TREBLE_ENABLED) { - int result = VintfObject.verify(new String[0]); + // If we can run this code, the device should already pass AVB. + // So, we don't need to check AVB here. + int result = VintfObject.verifyWithoutAvb(); if (result != 0) { Slog.e(TAG, "Vendor interface is incompatible, error=" diff --git a/core/java/android/os/VintfObject.java b/core/java/android/os/VintfObject.java index 65b33e59aa04..340f3fb8cd25 100644 --- a/core/java/android/os/VintfObject.java +++ b/core/java/android/os/VintfObject.java @@ -18,7 +18,6 @@ package android.os; import java.util.Map; -import android.util.Log; /** * Java API for libvintf. @@ -40,7 +39,7 @@ public class VintfObject { * Verify that the given metadata for an OTA package is compatible with * this device. * - * @param packageInfo a list of serialized form of HalMaanifest's / + * @param packageInfo a list of serialized form of HalManifest's / * CompatibilityMatri'ces (XML). * @return = 0 if success (compatible) * > 0 if incompatible @@ -48,6 +47,17 @@ public class VintfObject { */ public static native int verify(String[] packageInfo); + /** + * Verify Vintf compatibility on the device without checking AVB + * (Android Verified Boot). It is useful to verify a running system + * image where AVB check is irrelevant. + * + * @return = 0 if success (compatible) + * > 0 if incompatible + * < 0 if any error (mount partition fails, illformed XML, etc.) + */ + public static native int verifyWithoutAvb(); + /// ---------- CTS Device Info /** |
