Adding error for when overlayfs is enabled in OTA

when running adb remount, overlayfs is enabled on the device interfering
with OTA being able to run. Currently we don't have a good debug message
and users aren't able to realize why the OTA fails. Adding this log will
make it clear this behavior is intended, and we need verity-enabled for
OTA to work

Test: adb remount, update_device.py
Bug: 286889613
Change-Id: Ibcd27911afe6f02ddf0c38ad40904a7e17735b31
diff --git a/aosp/dynamic_partition_control_android.cc b/aosp/dynamic_partition_control_android.cc
index a309b6e..d8df520 100644
--- a/aosp/dynamic_partition_control_android.cc
+++ b/aosp/dynamic_partition_control_android.cc
@@ -48,6 +48,7 @@
 #include "update_engine/aosp/dynamic_partition_utils.h"
 #include "update_engine/common/boot_control_interface.h"
 #include "update_engine/common/dynamic_partition_control_interface.h"
+#include "update_engine/common/error_code.h"
 #include "update_engine/common/platform_constants.h"
 #include "update_engine/common/utils.h"
 #include "update_engine/payload_consumer/cow_writer_file_descriptor.h"
@@ -449,7 +450,8 @@
     uint32_t target_slot,
     const DeltaArchiveManifest& manifest,
     bool update,
-    uint64_t* required_size) {
+    uint64_t* required_size,
+    ErrorCode* error) {
   source_slot_ = source_slot;
   target_slot_ = target_slot;
   if (required_size != nullptr) {
@@ -458,10 +460,14 @@
 
   if (fs_mgr_overlayfs_is_setup()) {
     // Non DAP devices can use overlayfs as well.
-    LOG(WARNING)
+    LOG(ERROR)
         << "overlayfs overrides are active and can interfere with our "
            "resources.\n"
         << "run adb enable-verity to deactivate if required and try again.";
+    if (error) {
+      *error = ErrorCode::kOverlayfsenabledError;
+      return false;
+    }
   }
 
   // If metadata is erased but not formatted, it is possible to not mount
@@ -852,6 +858,7 @@
 
   auto target_device =
       device_dir.Append(GetSuperPartitionName(target_slot)).value();
+
   return StoreMetadata(target_device, builder.get(), target_slot);
 }