diff --git a/adb/adb.cpp b/adb/adb.cpp index ffa93f4ee..ca12eb7b6 100644 --- a/adb/adb.cpp +++ b/adb/adb.cpp @@ -14,7 +14,10 @@ * limitations under the License. */ -#define TRACE_TAG TRACE_ADB +#define TRACE_TAG TRACE_ADB + +#include "sysdeps.h" +#include "adb.h" #include #include @@ -27,8 +30,6 @@ #include #include -#include "sysdeps.h" -#include "adb.h" #include "adb_auth.h" #include "adb_io.h" #include "adb_listeners.h" diff --git a/adb/adb_auth.cpp b/adb/adb_auth.cpp index c236b647b..dc0182519 100644 --- a/adb/adb_auth.cpp +++ b/adb/adb_auth.cpp @@ -14,7 +14,10 @@ * limitations under the License. */ -#define TRACE_TAG TRACE_ADB +#define TRACE_TAG TRACE_ADB + +#include "sysdeps.h" +#include "adb_auth.h" #include #include @@ -23,9 +26,7 @@ #include #include "adb.h" -#include "adb_auth.h" #include "transport.h" -#include "sysdeps.h" int auth_enabled = 0; diff --git a/adb/adb_auth.h b/adb/adb_auth.h index e0425ad62..635556e34 100644 --- a/adb/adb_auth.h +++ b/adb/adb_auth.h @@ -17,6 +17,8 @@ #ifndef __ADB_AUTH_H #define __ADB_AUTH_H +#include "adb.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/adb/adb_auth_client.cpp b/adb/adb_auth_client.cpp index 5dadcd974..8e7d38be1 100644 --- a/adb/adb_auth_client.cpp +++ b/adb/adb_auth_client.cpp @@ -14,24 +14,24 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_AUTH + +#include "sysdeps.h" +#include "adb_auth.h" + #include #include #include -#include "sysdeps.h" - -#include "adb.h" -#include "adb_auth.h" #include "cutils/list.h" #include "cutils/sockets.h" -#include "fdevent.h" #include "mincrypt/rsa.h" #include "mincrypt/sha.h" + +#include "adb.h" +#include "fdevent.h" #include "transport.h" -#define TRACE_TAG TRACE_AUTH - - struct adb_public_key { struct listnode node; RSAPublicKey key; diff --git a/adb/adb_auth_host.cpp b/adb/adb_auth_host.cpp index aba23d42a..7c2bcfb18 100644 --- a/adb/adb_auth_host.cpp +++ b/adb/adb_auth_host.cpp @@ -14,8 +14,14 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_AUTH + +#include "sysdeps.h" +#include "adb_auth.h" + #include #include +#include #ifdef _WIN32 # ifndef WIN32_LEAN_AND_MEAN @@ -28,11 +34,8 @@ # include # include #endif -#include -#include "sysdeps.h" #include "adb.h" -#include "adb_auth.h" /* HACK: we need the RSAPublicKey struct * but RSA_verify conflits with openssl */ @@ -52,12 +55,9 @@ #include #endif -#define TRACE_TAG TRACE_AUTH - #define ANDROID_PATH ".android" #define ADB_KEY_FILE "adbkey" - struct adb_private_key { struct listnode node; RSA *rsa; diff --git a/adb/adb_client.cpp b/adb/adb_client.cpp index a485aa2eb..4751bff83 100644 --- a/adb/adb_client.cpp +++ b/adb/adb_client.cpp @@ -14,6 +14,11 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_ADB + +#include "sysdeps.h" +#include "adb_client.h" + #include #include #include @@ -23,10 +28,6 @@ #include #include -#include "sysdeps.h" - -#define TRACE_TAG TRACE_ADB -#include "adb_client.h" #include "adb_io.h" static transport_type __adb_transport = kTransportAny; diff --git a/adb/adb_io.cpp b/adb/adb_io.cpp index 4dd9f4d02..3370a0c4f 100644 --- a/adb/adb_io.cpp +++ b/adb/adb_io.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#define TRACE_TAG TRACE_RWX +#define TRACE_TAG TRACE_RWX #include "sysdeps.h" #include "adb_io.h" diff --git a/adb/adb_main.cpp b/adb/adb_main.cpp index 1d9cc3baf..daec831c0 100644 --- a/adb/adb_main.cpp +++ b/adb/adb_main.cpp @@ -14,15 +14,15 @@ * limitations under the License. */ -#define TRACE_TAG TRACE_ADB +#define TRACE_TAG TRACE_ADB + +#include "sysdeps.h" #include #include #include #include -#include "sysdeps.h" - #include "adb.h" #include "adb_auth.h" #include "adb_listeners.h" diff --git a/adb/commandline.cpp b/adb/commandline.cpp index 4538b048b..c9b1eabc7 100644 --- a/adb/commandline.cpp +++ b/adb/commandline.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_ADB + +#include "sysdeps.h" + #include #include #include @@ -31,9 +35,6 @@ #include #endif -#include "sysdeps.h" - -#define TRACE_TAG TRACE_ADB #include "adb.h" #include "adb_auth.h" #include "adb_client.h" diff --git a/adb/fdevent.cpp b/adb/fdevent.cpp index eeb2a9c65..0c43c5e9c 100644 --- a/adb/fdevent.cpp +++ b/adb/fdevent.cpp @@ -15,25 +15,23 @@ ** limitations under the License. */ -#include +#define TRACE_TAG TRACE_FDEVENT + +#include "sysdeps.h" +#include "fdevent.h" -#include -#include -#include -#include #include - #include - #include #include +#include +#include +#include +#include +#include #include "adb_io.h" #include "adb_trace.h" -#include "fdevent.h" -#include "sysdeps.h" - -#define TRACE_TAG TRACE_FDEVENT /* !!! Do not enable DEBUG for the adb that will run as the server: ** both stdout and stderr are used to communicate between the client diff --git a/adb/file_sync_service.cpp b/adb/file_sync_service.cpp index ac01678a8..e8e9a0f4d 100644 --- a/adb/file_sync_service.cpp +++ b/adb/file_sync_service.cpp @@ -14,6 +14,11 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_SYNC + +#include "sysdeps.h" +#include "file_sync_service.h" + #include #include #include @@ -25,12 +30,8 @@ #include #include -#include "sysdeps.h" - -#define TRACE_TAG TRACE_SYNC #include "adb.h" #include "adb_io.h" -#include "file_sync_service.h" #include "private/android_filesystem_config.h" static bool should_use_fs_config(const char* path) { diff --git a/adb/jdwp_service.cpp b/adb/jdwp_service.cpp index f0b4ba72e..9cf084e0f 100644 --- a/adb/jdwp_service.cpp +++ b/adb/jdwp_service.cpp @@ -1,12 +1,32 @@ +/* + * Copyright (C) 2015 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. + */ + /* implement the "debug-ports" and "track-debug-ports" device services */ + +#define TRACE_TAG TRACE_JDWP + #include "sysdeps.h" -#define TRACE_TAG TRACE_JDWP -#include "adb.h" + #include #include #include #include +#include "adb.h" + /* here's how these things work. when adbd starts, it creates a unix server socket diff --git a/adb/remount_service.cpp b/adb/remount_service.cpp index a83d5b134..483ca3d3d 100644 --- a/adb/remount_service.cpp +++ b/adb/remount_service.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_ADB + +#include "sysdeps.h" + #include #include #include @@ -25,9 +29,6 @@ #include -#include "sysdeps.h" - -#define TRACE_TAG TRACE_ADB #include "adb.h" #include "adb_io.h" #include "cutils/properties.h" diff --git a/adb/services.cpp b/adb/services.cpp index e7bf6b029..abf8ea572 100644 --- a/adb/services.cpp +++ b/adb/services.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_SERVICES + +#include "sysdeps.h" + #include #include #include @@ -32,9 +36,6 @@ #include "cutils/properties.h" #endif -#include "sysdeps.h" - -#define TRACE_TAG TRACE_SERVICES #include "adb.h" #include "adb_io.h" #include "file_sync_service.h" diff --git a/adb/set_verity_enable_state_service.cpp b/adb/set_verity_enable_state_service.cpp index 139b07410..b75ed4cdf 100644 --- a/adb/set_verity_enable_state_service.cpp +++ b/adb/set_verity_enable_state_service.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_ADB + +#include "sysdeps.h" + #include #include #include @@ -21,13 +25,12 @@ #include #include -#define TRACE_TAG TRACE_ADB -#include "adb.h" #include "cutils/properties.h" + +#include "adb.h" #include "ext4_sb.h" #include "fs_mgr.h" #include "remount_service.h" -#include "sysdeps.h" #define FSTAB_PREFIX "/fstab." struct fstab *fstab; diff --git a/adb/sockets.cpp b/adb/sockets.cpp index 12bc8d8ac..48d02d6c2 100644 --- a/adb/sockets.cpp +++ b/adb/sockets.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_SOCKETS + +#include "sysdeps.h" + #include #include #include @@ -21,14 +25,12 @@ #include #include -#include "sysdeps.h" - -#define TRACE_TAG TRACE_SOCKETS -#include "adb.h" -#include "adb_io.h" #if !ADB_HOST #include "cutils/properties.h" #endif + +#include "adb.h" +#include "adb_io.h" #include "transport.h" ADB_MUTEX_DEFINE( socket_list_lock ); diff --git a/adb/sysdeps_win32.c b/adb/sysdeps_win32.c index f132b8c6a..c28e031c2 100644 --- a/adb/sysdeps_win32.c +++ b/adb/sysdeps_win32.c @@ -1,10 +1,30 @@ +/* + * Copyright (C) 2015 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 TRACE_TAG TRACE_SYSDEPS + #include "sysdeps.h" -#include + +#include /* winsock.h *must* be included before windows.h. */ #include + +#include #include #include -#include -#define TRACE_TAG TRACE_SYSDEPS + #include "adb.h" extern void fatal(const char *fmt, ...); diff --git a/adb/transport.cpp b/adb/transport.cpp index 1f8ac03ef..0a960ff44 100644 --- a/adb/transport.cpp +++ b/adb/transport.cpp @@ -14,8 +14,9 @@ * limitations under the License. */ -#include "sysdeps.h" +#define TRACE_TAG TRACE_TRANSPORT +#include "sysdeps.h" #include "transport.h" #include @@ -25,7 +26,6 @@ #include #include -#define TRACE_TAG TRACE_TRANSPORT #include "adb.h" static void transport_unref(atransport *t); diff --git a/adb/transport_local.cpp b/adb/transport_local.cpp index 440d4c50d..fe3c87f3f 100644 --- a/adb/transport_local.cpp +++ b/adb/transport_local.cpp @@ -14,21 +14,23 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_TRANSPORT + +#include "sysdeps.h" +#include "transport.h" + #include #include #include #include #include -#include "sysdeps.h" - -#define TRACE_TAG TRACE_TRANSPORT -#include "adb.h" -#include "adb_io.h" #if !ADB_HOST #include "cutils/properties.h" #endif -#include "transport.h" + +#include "adb.h" +#include "adb_io.h" #if ADB_HOST /* we keep a list of opened transports. The atransport struct knows to which diff --git a/adb/transport_usb.cpp b/adb/transport_usb.cpp index 37a8219b5..cdabffe1e 100644 --- a/adb/transport_usb.cpp +++ b/adb/transport_usb.cpp @@ -14,15 +14,16 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_TRANSPORT + +#include "sysdeps.h" +#include "transport.h" + #include #include #include -#include - -#define TRACE_TAG TRACE_TRANSPORT #include "adb.h" -#include "transport.h" static int remote_read(apacket *p, atransport *t) { diff --git a/adb/usb_linux.cpp b/adb/usb_linux.cpp index c01ec8c01..6fd2b40bb 100644 --- a/adb/usb_linux.cpp +++ b/adb/usb_linux.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_USB + +#include "sysdeps.h" + #include #include #include @@ -33,9 +37,6 @@ #include #endif -#include "sysdeps.h" - -#define TRACE_TAG TRACE_USB #include "adb.h" #include "transport.h" diff --git a/adb/usb_linux_client.c b/adb/usb_linux_client.c index c88b25876..434451c44 100644 --- a/adb/usb_linux_client.c +++ b/adb/usb_linux_client.c @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_USB + +#include "sysdeps.h" + #include #include #include @@ -25,9 +29,6 @@ #include #include -#include "sysdeps.h" - -#define TRACE_TAG TRACE_USB #include "adb.h" #include "transport.h" diff --git a/adb/usb_osx.c b/adb/usb_osx.c index aa7e1ea0a..94c8cfe7e 100644 --- a/adb/usb_osx.c +++ b/adb/usb_osx.c @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_USB + +#include "sysdeps.h" + #include #include @@ -24,9 +28,6 @@ #include -#include "sysdeps.h" - -#define TRACE_TAG TRACE_USB #include "adb.h" #include "transport.h" diff --git a/adb/usb_windows.cpp b/adb/usb_windows.cpp index 3c5533b4f..d2bd58cdf 100644 --- a/adb/usb_windows.cpp +++ b/adb/usb_windows.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +#define TRACE_TAG TRACE_USB + +#include "sysdeps.h" + #include // winsock.h *must* be included before windows.h. #include #include @@ -23,9 +27,6 @@ #include #include -#include "sysdeps.h" - -#define TRACE_TAG TRACE_USB #include "adb.h" #include "transport.h"