Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a497d5c authored by Allen Webb's avatar Allen Webb Committed by Automerger Merge Worker
Browse files

Merge "dumpsys: Fix compatibility with newer flatbuffers" into main am: f98a8978

parents 2ff4ea18 f98a8978
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -113,7 +113,19 @@ std::string Dumpsys::impl::PrintAsJson(std::string* dumpsys_data) const {
  }

  std::string jsongen;
  // GenerateText was renamed to GenText in 23.5.26 because the return behavior was changed.
  // https://github.com/google/flatbuffers/commit/950a71ab893e96147c30dd91735af6db73f72ae0
#if FLATBUFFERS_VERSION_MAJOR < 23 ||   \
    (FLATBUFFERS_VERSION_MAJOR == 23 && \
     (FLATBUFFERS_VERSION_MINOR < 5 ||  \
      (FLATBUFFERS_VERSION_MINOR == 5 && FLATBUFFERS_VERSION_REVISION < 26)))
  flatbuffers::GenerateText(parser, dumpsys_data->data(), &jsongen);
#else
  const char* error = flatbuffers::GenText(parser, dumpsys_data->data(), &jsongen);
  if (error != nullptr) {
    LOG_WARN("%s", error);
  }
#endif
  return jsongen;
}