Fix sideload OTA breakage am: 99cbbe7c4c

Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/2918733

Change-Id: I4d6e8f86824aac93a176a4633edaa7b4b660de5c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/payload_consumer/postinstall_runner_action.cc b/payload_consumer/postinstall_runner_action.cc
index 2cfd3c6..bfdd39e 100644
--- a/payload_consumer/postinstall_runner_action.cc
+++ b/payload_consumer/postinstall_runner_action.cc
@@ -36,6 +36,8 @@
 
 #include "update_engine/common/action_processor.h"
 #include "update_engine/common/boot_control_interface.h"
+#include "update_engine/common/error_code_utils.h"
+#include "update_engine/common/platform_constants.h"
 #include "update_engine/common/subprocess.h"
 #include "update_engine/common/utils.h"
 
@@ -443,7 +445,8 @@
   DEFER {
     if (error_code != ErrorCode::kSuccess &&
         error_code != ErrorCode::kUpdatedButNotActive) {
-      LOG(ERROR) << "Postinstall action failed.";
+      LOG(ERROR) << "Postinstall action failed. "
+                 << utils::ErrorCodeToString(error_code);
 
       // Undo any changes done to trigger Powerwash.
       if (powerwash_scheduled_)
@@ -453,10 +456,13 @@
   };
   if (error_code == ErrorCode::kSuccess) {
     if (install_plan_.switch_slot_on_reboot) {
-      if (!boot_control_->GetDynamicPartitionControl()->MapAllPartitions()) {
-        LOG(ERROR) << "Failed to map all partitions before marking snapshot as "
-                      "ready for slot switch.";
-        return;
+      if constexpr (!constants::kIsRecovery) {
+        if (!boot_control_->GetDynamicPartitionControl()->MapAllPartitions()) {
+          LOG(WARNING)
+              << "Failed to map all partitions before marking snapshot as "
+                 "ready for slot switch. Subsequent FinishUpdate() call may or "
+                 "may not work";
+        }
       }
       if (!boot_control_->GetDynamicPartitionControl()->FinishUpdate(
               install_plan_.powerwash_required) ||