system/core Replace cutils/log.h with android/log.h

Should use android/log.h instead of cutils/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
diff --git a/libsysutils/src/FrameworkClient.cpp b/libsysutils/src/FrameworkClient.cpp
index 2f37055..72b3d0a 100644
--- a/libsysutils/src/FrameworkClient.cpp
+++ b/libsysutils/src/FrameworkClient.cpp
@@ -1,11 +1,27 @@
-#include <alloca.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <pthread.h>
+/*
+ * Copyright (C) 2009-2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #define LOG_TAG "FrameworkClient"
-#include <cutils/log.h>
 
+#include <alloca.h>
+#include <errno.h>
+#include <pthread.h>
+#include <sys/types.h>
+
+#include <android/log.h>
 #include <sysutils/FrameworkClient.h>
 
 FrameworkClient::FrameworkClient(int socket) {
diff --git a/libsysutils/src/FrameworkCommand.cpp b/libsysutils/src/FrameworkCommand.cpp
index 0b95a81..dccacda 100644
--- a/libsysutils/src/FrameworkCommand.cpp
+++ b/libsysutils/src/FrameworkCommand.cpp
@@ -13,12 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <errno.h>
 
 #define LOG_TAG "FrameworkCommand"
 
-#include <cutils/log.h>
+#include <errno.h>
 
+#include <android/log.h>
 #include <sysutils/FrameworkCommand.h>
 
 #define UNUSED __attribute__((unused))
diff --git a/libsysutils/src/FrameworkListener.cpp b/libsysutils/src/FrameworkListener.cpp
index e7b3dd6..b96174a 100644
--- a/libsysutils/src/FrameworkListener.cpp
+++ b/libsysutils/src/FrameworkListener.cpp
@@ -13,16 +13,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
 
 #define LOG_TAG "FrameworkListener"
 
-#include <cutils/log.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
 
-#include <sysutils/FrameworkListener.h>
+#include <android/log.h>
 #include <sysutils/FrameworkCommand.h>
+#include <sysutils/FrameworkListener.h>
 #include <sysutils/SocketClient.h>
 
 static const int CMD_BUF_SIZE = 1024;
diff --git a/libsysutils/src/NetlinkEvent.cpp b/libsysutils/src/NetlinkEvent.cpp
index 739fad7..b787692 100644
--- a/libsysutils/src/NetlinkEvent.cpp
+++ b/libsysutils/src/NetlinkEvent.cpp
@@ -13,39 +13,36 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <stdlib.h>
-#include <string.h>
 
 #define LOG_TAG "NetlinkEvent"
-#include <cutils/log.h>
 
-#include <sysutils/NetlinkEvent.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/icmp6.h>
 #include <arpa/inet.h>
-#include <net/if.h>
-
 #include <linux/if.h>
 #include <linux/if_addr.h>
 #include <linux/if_link.h>
 #include <linux/netfilter/nfnetlink.h>
 #include <linux/netfilter/nfnetlink_log.h>
 #include <linux/netfilter_ipv4/ipt_ULOG.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <netinet/icmp6.h>
+#include <netlink/attr.h>
+#include <netlink/genl/genl.h>
+#include <netlink/handlers.h>
+#include <netlink/msg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/types.h>
 
 /* From kernel's net/netfilter/xt_quota2.c */
 const int LOCAL_QLOG_NL_EVENT = 112;
 const int LOCAL_NFLOG_PACKET = NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET;
 
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-
-#include <netlink/attr.h>
-#include <netlink/genl/genl.h>
-#include <netlink/handlers.h>
-#include <netlink/msg.h>
+#include <android/log.h>
+#include <sysutils/NetlinkEvent.h>
 
 NetlinkEvent::NetlinkEvent() {
     mAction = Action::kUnknown;
diff --git a/libsysutils/src/NetlinkListener.cpp b/libsysutils/src/NetlinkListener.cpp
index 637aa1e..1c4c7df 100644
--- a/libsysutils/src/NetlinkListener.cpp
+++ b/libsysutils/src/NetlinkListener.cpp
@@ -13,17 +13,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <string.h>
 
 #define LOG_TAG "NetlinkListener"
-#include <cutils/log.h>
-#include <cutils/uevent.h>
 
+#include <errno.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+
+#include <linux/netlink.h> /* out of order because must follow sys/socket.h */
+
+#include <android/log.h>
+#include <cutils/uevent.h>
 #include <sysutils/NetlinkEvent.h>
 
 #if 1
diff --git a/libsysutils/src/ServiceManager.cpp b/libsysutils/src/ServiceManager.cpp
index 41ac1dd..1abe988 100644
--- a/libsysutils/src/ServiceManager.cpp
+++ b/libsysutils/src/ServiceManager.cpp
@@ -1,11 +1,27 @@
+/*
+ * Copyright (C) 2009-2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Service"
+
 #include <errno.h>
 #include <string.h>
 
-#include <sysutils/ServiceManager.h>
-
-#define LOG_TAG "Service"
-#include <cutils/log.h>
+#include <android/log.h>
 #include <cutils/properties.h>
+#include <sysutils/ServiceManager.h>
 
 ServiceManager::ServiceManager() {
 }
diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp
index bb9b6a1..02505d3 100644
--- a/libsysutils/src/SocketClient.cpp
+++ b/libsysutils/src/SocketClient.cpp
@@ -1,16 +1,32 @@
+/*
+ * Copyright (C) 2009-2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "SocketClient"
+
 #include <alloca.h>
+#include <arpa/inet.h>
 #include <errno.h>
 #include <malloc.h>
 #include <pthread.h>
 #include <signal.h>
 #include <string.h>
-#include <arpa/inet.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 
-#define LOG_TAG "SocketClient"
-#include <cutils/log.h>
-
+#include <android/log.h>
 #include <sysutils/SocketClient.h>
 
 SocketClient::SocketClient(int socket, bool owned) {
diff --git a/libsysutils/src/SocketListener.cpp b/libsysutils/src/SocketListener.cpp
index 608abae..6a676a9 100644
--- a/libsysutils/src/SocketListener.cpp
+++ b/libsysutils/src/SocketListener.cpp
@@ -13,19 +13,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <stdio.h>
+
+#define LOG_TAG "SocketListener"
+
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
-#include <sys/socket.h>
 #include <sys/select.h>
+#include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/un.h>
 
-#define LOG_TAG "SocketListener"
-#include <cutils/log.h>
+#include <android/log.h>
 #include <cutils/sockets.h>
-
 #include <sysutils/SocketListener.h>
 #include <sysutils/SocketClient.h>