Loading update_verifier/Android.bp +5 −0 Original line number Diff line number Diff line Loading @@ -42,12 +42,15 @@ cc_library_static { static_libs: [ "libotautil", "libvold_binder", ], shared_libs: [ "android.hardware.boot@1.0", "libbase", "libcutils", "libbinder", "libutils", ], proto: { Loading @@ -70,6 +73,7 @@ cc_binary { static_libs: [ "libupdate_verifier", "libotautil", "libvold_binder", ], shared_libs: [ Loading @@ -80,6 +84,7 @@ cc_binary { "libhidlbase", "liblog", "libprotobuf-cpp-lite", "libbinder", "libutils", ], Loading update_verifier/update_verifier.cpp +26 −6 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ */ #include "update_verifier/update_verifier.h" #include <android/os/IVold.h> #include <dirent.h> #include <errno.h> Loading @@ -56,6 +57,8 @@ #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <binder/BinderService.h> #include <binder/Status.h> #include <cutils/android_reboot.h> #include "care_map.pb.h" Loading Loading @@ -376,6 +379,20 @@ int update_verifier(int argc, char** argv) { } } bool supports_checkpoint = false; auto sm = android::defaultServiceManager(); android::sp<android::IBinder> binder = sm->getService(android::String16("vold")); if (binder) { auto vold = android::interface_cast<android::os::IVold>(binder); android::binder::Status status = vold->supportsCheckpoint(&supports_checkpoint); if (!status.isOk()) { LOG(ERROR) << "Failed to check if checkpoints supported. Continuing"; } } else { LOG(ERROR) << "Failed to obtain vold Binder. Continuing"; } if (!supports_checkpoint) { CommandResult cr; module->markBootSuccessful([&cr](CommandResult result) { cr = result; }); if (!cr.success) { Loading @@ -383,6 +400,9 @@ int update_verifier(int argc, char** argv) { return reboot_device(); } LOG(INFO) << "Marked slot " << current_slot << " as booted successfully."; } else { LOG(INFO) << "Deferred marking slot " << current_slot << " as booted successfully."; } } LOG(INFO) << "Leaving update_verifier."; Loading Loading
update_verifier/Android.bp +5 −0 Original line number Diff line number Diff line Loading @@ -42,12 +42,15 @@ cc_library_static { static_libs: [ "libotautil", "libvold_binder", ], shared_libs: [ "android.hardware.boot@1.0", "libbase", "libcutils", "libbinder", "libutils", ], proto: { Loading @@ -70,6 +73,7 @@ cc_binary { static_libs: [ "libupdate_verifier", "libotautil", "libvold_binder", ], shared_libs: [ Loading @@ -80,6 +84,7 @@ cc_binary { "libhidlbase", "liblog", "libprotobuf-cpp-lite", "libbinder", "libutils", ], Loading
update_verifier/update_verifier.cpp +26 −6 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ */ #include "update_verifier/update_verifier.h" #include <android/os/IVold.h> #include <dirent.h> #include <errno.h> Loading @@ -56,6 +57,8 @@ #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <binder/BinderService.h> #include <binder/Status.h> #include <cutils/android_reboot.h> #include "care_map.pb.h" Loading Loading @@ -376,6 +379,20 @@ int update_verifier(int argc, char** argv) { } } bool supports_checkpoint = false; auto sm = android::defaultServiceManager(); android::sp<android::IBinder> binder = sm->getService(android::String16("vold")); if (binder) { auto vold = android::interface_cast<android::os::IVold>(binder); android::binder::Status status = vold->supportsCheckpoint(&supports_checkpoint); if (!status.isOk()) { LOG(ERROR) << "Failed to check if checkpoints supported. Continuing"; } } else { LOG(ERROR) << "Failed to obtain vold Binder. Continuing"; } if (!supports_checkpoint) { CommandResult cr; module->markBootSuccessful([&cr](CommandResult result) { cr = result; }); if (!cr.success) { Loading @@ -383,6 +400,9 @@ int update_verifier(int argc, char** argv) { return reboot_device(); } LOG(INFO) << "Marked slot " << current_slot << " as booted successfully."; } else { LOG(INFO) << "Deferred marking slot " << current_slot << " as booted successfully."; } } LOG(INFO) << "Leaving update_verifier."; Loading