diff --git a/libs/utils/src/Panic.cpp b/libs/utils/src/Panic.cpp index 011070e6ba1a..e18b58c7ed29 100644 --- a/libs/utils/src/Panic.cpp +++ b/libs/utils/src/Panic.cpp @@ -36,6 +36,9 @@ #include #include #include +#if defined(__ANDROID__) +# include +#endif namespace utils { @@ -222,6 +225,13 @@ void TPanic::panic(char const* function, char const* file, int line, char con // Call the user provided handler UserPanicHandler::get().call(e); + // Register the full panic message as the tombstone "Abort message:" so that it + // appears in crash reports collected by Google Play Console and other tools that + // read tombstones from field devices (which never have access to logcat output). +#if defined(__ANDROID__) + android_set_abort_message(e.what()); +#endif + // if exceptions are enabled, throw now. #ifdef __EXCEPTIONS throw e;