From de3ad1d718a142d5715fe0d749c4d079a80da161 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 3 Apr 2015 13:24:37 -0700 Subject: [PATCH] Remove an ancient spam-busting hack from logd. We have real spam detection and suppression now anyway. Bug: 20143912 Test: build Change-Id: I7bd4bb189373569fd1e5a7b3f2b90ce816abe864 --- liblog/logger_write.cpp | 50 +---------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/liblog/logger_write.cpp b/liblog/logger_write.cpp index 7fa3f436b..a4b3cd7b2 100644 --- a/liblog/logger_write.cpp +++ b/liblog/logger_write.cpp @@ -407,63 +407,15 @@ int __android_log_write(int prio, const char* tag, const char* msg) { } int __android_log_buf_write(int bufID, int prio, const char* tag, const char* msg) { - struct iovec vec[3]; - char tmp_tag[32]; - if (!tag) tag = ""; - /* XXX: This needs to go! */ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wstring-plus-int" - if (bufID != LOG_ID_RADIO) { - switch (tag[0]) { - case 'H': - if (strcmp(tag + 1, "HTC_RIL" + 1)) break; - goto inform; - case 'R': - /* Any log tag with "RIL" as the prefix */ - if (strncmp(tag + 1, "RIL" + 1, strlen("RIL") - 1)) break; - goto inform; - case 'Q': - /* Any log tag with "QC_RIL" as the prefix */ - if (strncmp(tag + 1, "QC_RIL" + 1, strlen("QC_RIL") - 1)) break; - goto inform; - case 'I': - /* Any log tag with "IMS" as the prefix */ - if (strncmp(tag + 1, "IMS" + 1, strlen("IMS") - 1)) break; - goto inform; - case 'A': - if (strcmp(tag + 1, "AT" + 1)) break; - goto inform; - case 'G': - if (strcmp(tag + 1, "GSM" + 1)) break; - goto inform; - case 'S': - if (strcmp(tag + 1, "STK" + 1) && strcmp(tag + 1, "SMS" + 1)) break; - goto inform; - case 'C': - if (strcmp(tag + 1, "CDMA" + 1)) break; - goto inform; - case 'P': - if (strcmp(tag + 1, "PHONE" + 1)) break; - /* FALLTHRU */ - inform: - bufID = LOG_ID_RADIO; - snprintf(tmp_tag, sizeof(tmp_tag), "use-Rlog/RLOG-%s", tag); - tag = tmp_tag; - [[fallthrough]]; - default: - break; - } - } -#pragma clang diagnostic pop - #if __BIONIC__ if (prio == ANDROID_LOG_FATAL) { android_set_abort_message(msg); } #endif + struct iovec vec[3]; vec[0].iov_base = (unsigned char*)&prio; vec[0].iov_len = 1; vec[1].iov_base = (void*)tag;