Move FinishedSnapshotWrites call to filesystem verifier

FinishedSnapshotWrites() must be called before slot switch and after
finish writing data to the target partition. It also requires all target
partitions to be mapped when calling. Priori to this CL,
PostinstallRunnerAction is responsible for calling
FinishedSnapshotWrites(). However, postinstall action has complicated
logic to decide if partitions should be mapped/unmapped. So it's
difficult to ensure that partitions are mapped before calling
FinishedSnapshotWrites(). To make things simpler, move the
FinishedSnapshotWrites() call to FilesystemVerifierAction.

Since FilesystemVerifierAction is responsible for performing the last
write to partitions(verity writes), this make placement make sense. We
are also guaranteed that partitions will be mapped, as
FilesystemVerifierAction need to map these partitions in order to do
verification.

Test: install VAB test w/o slot switch, call setShouldSwitchSlotOnReboot
Bug: 269397263
Change-Id: I900b529f8b4a0b604bab3a334f61ff9a51139916
diff --git a/aosp/hardware_android.cc b/aosp/hardware_android.cc
index 624cfc9..f8732ab 100644
--- a/aosp/hardware_android.cc
+++ b/aosp/hardware_android.cc
@@ -85,7 +85,7 @@
 }
 
 std::string CalculateVbmetaDigestForInactiveSlot() {
-  AvbSlotVerifyData* avb_slot_data;
+  AvbSlotVerifyData* avb_slot_data{};
 
   auto suffix = fs_mgr_get_other_slot_suffix();
   const char* requested_partitions[] = {nullptr};
@@ -105,8 +105,9 @@
   avb_slot_verify_data_calculate_vbmeta_digest(
       avb_slot_data, AVB_DIGEST_TYPE_SHA256, vbmeta_digest);
 
-  std::string encoded_digest =
+  const std::string encoded_digest =
       base::HexEncode(vbmeta_digest, AVB_SHA256_DIGEST_SIZE);
+  LOG(INFO) << "vbmeta digest for target slot: " << encoded_digest;
   return base::ToLowerASCII(encoded_digest);
 }