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

Commit b6019211 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

libbinder: use libbase HexString am: f39d2ae4 am: afaa7e26

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15455966

Change-Id: I37ae9d81a5e3e47f5a75894f7cd7d9e82f963701
parents c0464ae5 afaa7e26
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -144,9 +144,6 @@ cc_library {
            enabled: false,
        },
        host: {
            static_libs: [
                "libbase",
            ],
            srcs: [
                "ServiceManagerHost.cpp",
                "UtilsHost.cpp",
@@ -187,6 +184,10 @@ cc_library {
        "libutils",
    ],

    static_libs: [
        "libbase",
    ],

    header_libs: [
        "libbinder_headers",
        "libandroid_runtime_vm_headers",
+0 −16
Original line number Diff line number Diff line
@@ -26,22 +26,6 @@

namespace android {

std::string hexString(const void* bytes, size_t len) {
    if (bytes == nullptr) return "<null>";

    const uint8_t* bytes8 = static_cast<const uint8_t*>(bytes);
    const char chars[] = "0123456789abcdef";
    std::string result;
    result.resize(len * 2);

    for (size_t i = 0; i < len; i++) {
        result[2 * i] = chars[bytes8[i] >> 4];
        result[2 * i + 1] = chars[bytes8[i] & 0xf];
    }

    return result;
}

// ---------------------------------------------------------------------

static const char indentStr[] =
+0 −2
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@
namespace android {
// ---------------------------------------------------------------------------

std::string hexString(const void* data, size_t size);

const char* stringForIndent(int32_t indentLevel);

typedef void (*debugPrintFunc)(void* cookie, const char* txt);
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include <binder/RpcAddress.h>

#include <android-base/hex.h>
#include <binder/Parcel.h>

#include "Debug.h"
@@ -94,7 +95,7 @@ bool RpcAddress::operator<(const RpcAddress& rhs) const {
}

std::string RpcAddress::toString() const {
    return hexString(mRawAddr.get(), sizeof(RpcWireAddress));
    return base::HexString(mRawAddr.get(), sizeof(RpcWireAddress));
}

status_t RpcAddress::writeToParcel(Parcel* parcel) const {
+3 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include "RpcState.h"

#include <android-base/hex.h>
#include <android-base/scopeguard.h>
#include <binder/BpBinder.h>
#include <binder/IPCThreadState.h>
@@ -273,7 +274,7 @@ status_t RpcState::rpcSend(const sp<RpcSession::RpcConnection>& connection,
                           const sp<RpcSession>& session, const char* what, const void* data,
                           size_t size) {
    LOG_RPC_DETAIL("Sending %s on fd %d: %s", what, connection->fd.get(),
                   hexString(data, size).c_str());
                   android::base::HexString(data, size).c_str());

    if (size > std::numeric_limits<ssize_t>::max()) {
        ALOGE("Cannot send %s at size %zu (too big)", what, size);
@@ -311,7 +312,7 @@ status_t RpcState::rpcRec(const sp<RpcSession::RpcConnection>& connection,
    }

    LOG_RPC_DETAIL("Received %s on fd %d: %s", what, connection->fd.get(),
                   hexString(data, size).c_str());
                   android::base::HexString(data, size).c_str());
    return OK;
}

Loading