summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-01-17 15:23:34 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-02-28 16:58:24 +0100
commit2f902f7e9f71a500bcb6dd789670a4ad35d221f7 (patch)
treef6cae83b43ff722084d67e14ba81a9f6816640d0
parenta4559644d215bb6329aeed6df9fab968ecfa4d5b (diff)
downloadhardware_replicant_libsamsung-ril-2f902f7e9f71a500bcb6dd789670a4ad35d221f7.tar.gz
hardware_replicant_libsamsung-ril-2f902f7e9f71a500bcb6dd789670a4ad35d221f7.tar.bz2
hardware_replicant_libsamsung-ril-2f902f7e9f71a500bcb6dd789670a4ad35d221f7.zip
Fix logging on Android 11
Without that patch, on Replicant 11, with 'adb logcat -b radio', we do not see any of the log messages that libsamsung-ril is supposed to emmit. In addition, liblog[1]'s README.md has the following: `[ASR]LOG[VDIWE]` calls are used to log to BAsic, System or Radio sub-logs [...]. So we need to use RLOG anyway, at least with Replicant 11. To avoid breaking the compatibility with older versions, we fallback on ALOG when RLOG is not available. [1]liblog is available in system/core/liblog/ in the Android source code or in liblog/ in the following git repository: https://android.googlesource.com/platform/system/core Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--samsung-ril.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/samsung-ril.h b/samsung-ril.h
index 3d4d9fc..8cc012d 100644
--- a/samsung-ril.h
+++ b/samsung-ril.h
@@ -47,22 +47,34 @@
* Macros
*/
-#ifdef ALOGI
+#if defined(RLOGI)
+#define RIL_LOGI RLOGI
+#elif defined(ALOGI)
#define RIL_LOGI ALOGI
-#else
+#elif defined(LOGI)
#define RIL_LOGI LOGI
+#else
+#error "Cannot define RIL_LOGI"
#endif
-#ifdef ALOGD
+#if defined(RLOGD)
+#define RIL_LOGD RLOGD
+#elif defined(ALOGD)
#define RIL_LOGD ALOGD
-#else
+#elif defined(LOGD)
#define RIL_LOGD LOGD
+#else
+#error "Cannot define RIL_LOGD"
#endif
-#ifdef ALOGE
+#if defined(RLOGE)
+#define RIL_LOGE RLOGE
+#elif defined(ALOGE)
#define RIL_LOGE ALOGE
-#else
+#elif defined(LOGE)
#define RIL_LOGE LOGE
+#else
+#error "Cannot define RIL_LOGE"
#endif
#define RIL_LOCK() pthread_mutex_lock(&ril_data->mutex)