Skip to content

Commit

Permalink
dlt-logd-converter: fixes android 12 compilation (#445)
Browse files Browse the repository at this point in the history
* Since android 12 release (and the introduction of this commit
https://chromium.googlesource.com/aosp/platform/system/
logging/+/b674866203f05957b2ac5db94c3c0fe3d1d36793), the define
ANDROID_LOG_RDONLY and friends have been removed (see the commit
for the explanation). Therefore, dlt-logd-converter can't compile
anymore since this version.
* ANDROID_LOG_RDONLY was a define on O_RDONLY. O_RDONLY is now used
to allow the compilation on android 12 as well as previous versions
* <log/logprint.h> include is removed because we aren't using any
API from this file and moreover, this file shouldn't be included from
vendor application (not part of public API)
* Direct include on "system/core/include" inside Android.bp is removed
because it was previously used to find <log/logprint.h>. This should
be avoided. We should keep android build system providing right
headers path for us :)

Signed-off-by: Sébastien RAILLET <[email protected]>
  • Loading branch information
sebastienr authored Mar 14, 2023
1 parent 363d433 commit 4149df6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ cc_binary {
"libdlt",
"liblog",
],
include_dirs: [
"system/core/include",
],
}

// vim: ft=python
Expand Down
3 changes: 1 addition & 2 deletions src/android/dlt-logd-converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <csignal>

#include <log/log_read.h>
#include <log/logprint.h>

#include <dlt.h>

Expand Down Expand Up @@ -51,7 +50,7 @@ static inline struct logger *init_logger(struct logger_list *logger_list, log_id
static struct logger_list *init_logger_list(bool skip_binary_buffers)
{
struct logger_list *logger_list;
logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
logger_list = android_logger_list_alloc(O_RDONLY, 0, 0);
if (logger_list == nullptr) {
DLT_LOG(dlt_ctx_self, DLT_LOG_FATAL, DLT_STRING("could not allocate logger list"));
return nullptr;
Expand Down

0 comments on commit 4149df6

Please sign in to comment.