Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58d80650 authored by Josh Gao's avatar Josh Gao Committed by Android (Google) Code Review
Browse files

Merge changes from topic "adbd_cp" into rvc-dev

* changes:
  Properly remove adb DNS services.
  adbd: fix build breakage.
  adbd: remove static dependency on libcutils.
  incremental_server: fix a use of uninitalized memory
parents c3605ef9 e36a53e3
Loading
Loading
Loading
Loading
+19 −69
Original line number Original line Diff line number Diff line
@@ -114,66 +114,6 @@ cc_defaults {
    },
    },
}
}


// libadbconnection
// =========================================================
// libadbconnection_client/server implement the socket handling for jdwp
// forwarding and the track-jdwp service.
cc_library {
    name: "libadbconnection_server",
    srcs: ["adbconnection/adbconnection_server.cpp"],

    export_include_dirs: ["adbconnection/include"],

    stl: "libc++_static",
    shared_libs: ["liblog"],
    static_libs: ["libbase"],

    defaults: ["adbd_defaults", "host_adbd_supported"],

    // Avoid getting duplicate symbol of android::build::getbuildnumber().
    use_version_lib: false,

    recovery_available: true,
    compile_multilib: "both",
}

cc_library {
    name: "libadbconnection_client",
    srcs: ["adbconnection/adbconnection_client.cpp"],

    export_include_dirs: ["adbconnection/include"],

    stl: "libc++_static",
    shared_libs: ["liblog"],
    static_libs: ["libbase"],

    defaults: ["adbd_defaults"],
    visibility: [
        "//art:__subpackages__",
        "//system/core/adb/apex:__subpackages__",
    ],
    apex_available: [
        "com.android.adbd",
        "test_com.android.adbd",
    ],

    // libadbconnection_client doesn't need an embedded build number.
    use_version_lib: false,

    target: {
        linux: {
            version_script: "adbconnection/libadbconnection_client.map.txt",
        },
    },
    stubs: {
        symbol_file: "adbconnection/libadbconnection_client.map.txt",
        versions: ["1"],
    },

    host_supported: true,
    compile_multilib: "both",
}

// libadb
// libadb
// =========================================================
// =========================================================
// These files are compiled for both the host and the device.
// These files are compiled for both the host and the device.
@@ -459,7 +399,6 @@ cc_library_static {
        "libbase",
        "libbase",
        "libcrypto",
        "libcrypto",
        "libcrypto_utils",
        "libcrypto_utils",
        "libcutils",
        "liblog",
        "liblog",
    ],
    ],


@@ -483,7 +422,7 @@ cc_library_static {
    },
    },
}
}


cc_library {
cc_library_static {
    name: "libadbd_services",
    name: "libadbd_services",
    defaults: ["adbd_defaults", "host_adbd_supported"],
    defaults: ["adbd_defaults", "host_adbd_supported"],
    recovery_available: true,
    recovery_available: true,
@@ -513,11 +452,11 @@ cc_library {
        "libadb_protos",
        "libadb_protos",
        "libadb_tls_connection",
        "libadb_tls_connection",
        "libadbd_auth",
        "libadbd_auth",
        "libadbd_fs",
        "libasyncio",
        "libasyncio",
        "libbase",
        "libbase",
        "libcrypto",
        "libcrypto",
        "libcrypto_utils",
        "libcrypto_utils",
        "libcutils",
        "liblog",
        "liblog",
    ],
    ],


@@ -564,13 +503,20 @@ cc_library {
        "libadb_pairing_connection",
        "libadb_pairing_connection",
        "libadb_tls_connection",
        "libadb_tls_connection",
        "libadbd_auth",
        "libadbd_auth",
        "libadbd_services",
        "libadbd_fs",
        "libasyncio",
        "libasyncio",
        "libbase",
        "libbase",
        "libcrypto",
        "libcrypto",
        "libcrypto_utils",
        "libcrypto_utils",
        "libcutils",
        "liblog",
        "liblog",
        "libselinux",
    ],

    static_libs: [
        "libadbd_services",
        "libcutils_sockets",
        "libdiagnose_usb",
        "libmdnssd",
    ],
    ],


    export_include_dirs: [
    export_include_dirs: [
@@ -605,7 +551,7 @@ cc_binary {
        "libbase",
        "libbase",
        "libcap",
        "libcap",
        "libcrypto_utils",
        "libcrypto_utils",
        "libcutils",
        "libcutils_sockets",
        "libdiagnose_usb",
        "libdiagnose_usb",
        "liblog",
        "liblog",
        "libmdnssd",
        "libmdnssd",
@@ -620,10 +566,14 @@ cc_binary {
        "libadb_protos",
        "libadb_protos",
        "libadb_tls_connection",
        "libadb_tls_connection",
        "libadbd_auth",
        "libadbd_auth",
        "libadbd_fs",
        "libcrypto",
        "libcrypto",
    ],
    ],


    required: ["libadbd_auth"],
    required: [
        "libadbd_auth",
        "libadbd_fs",
    ],
}
}


phony {
phony {
@@ -699,9 +649,9 @@ cc_test {
        "libadb_pairing_connection_static",
        "libadb_pairing_connection_static",
        "libadb_tls_connection_static",
        "libadb_tls_connection_static",
        "libbase",
        "libbase",
        "libcutils",
        "libcrypto_utils",
        "libcrypto_utils",
        "libcrypto_static",
        "libcrypto_static",
        "libcutils_sockets",
        "libdiagnose_usb",
        "libdiagnose_usb",
        "liblog",
        "liblog",
        "libusb",
        "libusb",
+0 −7
Original line number Original line Diff line number Diff line
@@ -59,11 +59,4 @@ extern int adb_trace_mask;
void adb_trace_init(char**);
void adb_trace_init(char**);
void adb_trace_enable(AdbTrace trace_tag);
void adb_trace_enable(AdbTrace trace_tag);


// Include <atomic> before stdatomic.h (introduced in cutils/trace.h) to avoid compile error.
#include <atomic>

#define ATRACE_TAG ATRACE_TAG_ADB
#include <cutils/trace.h>
#include <utils/Trace.h>

#endif /* __ADB_TRACE_H */
#endif /* __ADB_TRACE_H */
+1 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
#include "adb_install.h"
#include "adb_install.h"


#include <fcntl.h>
#include <fcntl.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
+2 −1
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@


#include <android-base/endian.h>
#include <android-base/endian.h>
#include <android-base/strings.h>
#include <android-base/strings.h>
#include <inttypes.h>
#include <lz4.h>
#include <lz4.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
@@ -258,7 +259,7 @@ bool IncrementalServer::SkipToRequest(void* buffer, size_t* size, bool blocking)


        if (r == -1) {
        if (r == -1) {
            fprintf(stderr, "Failed to read from fd %d: %d. Exit\n", adb_fd_.get(), errno);
            fprintf(stderr, "Failed to read from fd %d: %d. Exit\n", adb_fd_.get(), errno);
            return true;
            return false;
        }
        }


        // socket is closed
        // socket is closed
+3 −3
Original line number Original line Diff line number Diff line
@@ -409,9 +409,9 @@ static void adb_RemoveDNSService(const char* regType, const char* serviceName) {
    }
    }


    std::string sName(serviceName);
    std::string sName(serviceName);
    std::remove_if(services->begin(), services->end(), [&sName](ResolvedService* service) {
    services->erase(std::remove_if(
        return (sName == service->serviceName());
            services->begin(), services->end(),
    });
            [&sName](ResolvedService* service) { return (sName == service->serviceName()); }));
}
}


// Returns the version the device wanted to advertise,
// Returns the version the device wanted to advertise,
Loading