Actually abort update_engine for CHECK failure am: 48b788f045

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic3af8f503dcb06ce3372a4948b42c8c980853ebf
diff --git a/aosp/logging_android.cc b/aosp/logging_android.cc
index 0219075..5ccf7bc 100644
--- a/aosp/logging_android.cc
+++ b/aosp/logging_android.cc
@@ -240,9 +240,16 @@
   std::string_view sv = str_newline;
   ignore_result(android::base::ConsumeSuffix(&sv, "\n"));
   std::string str(sv.data(), sv.size());
-  // This will eventually be redirected to CombinedLogger.
-  // Use nullptr as tag so that liblog infers log tag from getprogname().
-  __android_log_write(priority, nullptr /* tag */, str.c_str());
+
+  if (priority == ANDROID_LOG_FATAL) {
+    // Abort the program for priority FATAL. __android_log_assert will log the
+    // message to stderr and CombinedLogger.
+    __android_log_assert(nullptr, nullptr, "%s", str.c_str());
+  } else {
+    // This will eventually be redirected to CombinedLogger.
+    // Use nullptr as tag so that liblog infers log tag from getprogname().
+    __android_log_write(priority, nullptr /* tag */, str.c_str());
+  }
   return true;
 }