system/core: preparation to pull back interfaces from android/log.h

Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.

Correct liblog/README

Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.

Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
diff --git a/logd/LogAudit.cpp b/logd/LogAudit.cpp
index cc140b0..3811daa 100644
--- a/logd/LogAudit.cpp
+++ b/logd/LogAudit.cpp
@@ -25,7 +25,6 @@
 #include <sys/uio.h>
 #include <syslog.h>
 
-#include <log/logger.h>
 #include <private/android_filesystem_config.h>
 #include <private/android_logger.h>
 
diff --git a/logd/LogBufferElement.cpp b/logd/LogBufferElement.cpp
index e5de11d..a939002 100644
--- a/logd/LogBufferElement.cpp
+++ b/logd/LogBufferElement.cpp
@@ -22,7 +22,6 @@
 #include <time.h>
 #include <unistd.h>
 
-#include <log/logger.h>
 #include <private/android_logger.h>
 
 #include "LogBuffer.h"
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index 61b7fd8..4a30e6d 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -23,7 +23,6 @@
 #include <unistd.h>
 
 #include <cutils/sockets.h>
-#include <log/logger.h>
 #include <private/android_filesystem_config.h>
 #include <private/android_logger.h>
 
diff --git a/logd/LogUtils.h b/logd/LogUtils.h
index 881f097..d6b3dc6 100644
--- a/logd/LogUtils.h
+++ b/logd/LogUtils.h
@@ -20,8 +20,8 @@
 #include <sys/cdefs.h>
 #include <sys/types.h>
 
-#include <android/log.h>
 #include <sysutils/SocketClient.h>
+#include <log/log.h>
 
 // Hijack this header as a common include file used by most all sources
 // to report some utilities defined here and there.
diff --git a/logd/libaudit.c b/logd/libaudit.c
index 288a052..d2b212e 100644
--- a/logd/libaudit.c
+++ b/logd/libaudit.c
@@ -18,26 +18,20 @@
  *
  */
 
-#define LOG_TAG "libaudit"
-
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
 
-#include <android/log.h>
-
 #include "libaudit.h"
 
 /**
  * Waits for an ack from the kernel
  * @param fd
  *  The netlink socket fd
- * @param seq
- *  The current sequence number were acking on
  * @return
  *  This function returns 0 on success, else -errno.
  */
-static int get_ack(int fd, int16_t seq)
+static int get_ack(int fd)
 {
     int rc;
     struct audit_message rep;
@@ -60,11 +54,6 @@
         }
     }
 
-    if ((int16_t)rep.nlh.nlmsg_seq != seq) {
-        SLOGW("Expected sequence number between user space and kernel space is out of skew, "
-          "expected %u got %u", seq, rep.nlh.nlmsg_seq);
-    }
-
     return 0;
 }
 
@@ -109,7 +98,6 @@
 
     /* Ensure the message is not too big */
     if (NLMSG_SPACE(size) > MAX_AUDIT_MESSAGE_LENGTH) {
-        SLOGE("netlink message is too large");
         return -EINVAL;
     }
 
@@ -140,7 +128,6 @@
     /* Not all the bytes were sent */
     if (rc < 0) {
         rc = -errno;
-        SLOGE("Error sending data over the netlink socket: %s", strerror(-errno));
         goto out;
     } else if ((uint32_t) rc != req.nlh.nlmsg_len) {
         rc = -EPROTO;
@@ -148,7 +135,7 @@
     }
 
     /* We sent all the bytes, get the ack */
-    rc = get_ack(fd, sequence);
+    rc = get_ack(fd);
 
     /* If the ack failed, return the error, else return the sequence number */
     rc = (rc == 0) ? (int) sequence : rc;
@@ -156,7 +143,6 @@
 out:
     /* Don't let sequence roll to negative */
     if (sequence < 0) {
-        SLOGW("Auditd to Kernel sequence number has rolled over");
         sequence = 0;
     }
 
@@ -183,7 +169,6 @@
     /* Let the kernel know this pid will be registering for audit events */
     rc = audit_send(fd, AUDIT_SET, &status, sizeof(status));
     if (rc < 0) {
-        SLOGE("Could net set pid for audit events, error: %s", strerror(-rc));
         return rc;
     }
 
@@ -241,25 +226,21 @@
             /* If request is non blocking and errno is EAGAIN, just return 0 */
             return 0;
         }
-        SLOGE("Error receiving from netlink socket, error: %s", strerror(-rc));
         return rc;
     }
 
     if (nladdrlen != sizeof(nladdr)) {
-        SLOGE("Protocol fault, error: %s", strerror(EPROTO));
         return -EPROTO;
     }
 
     /* Make sure the netlink message was not spoof'd */
     if (nladdr.nl_pid) {
-        SLOGE("Invalid netlink pid received, expected 0 got: %d", nladdr.nl_pid);
         return -EINVAL;
     }
 
     /* Check if the reply from the kernel was ok */
     if (!NLMSG_OK(&rep->nlh, (size_t)len)) {
         rc = (len == sizeof(*rep)) ? -EFBIG : -EBADE;
-        SLOGE("Bad kernel response %s", strerror(-rc));
     }
 
     return rc;
@@ -267,9 +248,5 @@
 
 void audit_close(int fd)
 {
-    int rc = close(fd);
-    if (rc < 0) {
-        SLOGE("Attempting to close invalid fd %d, error: %s", fd, strerror(errno));
-    }
-    return;
+    close(fd);
 }