Feat: TV remote control via D-pad focus navigation using AccessibilityService
This commit is contained in:
17
common/logger.cpp
Normal file
17
common/logger.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "logger.h"
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
static void (*androidLog)(const char*) = nullptr;
|
||||
|
||||
void UseAndroidLog(void (*cb)(const char*)) {
|
||||
androidLog = cb;
|
||||
}
|
||||
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
void android_log(const char* fmt, ...) {
|
||||
char buf[256];
|
||||
va_list ap; va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap);
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "YAMA_NET", "%s", buf);
|
||||
if (androidLog) androidLog(buf);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user