From 572bce29088521caf7f90c9fa66a8237a7674435 Mon Sep 17 00:00:00 2001 From: David Pursell Date: Fri, 15 Jan 2016 14:19:56 -0800 Subject: fastboot: use cutils socket functions. Now that cutils has cross-platform socket functionality, we can restructure fastboot to remove platform-dependent networking code. This CL adds socket_set_receive_timeout() to libcutils and combines the fastboot socket code into a single implementation. It also adds TCP functionality to fastboot sockets, but nothing uses it yet except for the unit tests. A future CL will add the TCP protocol which will use this TCP socket implementation. Bug: http://b/26558551 Change-Id: If613fb348f9332b31fa2c88d67fb1e839923768a --- fastboot/Android.mk | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'fastboot/Android.mk') diff --git a/fastboot/Android.mk b/fastboot/Android.mk index bb28afab5..fcec5b104 100644 --- a/fastboot/Android.mk +++ b/fastboot/Android.mk @@ -24,7 +24,15 @@ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/../../extras/ext4_utils \ $(LOCAL_PATH)/../../extras/f2fs_utils \ -LOCAL_SRC_FILES := protocol.cpp engine.cpp bootimg_utils.cpp fastboot.cpp util.cpp fs.cpp +LOCAL_SRC_FILES := \ + bootimg_utils.cpp \ + engine.cpp \ + fastboot.cpp \ + fs.cpp\ + protocol.cpp \ + socket.cpp \ + util.cpp \ + LOCAL_MODULE := fastboot LOCAL_MODULE_TAGS := debug LOCAL_MODULE_HOST_OS := darwin linux windows @@ -33,15 +41,15 @@ LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code LOCAL_CFLAGS += -DFASTBOOT_REVISION='"$(fastboot_version)"' -LOCAL_SRC_FILES_linux := socket_unix.cpp usb_linux.cpp util_linux.cpp +LOCAL_SRC_FILES_linux := usb_linux.cpp util_linux.cpp LOCAL_STATIC_LIBRARIES_linux := libselinux -LOCAL_SRC_FILES_darwin := socket_unix.cpp usb_osx.cpp util_osx.cpp +LOCAL_SRC_FILES_darwin := usb_osx.cpp util_osx.cpp LOCAL_STATIC_LIBRARIES_darwin := libselinux LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon LOCAL_CFLAGS_darwin := -Wno-unused-parameter -LOCAL_SRC_FILES_windows := socket_windows.cpp usb_windows.cpp util_windows.cpp +LOCAL_SRC_FILES_windows := usb_windows.cpp util_windows.cpp LOCAL_STATIC_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinApi LOCAL_LDLIBS_windows := -lws2_32 @@ -98,18 +106,14 @@ include $(CLEAR_VARS) LOCAL_MODULE := fastboot_test LOCAL_MODULE_HOST_OS := darwin linux windows -LOCAL_SRC_FILES := socket_test.cpp +LOCAL_SRC_FILES := socket.cpp socket_test.cpp LOCAL_STATIC_LIBRARIES := libbase libcutils LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code -LOCAL_SRC_FILES_linux := socket_unix.cpp - -LOCAL_SRC_FILES_darwin := socket_unix.cpp LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon LOCAL_CFLAGS_darwin := -Wno-unused-parameter -LOCAL_SRC_FILES_windows := socket_windows.cpp LOCAL_LDLIBS_windows := -lws2_32 include $(BUILD_HOST_NATIVE_TEST) -- cgit v1.2.3