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

Commit cf6b8428 authored by Elliott Hughes's avatar Elliott Hughes Committed by android-build-merger
Browse files

Merge "adb: static constexpr."

am: 28c95396

Change-Id: I1d61a869d88ceb2a1836977897c1a27f658a45d7
parents a612e303 28c95396
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@


#if defined(_WIN32)
constexpr char kNullFileName[] = "NUL";
static constexpr char kNullFileName[] = "NUL";
#else
constexpr char kNullFileName[] = "/dev/null";
static constexpr char kNullFileName[] = "/dev/null";
#endif

void close_stdin() {
+3 −4
Original line number Diff line number Diff line
@@ -354,8 +354,7 @@ static void stdinout_raw_epilogue(int inFd, int outFd, int old_stdin_mode, int o
}

void copy_to_file(int inFd, int outFd) {
    constexpr size_t BUFSIZE = 32 * 1024;
    std::vector<char> buf(BUFSIZE);
    std::vector<char> buf(32 * 1024);
    int len;
    long total = 0;
    int old_stdin_mode = -1;
@@ -367,9 +366,9 @@ void copy_to_file(int inFd, int outFd) {

    while (true) {
        if (inFd == STDIN_FILENO) {
            len = unix_read(inFd, buf.data(), BUFSIZE);
            len = unix_read(inFd, buf.data(), buf.size());
        } else {
            len = adb_read(inFd, buf.data(), BUFSIZE);
            len = adb_read(inFd, buf.data(), buf.size());
        }
        if (len == 0) {
            D("copy_to_file() : read 0 bytes; exiting");
+2 −2
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@
#include "fastdeploycallbacks.h"
#include "utils/String16.h"

const long kRequiredAgentVersion = 0x00000001;
static constexpr long kRequiredAgentVersion = 0x00000001;

const char* kDeviceAgentPath = "/data/local/tmp/";
static constexpr const char* kDeviceAgentPath = "/data/local/tmp/";

long get_agent_version() {
    std::vector<char> versionOutputBuffer;
+2 −8
Original line number Diff line number Diff line
@@ -1040,12 +1040,6 @@ size_t atransport::get_max_payload() const {
    return max_payload;
}

namespace {

constexpr char kFeatureStringDelimiter = ',';

}  // namespace

const FeatureSet& supported_features() {
    // Local static allocation to avoid global non-POD variables.
    static const FeatureSet* features = new FeatureSet{
@@ -1059,7 +1053,7 @@ const FeatureSet& supported_features() {
}

std::string FeatureSetToString(const FeatureSet& features) {
    return android::base::Join(features, kFeatureStringDelimiter);
    return android::base::Join(features, ',');
}

FeatureSet StringToFeatureSet(const std::string& features_string) {
@@ -1067,7 +1061,7 @@ FeatureSet StringToFeatureSet(const std::string& features_string) {
        return FeatureSet();
    }

    auto names = android::base::Split(features_string, {kFeatureStringDelimiter});
    auto names = android::base::Split(features_string, ",");
    return FeatureSet(names.begin(), names.end());
}

+2 −2
Original line number Diff line number Diff line
@@ -187,8 +187,8 @@ static void PollAllLocalPortsForEmulator() {
}

// Retry the disconnected local port for 60 times, and sleep 1 second between two retries.
constexpr uint32_t LOCAL_PORT_RETRY_COUNT = 60;
constexpr auto LOCAL_PORT_RETRY_INTERVAL = 1s;
static constexpr uint32_t LOCAL_PORT_RETRY_COUNT = 60;
static constexpr auto LOCAL_PORT_RETRY_INTERVAL = 1s;

struct RetryPort {
    int port;