pmt: Improvements for developers
- Android.bp was written to be included in ROMs/recoveries etc. in Android build system. - Macros have been added to simplify feature creation. - Some bug fixes (for JSON and pmt).
This commit is contained in:
@@ -243,6 +243,14 @@ std::string getLibVersion();
|
||||
#define LOGNF_IF(name, file, level, condition) \
|
||||
if (condition) Helper::Logger(level, __func__, file, name, __FILE__, __LINE__)
|
||||
|
||||
#ifdef ANDROID_BUILD
|
||||
#define MKVERSION(name) \
|
||||
char vinfo[512]; \
|
||||
sprintf(vinfo, \
|
||||
"%s 1.2.0 [XXXX-XX-XX XX.XX.XX]\nBuildType: Release\nCompiler: clang\n" \
|
||||
"BuildFlags: -Wall;-Werror;-Wno-deprecated-declarations;-Os", name); \
|
||||
return std::string(vinfo)
|
||||
#else
|
||||
#define MKVERSION(name) \
|
||||
char vinfo[512]; \
|
||||
sprintf(vinfo, \
|
||||
@@ -251,5 +259,6 @@ std::string getLibVersion();
|
||||
name, BUILD_VERSION, BUILD_DATE, BUILD_TIME, BUILD_TYPE, \
|
||||
BUILD_CMAKE_VERSION, BUILD_COMPILER_VERSION, BUILD_FLAGS); \
|
||||
return std::string(vinfo)
|
||||
#endif
|
||||
|
||||
#endif // #ifndef LIBHELPER_LIB_HPP
|
||||
|
||||
@@ -58,10 +58,18 @@ Logger::~Logger() {
|
||||
fd != -1)
|
||||
close(fd);
|
||||
else {
|
||||
#ifdef ANDROID_BUILD
|
||||
LoggingProperties::setLogFile("/tmp/last_pmt_logs.log")
|
||||
#else
|
||||
LoggingProperties::setLogFile("last_logs.log");
|
||||
#endif
|
||||
LOGN(HELPER, INFO) << "Cannot create log file: " << _logFile << ": "
|
||||
<< strerror(errno)
|
||||
#ifdef ANDROID_BUILD
|
||||
<< " New logging file: /tmp/last_pmt_logs.log (this file)."
|
||||
#else
|
||||
<< " New logging file: last_logs.log (this file)."
|
||||
#endif
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,12 @@
|
||||
#include <ctime>
|
||||
#include <cutils/android_reboot.h>
|
||||
#include <fcntl.h>
|
||||
#ifndef ANDROID_BUILD
|
||||
#include <generated/buildInfo.hpp>
|
||||
#include <sys/_system_properties.h>
|
||||
#else
|
||||
#include <sys/system_properties.h>
|
||||
#endif
|
||||
#include <iostream>
|
||||
#include <libgen.h>
|
||||
#include <libhelper/lib.hpp>
|
||||
|
||||
Reference in New Issue
Block a user