Snap for 7354453 from 6190e295e9db6197226359fcffa3f8ffeb61e7c2 to sc-d1-release

Change-Id: I0590f823392397e4cd4ebb59cb9887922e2cd9b8
diff --git a/FmqInternal.cpp b/FmqInternal.cpp
index 6b95def..886d155 100644
--- a/FmqInternal.cpp
+++ b/FmqInternal.cpp
@@ -16,6 +16,7 @@
 
 #define LOG_TAG "FMQ"
 #include <android-base/logging.h>
+#include <utils/Log.h>
 
 namespace android {
 namespace hardware {
@@ -29,6 +30,10 @@
     LOG(ERROR) << message;
 }
 
+void errorWriteLog(int tag, const char* info) {
+    android_errorWriteLog(tag, info);
+}
+
 }  // namespace details
 }  // namespace hardware
 }  // namespace android
diff --git a/base/fmq/MQDescriptorBase.h b/base/fmq/MQDescriptorBase.h
index 21b8e21..0d18d4c 100644
--- a/base/fmq/MQDescriptorBase.h
+++ b/base/fmq/MQDescriptorBase.h
@@ -54,6 +54,7 @@
 namespace details {
 
 void logError(const std::string& message);
+void errorWriteLog(int tag, const char* message);
 
 typedef uint64_t RingBufferPosition;
 enum GrantorType : int { READPTRPOS = 0, WRITEPTRPOS, DATAPTRPOS, EVFLAGWORDPOS };
diff --git a/include/fmq/MessageQueueBase.h b/include/fmq/MessageQueueBase.h
index 9bf20e4..b932317 100644
--- a/include/fmq/MessageQueueBase.h
+++ b/include/fmq/MessageQueueBase.h
@@ -589,7 +589,9 @@
     const auto& grantors = mDesc->grantors();
     for (const auto& grantor : grantors) {
         if (hardware::details::isAlignedToWordBoundary(grantor.offset) == false) {
+#ifdef __BIONIC__
             __assert(__FILE__, __LINE__, "Grantor offsets need to be aligned");
+#endif
         }
     }
 
@@ -1073,6 +1075,7 @@
         hardware::details::logError(
                 "The write pointer has become misaligned. Writing to the queue is no longer "
                 "possible.");
+        hardware::details::errorWriteLog(0x534e4554, "184963385");
         return false;
     }
     size_t writeOffset = writePtr % mDesc->getSize();
@@ -1164,6 +1167,7 @@
         hardware::details::logError(
                 "The write or read pointer has become misaligned. Reading from the queue is no "
                 "longer possible.");
+        hardware::details::errorWriteLog(0x534e4554, "184963385");
         return false;
     }