summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yifan Hong <elsk@google.com> 2024-01-10 23:54:32 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-01-10 23:54:32 +0000
commite381fddb3aa9a2e44a7f0b49d75162be80e8084c (patch)
tree45fd5db189ef2acc7aa5d9c391b26fb7ed53fadb
parent3354c547a5513dbe844580b327be3f6fdc92127a (diff)
parent3ca617f420b7cd03c8e2d162055a5d6ef93a70f7 (diff)
Merge "Release VintfObject memory after compat check at boot time." into main am: 5330465803 am: e1cee4e6fd am: 3ca617f420
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2901627 Change-Id: I32de06feacbb3ebc7f2298f2d8a9516d1496e436 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--core/jni/android_os_VintfObject.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/jni/android_os_VintfObject.cpp b/core/jni/android_os_VintfObject.cpp
index b6517117ca62..a5b2f65eafc7 100644
--- a/core/jni/android_os_VintfObject.cpp
+++ b/core/jni/android_os_VintfObject.cpp
@@ -96,8 +96,11 @@ static jobjectArray android_os_VintfObject_report(JNIEnv* env, jclass)
static jint android_os_VintfObject_verifyBuildAtBoot(JNIEnv* env, jclass) {
std::string error;
+ // Use temporary VintfObject, not the shared instance, to release memory
+ // after check.
int32_t status =
- VintfObject::GetInstance()
+ VintfObject::Builder()
+ .build()
->checkCompatibility(&error, ENABLE_ALL_CHECKS.disableAvb().disableKernel());
if (status)
LOG(WARNING) << "VintfObject.verifyBuildAtBoot() returns " << status << ": " << error;