Do the big AVD -> CVD rename
Bug: 68662276
Change-Id: Ie5946e979b414c2ae315f0cd0edd13c6a21791dc
diff --git a/common/libs/fs/shared_fd.cpp b/common/libs/fs/shared_fd.cpp
index ba6cca3..6546d0a 100644
--- a/common/libs/fs/shared_fd.cpp
+++ b/common/libs/fs/shared_fd.cpp
@@ -30,7 +30,7 @@
// #define ENABLE_GCE_SHARED_FD_LOGGING 1
namespace {
-using avd::SharedFDSet;
+using cvd::SharedFDSet;
void MarkAll(const SharedFDSet& input, fd_set* dest, int* max_index) {
for (SharedFDSet::const_iterator it = input.begin(); it != input.end();
@@ -53,7 +53,7 @@
}
} // namespace
-namespace avd {
+namespace cvd {
bool FileInstance::CopyFrom(FileInstance& in) {
AutoFreeBuffer buffer;
@@ -361,4 +361,4 @@
return rval;
}
-} // namespace avd
+} // namespace cvd
diff --git a/common/libs/fs/shared_fd.h b/common/libs/fs/shared_fd.h
index c13c82b..fadf0ab 100644
--- a/common/libs/fs/shared_fd.h
+++ b/common/libs/fs/shared_fd.h
@@ -60,7 +60,7 @@
* it makes it easier to convert existing code to SharedFDs and avoids the
* possibility that new POSIX functionality will lead to large refactorings.
*/
-namespace avd {
+namespace cvd {
class FileInstance;
@@ -168,9 +168,9 @@
std::shared_ptr<FileInstance> operator->() const { return value_; }
- const avd::FileInstance& operator*() const { return *value_; }
+ const cvd::FileInstance& operator*() const { return *value_; }
- avd::FileInstance& operator*() { return *value_; }
+ cvd::FileInstance& operator*() { return *value_; }
private:
std::shared_ptr<FileInstance> value_;
@@ -230,7 +230,7 @@
return rval;
}
- int EpollCtl(int op, avd::SharedFD new_fd, struct epoll_event* event) {
+ int EpollCtl(int op, cvd::SharedFD new_fd, struct epoll_event* event) {
errno = 0;
int rval = TEMP_FAILURE_RETRY(
epoll_ctl(fd_, op, new_fd->fd_, event));
@@ -514,6 +514,6 @@
SharedFD::SharedFD() : value_(FileInstance::ClosedInstance()) {}
-} // namespace avd
+} // namespace cvd
#endif // CUTTLEFISH_COMMON_COMMON_LIBS_FS_SHARED_FD_H_
diff --git a/common/libs/fs/shared_fd_test.cpp b/common/libs/fs/shared_fd_test.cpp
index a3f7b8f..3423619 100644
--- a/common/libs/fs/shared_fd_test.cpp
+++ b/common/libs/fs/shared_fd_test.cpp
@@ -23,8 +23,8 @@
#include <string>
-using avd::InbandMessageHeader;
-using avd::SharedFD;
+using cvd::InbandMessageHeader;
+using cvd::SharedFD;
char hello[] = "Hello, world!";
char pipe_message[] = "Testing the pipe";
diff --git a/common/libs/fs/shared_select.h b/common/libs/fs/shared_select.h
index 1298d74..20bfb5a 100644
--- a/common/libs/fs/shared_select.h
+++ b/common/libs/fs/shared_select.h
@@ -20,7 +20,7 @@
#include "common/libs/fs/shared_fd.h"
-namespace avd {
+namespace cvd {
/**
* The SharedFD version of fdset for the Select call.
*
@@ -76,6 +76,6 @@
int Select(SharedFDSet* read_set, SharedFDSet* write_set,
SharedFDSet* error_set, struct timeval* timeout);
-} // namespace avd
+} // namespace cvd
#endif // CUTTLEFISH_COMMON_COMMON_LIBS_FS_SHARED_SELECT_H_
diff --git a/common/libs/net/netlink_client.cpp b/common/libs/net/netlink_client.cpp
index 0a09d86..884daca 100644
--- a/common/libs/net/netlink_client.cpp
+++ b/common/libs/net/netlink_client.cpp
@@ -24,7 +24,7 @@
#include "common/libs/fs/shared_fd.h"
#include "common/libs/glog/logging.h"
-namespace avd {
+namespace cvd {
namespace {
// NetlinkClient implementation.
// Talks to libnetlink to apply network changes.
@@ -163,4 +163,4 @@
return &factory;
}
-} // namespace avd
+} // namespace cvd
diff --git a/common/libs/net/netlink_client.h b/common/libs/net/netlink_client.h
index 7e2f385..c8805c5 100644
--- a/common/libs/net/netlink_client.h
+++ b/common/libs/net/netlink_client.h
@@ -21,7 +21,7 @@
#include <string>
#include "common/libs/net/netlink_request.h"
-namespace avd {
+namespace cvd {
// Abstraction of Netlink client class.
class NetlinkClient {
@@ -50,6 +50,6 @@
virtual ~NetlinkClientFactory() = default;
};
-} // namespace avd
+} // namespace cvd
#endif // COMMON_LIBS_NET_NETLINK_CLIENT_H_
diff --git a/common/libs/net/netlink_request.cpp b/common/libs/net/netlink_request.cpp
index 1c257ea..ff5b9e9 100644
--- a/common/libs/net/netlink_request.cpp
+++ b/common/libs/net/netlink_request.cpp
@@ -25,7 +25,7 @@
#include "common/libs/glog/logging.h"
-namespace avd {
+namespace cvd {
namespace {
uint32_t kRequestSequenceNumber = 0;
} // namespace
@@ -134,4 +134,4 @@
return request_.size();
}
-} // namespace avd
+} // namespace cvd
diff --git a/common/libs/net/netlink_request.h b/common/libs/net/netlink_request.h
index 0421795..953ea00 100644
--- a/common/libs/net/netlink_request.h
+++ b/common/libs/net/netlink_request.h
@@ -25,7 +25,7 @@
#include "common/libs/auto_resources/auto_resources.h"
-namespace avd {
+namespace cvd {
// Abstraction of Network link request.
// Used to supply kernel with information about which interface needs to be
// changed, and how.
@@ -107,5 +107,5 @@
NetlinkRequest(const NetlinkRequest&) = delete;
NetlinkRequest& operator= (const NetlinkRequest&) = delete;
};
-} // namespace avd
+} // namespace cvd
#endif // COMMON_LIBS_NET_NETLINK_REQUEST_H_
diff --git a/common/libs/net/netlink_request_test.cpp b/common/libs/net/netlink_request_test.cpp
index c39c624..67b9923 100644
--- a/common/libs/net/netlink_request_test.cpp
+++ b/common/libs/net/netlink_request_test.cpp
@@ -28,7 +28,7 @@
using ::testing::MatchResultListener;
using ::testing::Return;
-namespace avd {
+namespace cvd {
namespace {
extern "C" void klog_write(int /* level */, const char* /* format */, ...) {}
@@ -138,7 +138,7 @@
memcpy(&expected.text, kLongString, sizeof(kLongString));
- avd::NetlinkRequest request(RTM_SETLINK, 0);
+ cvd::NetlinkRequest request(RTM_SETLINK, 0);
request.AddString(kDummyTag, kLongString);
EXPECT_THAT(request, RequestDataIs(&expected, sizeof(expected)));
}
@@ -154,7 +154,7 @@
const uint32_t attr_value = kValue;
} expected;
- avd::NetlinkRequest request(RTM_SETLINK, 0);
+ cvd::NetlinkRequest request(RTM_SETLINK, 0);
request.AddInt32(kDummyTag, kValue);
EXPECT_THAT(request, RequestDataIs(&expected, sizeof(expected)));
}
@@ -173,7 +173,7 @@
const uint32_t attr_value = kValue;
} expected;
- avd::NetlinkRequest request(RTM_SETLINK, 0);
+ cvd::NetlinkRequest request(RTM_SETLINK, 0);
request.PushList(kListTag);
request.AddInt32(kDummyTag, kValue);
request.PopList();
@@ -198,7 +198,7 @@
const uint32_t attr_value = kValue;
} expected;
- avd::NetlinkRequest request(RTM_SETLINK, 0);
+ cvd::NetlinkRequest request(RTM_SETLINK, 0);
request.PushList(kList1Tag);
request.PushList(kList2Tag);
request.AddInt32(kDummyTag, kValue);
@@ -230,7 +230,7 @@
const uint32_t attr2_value = kValue2;
} expected;
- avd::NetlinkRequest request(RTM_SETLINK, 0);
+ cvd::NetlinkRequest request(RTM_SETLINK, 0);
request.PushList(kList1Tag);
request.AddInt32(kDummy1Tag, kValue1);
request.PopList();
@@ -263,7 +263,7 @@
const uint32_t attr2_value = kValue2;
} expected;
- avd::NetlinkRequest request(RTM_SETLINK, 0);
+ cvd::NetlinkRequest request(RTM_SETLINK, 0);
request.PushList(kList1Tag);
request.PushList(kList2Tag);
request.AddInt32(kDummy1Tag, kValue1);
@@ -275,7 +275,7 @@
}
TEST_F(NetlinkClientTest, SimpleNetlinkCreateHeader) {
- avd::NetlinkRequest request(RTM_NEWLINK, NLM_F_CREATE | NLM_F_EXCL);
+ cvd::NetlinkRequest request(RTM_NEWLINK, NLM_F_CREATE | NLM_F_EXCL);
constexpr char kValue[] = "random string";
request.AddString(0, kValue); // Have something to work with.
@@ -289,7 +289,7 @@
NLM_F_ACK | NLM_F_CREATE | NLM_F_EXCL | NLM_F_REQUEST,
base_seq));
- avd::NetlinkRequest request2(RTM_NEWLINK, NLM_F_CREATE | NLM_F_EXCL);
+ cvd::NetlinkRequest request2(RTM_NEWLINK, NLM_F_CREATE | NLM_F_EXCL);
request2.AddString(0, kValue); // Have something to work with.
EXPECT_THAT(request2, RequestHeaderIs(
kMsgLength,
@@ -299,7 +299,7 @@
}
TEST_F(NetlinkClientTest, SimpleNetlinkUpdateHeader) {
- avd::NetlinkRequest request(RTM_SETLINK, 0);
+ cvd::NetlinkRequest request(RTM_SETLINK, 0);
constexpr char kValue[] = "random string";
request.AddString(0, kValue); // Have something to work with.
@@ -310,10 +310,10 @@
EXPECT_THAT(request, RequestHeaderIs(
kMsgLength, RTM_SETLINK, NLM_F_REQUEST | NLM_F_ACK, base_seq));
- avd::NetlinkRequest request2(RTM_SETLINK, 0);
+ cvd::NetlinkRequest request2(RTM_SETLINK, 0);
request2.AddString(0, kValue); // Have something to work with.
EXPECT_THAT(request2, RequestHeaderIs(
kMsgLength, RTM_SETLINK, NLM_F_REQUEST | NLM_F_ACK, base_seq + 1));
}
-} // namespace avd
+} // namespace cvd
diff --git a/common/libs/net/network_interface.h b/common/libs/net/network_interface.h
index 3d4088e..4005f00 100644
--- a/common/libs/net/network_interface.h
+++ b/common/libs/net/network_interface.h
@@ -18,7 +18,7 @@
#include <string>
-namespace avd {
+namespace cvd {
// Abstraction of network interfaces.
// This interface provides means to modify network interface parameters.
@@ -99,6 +99,6 @@
NetworkInterface& operator= (const NetworkInterface&);
};
-} // namespace avd
+} // namespace cvd
#endif // GUEST_GCE_NETWORK_NETWORK_INTERFACE_H_
diff --git a/common/libs/net/network_interface_manager.cpp b/common/libs/net/network_interface_manager.cpp
index 3d4de82e..2e4d43f 100644
--- a/common/libs/net/network_interface_manager.cpp
+++ b/common/libs/net/network_interface_manager.cpp
@@ -27,7 +27,7 @@
#include "common/libs/glog/logging.h"
#include "common/libs/net/network_interface.h"
-namespace avd {
+namespace cvd {
namespace {
NetlinkRequest BuildLinkRequest(
const NetworkInterface& interface) {
@@ -96,5 +96,5 @@
return nl_client_->Send(BuildAddrRequest(iface));
}
-} // namespace avd
+} // namespace cvd
diff --git a/common/libs/net/network_interface_manager.h b/common/libs/net/network_interface_manager.h
index 3df21a5..3d6ccc5 100644
--- a/common/libs/net/network_interface_manager.h
+++ b/common/libs/net/network_interface_manager.h
@@ -22,7 +22,7 @@
#include "common/libs/net/netlink_client.h"
#include "common/libs/net/network_interface.h"
-namespace avd {
+namespace cvd {
// Network interface manager class.
// - Provides access for existing network interfaces,
@@ -66,6 +66,6 @@
NetworkInterfaceManager& operator= (const NetworkInterfaceManager&);
};
-} // namespace avd
+} // namespace cvd
#endif // COMMON_LIBS_NET_NETWORK_INTERFACE_MANAGER_H_
diff --git a/common/libs/thread_safe_queue/thread_safe_queue.h b/common/libs/thread_safe_queue/thread_safe_queue.h
index 6959d6a..8662928 100644
--- a/common/libs/thread_safe_queue/thread_safe_queue.h
+++ b/common/libs/thread_safe_queue/thread_safe_queue.h
@@ -22,7 +22,7 @@
#include <utility>
#include <iterator>
-namespace avd {
+namespace cvd {
// Simple queue with Push and Pop capabilities.
// If the max_elements argument is passed to the constructor, and Push is called
// when the queue holds max_elements items, the max_elements_handler is called
@@ -77,4 +77,4 @@
std::condition_variable new_item_;
QueueImpl items_;
};
-} // namespace avd
+} // namespace cvd
diff --git a/common/libs/threads/cuttlefish_thread.h b/common/libs/threads/cuttlefish_thread.h
index 8748955..c16d970 100644
--- a/common/libs/threads/cuttlefish_thread.h
+++ b/common/libs/threads/cuttlefish_thread.h
@@ -31,7 +31,7 @@
#include <pthread.h>
#include "common/libs/time/monotonic_time.h"
-namespace avd {
+namespace cvd {
class Mutex {
friend class ConditionVariable;
@@ -94,7 +94,7 @@
return pthread_cond_wait(&cond_, mutex_->GetMutex());
}
- int WaitUntil(const avd::time::MonotonicTimePoint& tp) {
+ int WaitUntil(const cvd::time::MonotonicTimePoint& tp) {
struct timespec ts;
tp.ToTimespec(&ts);
return pthread_cond_timedwait(&cond_, mutex_->GetMutex(), &ts);
@@ -166,4 +166,4 @@
ScopedThread& operator= (const ScopedThread&);
};
-} // namespace avd
+} // namespace cvd
diff --git a/common/libs/threads/cuttlefish_thread_test.cpp b/common/libs/threads/cuttlefish_thread_test.cpp
index 9ea1a5d..513262e 100644
--- a/common/libs/threads/cuttlefish_thread_test.cpp
+++ b/common/libs/threads/cuttlefish_thread_test.cpp
@@ -19,11 +19,11 @@
#include "common/libs/threads/thunkers.h"
#include "common/libs/time/monotonic_time.h"
-using avd::ConditionVariable;
-using avd::Mutex;
-using avd::ScopedThread;
-using avd::time::MonotonicTimePoint;
-using avd::time::Milliseconds;
+using cvd::ConditionVariable;
+using cvd::Mutex;
+using cvd::ScopedThread;
+using cvd::time::MonotonicTimePoint;
+using cvd::time::Milliseconds;
static const int FINISHED = 100;
diff --git a/common/libs/time/monotonic_time.cpp b/common/libs/time/monotonic_time.cpp
index b12a82f..1d7bbd8 100644
--- a/common/libs/time/monotonic_time.cpp
+++ b/common/libs/time/monotonic_time.cpp
@@ -15,7 +15,7 @@
*/
#include "common/libs/time/monotonic_time.h"
-namespace avd {
+namespace cvd {
namespace time {
MonotonicTimePointFactory* MonotonicTimePointFactory::GetInstance() {
static MonotonicTimePointFactory factory;
@@ -23,4 +23,4 @@
return &factory;
}
} // namespace time
-} // namespace avd
+} // namespace cvd
diff --git a/common/libs/time/monotonic_time.h b/common/libs/time/monotonic_time.h
index 4a81e66..1d61ab4 100644
--- a/common/libs/time/monotonic_time.h
+++ b/common/libs/time/monotonic_time.h
@@ -18,7 +18,7 @@
#include <stdint.h>
#include <time.h>
-namespace avd {
+namespace cvd {
namespace time {
static const int64_t kNanosecondsPerSecond = 1000000000;
@@ -279,7 +279,7 @@
};
} // namespace time
-} // namespace avd
+} // namespace cvd
/**
* Legacy support for microseconds. Use MonotonicTimePoint in new code.
@@ -287,6 +287,6 @@
static const int64_t kSecsToUsecs = static_cast<int64_t>(1000) * 1000;
static inline int64_t get_monotonic_usecs() {
- return avd::time::Microseconds(
- avd::time::MonotonicTimePoint::Now().SinceEpoch()).count();
+ return cvd::time::Microseconds(
+ cvd::time::MonotonicTimePoint::Now().SinceEpoch()).count();
}
diff --git a/common/libs/time/monotonic_time_test.cpp b/common/libs/time/monotonic_time_test.cpp
index a99be4b..b1c07c9 100644
--- a/common/libs/time/monotonic_time_test.cpp
+++ b/common/libs/time/monotonic_time_test.cpp
@@ -18,7 +18,7 @@
#include <gtest/gtest.h>
#include <algorithm>
-using avd::time::TimeDifference;
+using cvd::time::TimeDifference;
class MonotonicTimeTest : public ::testing::Test {
public:
diff --git a/guest/commands/audio/audio_hal.cpp b/guest/commands/audio/audio_hal.cpp
index fe65e16..1b05d40 100644
--- a/guest/commands/audio/audio_hal.cpp
+++ b/guest/commands/audio/audio_hal.cpp
@@ -19,7 +19,7 @@
#include "guest/libs/platform_support/api_level_fixes.h"
static hw_module_methods_t hal_module_methods = {
- VSOC_STATIC_INITIALIZER(open) avd::GceAudio::Open,
+ VSOC_STATIC_INITIALIZER(open) cvd::GceAudio::Open,
};
diff --git a/guest/commands/audio/policy/vsoc_audio_policy_hal.cpp b/guest/commands/audio/policy/vsoc_audio_policy_hal.cpp
index dbfb7b6..047e27d 100644
--- a/guest/commands/audio/policy/vsoc_audio_policy_hal.cpp
+++ b/guest/commands/audio/policy/vsoc_audio_policy_hal.cpp
@@ -25,7 +25,7 @@
#include "guest/commands/audio/policy/vsoc_audio_policy_hal.h"
-namespace avd {
+namespace cvd {
int GceAudioPolicy::Create(
const audio_policy_device* device,
@@ -139,7 +139,7 @@
}
static hw_module_methods_t gce_audio_policy_module_methods = {
- .open = &avd::GceAudioPolicy::Open,
+ .open = &cvd::GceAudioPolicy::Open,
};
diff --git a/guest/commands/audio/policy/vsoc_audio_policy_hal.h b/guest/commands/audio/policy/vsoc_audio_policy_hal.h
index 46a38f1..365d1c4 100644
--- a/guest/commands/audio/policy/vsoc_audio_policy_hal.h
+++ b/guest/commands/audio/policy/vsoc_audio_policy_hal.h
@@ -31,7 +31,7 @@
# define D(...) ((void)0)
#endif
-namespace avd {
+namespace cvd {
struct gce_audio_policy {
audio_policy policy;
diff --git a/guest/commands/audio/simulated_buffer.h b/guest/commands/audio/simulated_buffer.h
index 107abae..5ea31c2 100644
--- a/guest/commands/audio/simulated_buffer.h
+++ b/guest/commands/audio/simulated_buffer.h
@@ -50,8 +50,8 @@
SimulatedBufferBase(
int32_t items_per_second,
int64_t simulated_item_capacity,
- avd::time::MonotonicTimePointFactory* clock =
- avd::time::MonotonicTimePointFactory::GetInstance()) :
+ cvd::time::MonotonicTimePointFactory* clock =
+ cvd::time::MonotonicTimePointFactory::GetInstance()) :
clock_(clock),
current_item_num_(0),
base_item_num_(0),
@@ -67,7 +67,7 @@
return current_item_num_;
}
- const avd::time::MonotonicTimePoint GetLastUpdatedTime() const {
+ const cvd::time::MonotonicTimePoint GetLastUpdatedTime() const {
return current_time_;
}
@@ -75,7 +75,7 @@
// different sleep calls.
// Sleep is best-effort. The code assumes that the acutal sleep time may be
// greater or less than the time requested.
- virtual void SleepUntilTime(const avd::time::MonotonicTimePoint& in) {
+ virtual void SleepUntilTime(const cvd::time::MonotonicTimePoint& in) {
struct timespec ts;
in.ToTimespec(&ts);
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL);
@@ -96,7 +96,7 @@
if (initialize_) {
Init();
}
- avd::time::MonotonicTimePoint now;
+ cvd::time::MonotonicTimePoint now;
clock_->FetchCurrentTime(&now);
// We can't call FetchCurrentTime() in the constuctor because a subclass may
// want to override it, so we initialze the times to 0. If we detect this
@@ -113,13 +113,13 @@
// is immune to overflow.
// However, this does assume that kNanosecondsPerSecond * items_per_second_
// fits in an int64.
- avd::time::Seconds seconds(now - base_time_);
+ cvd::time::Seconds seconds(now - base_time_);
base_time_ += seconds;
base_item_num_ += seconds.count() * items_per_second_;
current_time_ = now;
current_item_num_ =
- avd::time::Nanoseconds(now - base_time_).count() *
- items_per_second_ / avd::time::kNanosecondsPerSecond +
+ cvd::time::Nanoseconds(now - base_time_).count() *
+ items_per_second_ / cvd::time::kNanosecondsPerSecond +
base_item_num_;
}
@@ -133,13 +133,13 @@
// Calculate the TimePoint that corresponds to an item.
// Caution: This may not return a correct time for items in the past.
- avd::time::MonotonicTimePoint CalculateItemTime(int64_t item) {
+ cvd::time::MonotonicTimePoint CalculateItemTime(int64_t item) {
int64_t seconds = (item - base_item_num_) / items_per_second_;
int64_t new_base_item_num = base_item_num_ + seconds * items_per_second_;
- return base_time_ + avd::time::Seconds(seconds) +
- avd::time::Nanoseconds(divide_and_round_up(
+ return base_time_ + cvd::time::Seconds(seconds) +
+ cvd::time::Nanoseconds(divide_and_round_up(
(item - new_base_item_num) *
- avd::time::kNanosecondsPerSecond,
+ cvd::time::kNanosecondsPerSecond,
items_per_second_));
}
@@ -149,7 +149,7 @@
if (paused_) {
SetPaused(false);
}
- avd::time::MonotonicTimePoint desired_time =
+ cvd::time::MonotonicTimePoint desired_time =
CalculateItemTime(item);
while (1) {
Update();
@@ -162,12 +162,12 @@
protected:
// Source of the timepoints.
- avd::time::MonotonicTimePointFactory* clock_;
+ cvd::time::MonotonicTimePointFactory* clock_;
// Time when the other values in the structure were updated.
- avd::time::MonotonicTimePoint current_time_;
+ cvd::time::MonotonicTimePoint current_time_;
// Most recent time when there was no round-off error between the clock and
// items.
- avd::time::MonotonicTimePoint base_time_;
+ cvd::time::MonotonicTimePoint base_time_;
// Number of the current item.
int64_t current_item_num_;
// Most recent item number where there was no round-off error between the
@@ -190,8 +190,8 @@
SimulatedOutputBuffer(
int64_t item_rate,
int64_t simulated_item_capacity,
- avd::time::MonotonicTimePointFactory* clock =
- avd::time::MonotonicTimePointFactory::GetInstance()) :
+ cvd::time::MonotonicTimePointFactory* clock =
+ cvd::time::MonotonicTimePointFactory::GetInstance()) :
SimulatedBufferBase(item_rate, simulated_item_capacity, clock) {
output_buffer_item_num_ = current_item_num_;
}
@@ -231,7 +231,7 @@
return output_buffer_item_num_;
}
- avd::time::MonotonicTimePoint GetNextOutputBufferItemTime() {
+ cvd::time::MonotonicTimePoint GetNextOutputBufferItemTime() {
Update();
return CalculateItemTime(output_buffer_item_num_);
}
@@ -257,8 +257,8 @@
SimulatedInputBuffer(
int64_t item_rate,
int64_t simulated_item_capacity,
- avd::time::MonotonicTimePointFactory* clock =
- avd::time::MonotonicTimePointFactory::GetInstance()) :
+ cvd::time::MonotonicTimePointFactory* clock =
+ cvd::time::MonotonicTimePointFactory::GetInstance()) :
SimulatedBufferBase(item_rate, simulated_item_capacity, clock) {
input_buffer_item_num_ = current_item_num_;
lost_input_items_ = 0;
diff --git a/guest/commands/audio/vsoc_audio.cpp b/guest/commands/audio/vsoc_audio.cpp
index d0e958a..68c896d 100644
--- a/guest/commands/audio/vsoc_audio.cpp
+++ b/guest/commands/audio/vsoc_audio.cpp
@@ -34,10 +34,10 @@
#include "guest/libs/platform_support/api_level_fixes.h"
#include "guest/libs/remoter/remoter_framework_pkt.h"
-using avd::LockGuard;
-using avd::Mutex;
+using cvd::LockGuard;
+using cvd::Mutex;
-namespace avd {
+namespace cvd {
namespace {
template <typename F> struct HWDeviceThunker :
@@ -64,8 +64,8 @@
}
}
// Make certain that the listener thread wakes up
- avd::SharedFD temp_client =
- avd::SharedFD::SocketSeqPacketClient(
+ cvd::SharedFD temp_client =
+ cvd::SharedFD::SocketSeqPacketClient(
gce_audio_message::kAudioHALSocketName);
uint64_t dummy_val = 1;
terminate_listener_thread_event_->Write(&dummy_val, sizeof dummy_val);
@@ -74,7 +74,7 @@
return 0;
}
-avd::SharedFD GceAudio::GetAudioFd() {
+cvd::SharedFD GceAudio::GetAudioFd() {
LockGuard<Mutex> guard(lock_);
return audio_data_socket_;
}
@@ -224,7 +224,7 @@
}
ssize_t GceAudio::SendMsg(const msghdr& msg, int flags) {
- avd::SharedFD fd = GetAudioFd();
+ cvd::SharedFD fd = GetAudioFd();
if (!fd->IsOpen()) {
return 0;
}
@@ -285,7 +285,7 @@
void* GceAudio::Listener() {
// TODO(ghartman): Consider tightening the mode on this later.
- audio_listener_socket_ = avd::SharedFD::SocketSeqPacketServer(
+ audio_listener_socket_ = cvd::SharedFD::SocketSeqPacketServer(
gce_audio_message::kAudioHALSocketName, 0777);
if (!audio_listener_socket_->IsOpen()) {
ALOGE("GceAudio::%s: Could not listen for audio connections. (%s).",
@@ -318,10 +318,10 @@
// Poll for new connections or the terminatation event.
// The listener is non-blocking. We send to at most one client. If a new
// client comes in disconnect the old one.
- avd::SharedFDSet fd_set;
+ cvd::SharedFDSet fd_set;
fd_set.Set(audio_listener_socket_);
fd_set.Set(terminate_listener_thread_event_);
- if (avd::Select(&fd_set, NULL, NULL, NULL) <= 0) {
+ if (cvd::Select(&fd_set, NULL, NULL, NULL) <= 0) {
// There's no timeout, so 0 shouldn't happen.
ALOGE("GceAudio::%s: Error using shared Select", __FUNCTION__);
break;
@@ -331,7 +331,7 @@
}
LOG_FATAL_IF(fd_set.IsSet(audio_listener_socket_),
"No error in Select() but nothing ready to read");
- avd::SharedFD fd = avd::SharedFD::Accept(
+ cvd::SharedFD fd = cvd::SharedFD::Accept(
*audio_listener_socket_);
if (!fd->IsOpen()) {
continue;
diff --git a/guest/commands/audio/vsoc_audio.h b/guest/commands/audio/vsoc_audio.h
index d487d50..7e23bf7 100644
--- a/guest/commands/audio/vsoc_audio.h
+++ b/guest/commands/audio/vsoc_audio.h
@@ -25,7 +25,7 @@
#include "guest/commands/audio/vsoc_audio_message.h"
#include "guest/libs/platform_support/api_level_fixes.h"
-namespace avd {
+namespace cvd {
class GceAudioInputStream;
class GceAudioOutputStream;
@@ -42,13 +42,13 @@
// Returns true if the microphone is muted. Used by input streams.
bool IsMicrophoneMuted() {
- avd::LockGuard<avd::Mutex> guard(lock_);
+ cvd::LockGuard<cvd::Mutex> guard(lock_);
return mic_muted_;
}
// Retrieves the SharedFD of the process accepting audio data.
// Returns a non-open fd if no process is listening (the normal case).
- avd::SharedFD GetAudioFd();
+ cvd::SharedFD GetAudioFd();
// Send a message to the connected streamer.
// Returns:
@@ -273,16 +273,16 @@
// Thread to handle new connections.
pthread_t listener_thread_;
// Event to indicate that the listener thread should terminate.
- avd::SharedFD terminate_listener_thread_event_;
+ cvd::SharedFD terminate_listener_thread_event_;
// The listener socket, which is polled for new connections.
// TODO(ghartman): Consider using a thread.
- avd::SharedFD audio_listener_socket_;
+ cvd::SharedFD audio_listener_socket_;
// Lock to protect the data below.
- mutable avd::Mutex lock_;
+ mutable cvd::Mutex lock_;
// The data socket for the current streamer. Typically -1.
// The behavior of the HAL should not be affected by the presence or absence
// of the streamer.
- avd::SharedFD audio_data_socket_;
+ cvd::SharedFD audio_data_socket_;
// State that is managed at the device level.
float voice_volume_;
float master_volume_;
@@ -307,7 +307,7 @@
GceAudio() :
audio_hw_device(),
- terminate_listener_thread_event_(avd::SharedFD::Event()),
+ terminate_listener_thread_event_(cvd::SharedFD::Event()),
voice_volume_(0.0),
master_volume_(0.0),
master_muted_(false),
diff --git a/guest/commands/audio/vsoc_audio_input_stream.cpp b/guest/commands/audio/vsoc_audio_input_stream.cpp
index 8b4e627..9802d2a 100644
--- a/guest/commands/audio/vsoc_audio_input_stream.cpp
+++ b/guest/commands/audio/vsoc_audio_input_stream.cpp
@@ -28,7 +28,7 @@
#include "guest/commands/audio/vsoc_audio_input_stream.h"
#include "guest/libs/platform_support/api_level_fixes.h"
-namespace avd {
+namespace cvd {
namespace {
template <typename F> struct Thunker :
@@ -54,7 +54,7 @@
#endif
GceAudioInputStream::GceAudioInputStream(
- avd::GceAudio* dev, audio_devices_t devices, const audio_config& config)
+ cvd::GceAudio* dev, audio_devices_t devices, const audio_config& config)
: audio_stream_in(),
dev_(dev),
config_(config),
diff --git a/guest/commands/audio/vsoc_audio_input_stream.h b/guest/commands/audio/vsoc_audio_input_stream.h
index ada9cc2..1f8cb4d 100644
--- a/guest/commands/audio/vsoc_audio_input_stream.h
+++ b/guest/commands/audio/vsoc_audio_input_stream.h
@@ -21,7 +21,7 @@
#include "guest/commands/audio/simulated_buffer.h"
#include "guest/commands/audio/vsoc_audio_message.h"
-namespace avd {
+namespace cvd {
namespace {
static const int IN_BUFFER_BYTES = 4096;
@@ -155,10 +155,10 @@
}
private:
- GceAudioInputStream(avd::GceAudio* dev, audio_devices_t devices,
+ GceAudioInputStream(cvd::GceAudio* dev, audio_devices_t devices,
const audio_config& config);
std::unique_ptr<SimulatedInputBuffer> buffer_model_;
- avd::GceAudio *dev_;
+ cvd::GceAudio *dev_;
audio_config config_;
float gain_;
audio_devices_t device_;
diff --git a/guest/commands/audio/vsoc_audio_output_stream.cpp b/guest/commands/audio/vsoc_audio_output_stream.cpp
index e2ede05..f32a676 100644
--- a/guest/commands/audio/vsoc_audio_output_stream.cpp
+++ b/guest/commands/audio/vsoc_audio_output_stream.cpp
@@ -49,7 +49,7 @@
}
#endif
-namespace avd {
+namespace cvd {
const size_t GceAudioOutputStream::kOutBufferSize;
const size_t GceAudioOutputStream::kOutLatency;
@@ -91,7 +91,7 @@
}
int GceAudioOutputStream::GetNextWriteTimestamp(int64_t* nstime) const {
- *nstime = avd::time::Nanoseconds(
+ *nstime = cvd::time::Nanoseconds(
buffer_->GetNextOutputBufferItemTime().SinceEpoch()).count();
return 0;
}
@@ -346,4 +346,4 @@
return 0;
}
-} // namespace avd
+} // namespace cvd
diff --git a/guest/commands/audio/vsoc_audio_output_stream.h b/guest/commands/audio/vsoc_audio_output_stream.h
index b02ba13..ecd609f 100644
--- a/guest/commands/audio/vsoc_audio_output_stream.h
+++ b/guest/commands/audio/vsoc_audio_output_stream.h
@@ -21,7 +21,7 @@
#include "guest/commands/audio/simulated_buffer.h"
#include "guest/commands/audio/vsoc_audio_message.h"
-namespace avd {
+namespace cvd {
// Defines static callback functions for the audio_stream and audio_stream_out
// interfaces in libhardware/include/hardware/audio.h
@@ -295,14 +295,14 @@
/*const*/ str_parms* query, str_parms* reply, const char* key, int value);
- explicit GceAudioOutputStream(avd::GceAudio*);
+ explicit GceAudioOutputStream(cvd::GceAudio*);
static const size_t kOutBufferSize = 3840;
static const size_t kOutLatency = 2;
gce_audio_message message_header_;
std::unique_ptr<SimulatedOutputBuffer> buffer_;
- avd::GceAudio *dev_;
+ cvd::GceAudio *dev_;
audio_devices_t device_;
size_t frame_size_;
size_t frame_count_;
diff --git a/guest/commands/usbforward/main.cpp b/guest/commands/usbforward/main.cpp
index 92b90ff..0ccf479 100644
--- a/guest/commands/usbforward/main.cpp
+++ b/guest/commands/usbforward/main.cpp
@@ -26,7 +26,7 @@
return 1;
}
- avd::SharedFD fd = avd::SharedFD::Open(argv[1], O_RDWR | O_NOCTTY);
+ cvd::SharedFD fd = cvd::SharedFD::Open(argv[1], O_RDWR | O_NOCTTY);
if (!fd->IsOpen()) {
ALOGE("Could not open %s: %s", argv[1], fd->StrError());
return 1;
diff --git a/guest/commands/usbforward/usb_server.cpp b/guest/commands/usbforward/usb_server.cpp
index 35fac9a..119c77e 100644
--- a/guest/commands/usbforward/usb_server.cpp
+++ b/guest/commands/usbforward/usb_server.cpp
@@ -112,10 +112,10 @@
return true;
}
-USBServer::USBServer(const avd::SharedFD& fd)
+USBServer::USBServer(const cvd::SharedFD& fd)
: fd_{fd},
- device_event_fd_{avd::SharedFD::Event(0, 0)},
- thread_event_fd_{avd::SharedFD::Event(0, 0)} {}
+ device_event_fd_{cvd::SharedFD::Event(0, 0)},
+ thread_event_fd_{cvd::SharedFD::Event(0, 0)} {}
void USBServer::HandleDeviceList(uint32_t tag) {
// Iterate all devices and send structure for every found device.
@@ -124,7 +124,7 @@
std::vector<InterfaceInfo> ifaces;
bool found = GetDeviceInfo(&info, &ifaces);
- avd::LockGuard<avd::Mutex> lock(write_mutex_);
+ cvd::LockGuard<cvd::Mutex> lock(write_mutex_);
ResponseHeader rsp{StatusSuccess, tag};
fd_->Write(&rsp, sizeof(rsp));
if (found) {
@@ -144,13 +144,13 @@
AttachRequest req;
if (fd_->Read(&req, sizeof(req)) != sizeof(req)) return;
- avd::LockGuard<avd::Mutex> lock(write_mutex_);
+ cvd::LockGuard<cvd::Mutex> lock(write_mutex_);
ResponseHeader rsp{handle_ ? StatusSuccess : StatusFailure, tag};
fd_->Write(&rsp, sizeof(rsp));
}
void USBServer::HandleHeartbeat(uint32_t tag) {
- avd::LockGuard<avd::Mutex> lock(write_mutex_);
+ cvd::LockGuard<cvd::Mutex> lock(write_mutex_);
ResponseHeader rsp{handle_ ? StatusSuccess : StatusFailure, tag};
fd_->Write(&rsp, sizeof(rsp));
}
@@ -192,7 +192,7 @@
// At this point we store transport request internally until it completes.
TransportRequest* treq_ptr = treq.get();
{
- avd::LockGuard<avd::Mutex> lock(requests_mutex_);
+ cvd::LockGuard<cvd::Mutex> lock(requests_mutex_);
requests_in_flight_[tag] = std::move(treq);
}
@@ -235,7 +235,7 @@
// At this point we store transport request internally until it completes.
TransportRequest* treq_ptr = treq.get();
{
- avd::LockGuard<avd::Mutex> lock(requests_mutex_);
+ cvd::LockGuard<cvd::Mutex> lock(requests_mutex_);
requests_in_flight_[tag] = std::move(treq);
}
@@ -249,7 +249,7 @@
int32_t actual_length) {
ResponseHeader rsp{is_success ? StatusSuccess : StatusFailure, tag};
- avd::LockGuard<avd::Mutex> lock(write_mutex_);
+ cvd::LockGuard<cvd::Mutex> lock(write_mutex_);
fd_->Write(&rsp, sizeof(rsp));
if (is_success && is_data_in) {
fd_->Write(&actual_length, sizeof(actual_length));
@@ -270,7 +270,7 @@
}
{
- avd::LockGuard<avd::Mutex> lock(requests_mutex_);
+ cvd::LockGuard<cvd::Mutex> lock(requests_mutex_);
requests_in_flight_.erase(tag);
}
}
@@ -287,13 +287,13 @@
USBServer* self = reinterpret_cast<USBServer*>(self_raw);
ALOGI("Starting hotplug thread.");
- avd::SharedFDSet rset;
+ cvd::SharedFDSet rset;
while (true) {
// Do not wait if there's no event.
timeval select_timeout{0, 0};
rset.Zero();
rset.Set(self->thread_event_fd_);
- int ret = avd::Select(&rset, nullptr, nullptr, &select_timeout);
+ int ret = cvd::Select(&rset, nullptr, nullptr, &select_timeout);
if (ret > 0) break;
timeval libusb_timeout{1, 0};
@@ -315,7 +315,7 @@
LIBUSB_HOTPLUG_MATCH_ANY, &USBServer::HandleDeviceEvent, this,
&hotplug_handle_);
handle_ = GetDevice();
- libusb_thread_.reset(new avd::ScopedThread(&ProcessLibUSBRequests, this));
+ libusb_thread_.reset(new cvd::ScopedThread(&ProcessLibUSBRequests, this));
}
void USBServer::ExitLibUSB() {
@@ -329,7 +329,7 @@
}
void USBServer::Serve() {
- avd::SharedFDSet rset;
+ cvd::SharedFDSet rset;
while (true) {
timeval retry_timeout{1, 0};
timeval* select_timeout = nullptr;
@@ -340,7 +340,7 @@
rset.Zero();
rset.Set(fd_);
rset.Set(device_event_fd_);
- int ret = avd::Select(&rset, nullptr, nullptr, select_timeout);
+ int ret = cvd::Select(&rset, nullptr, nullptr, select_timeout);
// device_event_fd_ is reset each time libusb notices device has re-appeared
// or is gone. In both cases, the existing handle is no longer valid.
diff --git a/guest/commands/usbforward/usb_server.h b/guest/commands/usbforward/usb_server.h
index 942e16e..77449b9 100644
--- a/guest/commands/usbforward/usb_server.h
+++ b/guest/commands/usbforward/usb_server.h
@@ -29,13 +29,13 @@
// USBServer exposes access to USB devices over pipe (virtio channel etc).
// Usage:
//
-// avd::SharedFD pipe = avd::SharedFD::Open(pipe_path, O_RDWR);
+// cvd::SharedFD pipe = cvd::SharedFD::Open(pipe_path, O_RDWR);
// USBServer server(pipe);
// CHECK(server.Init());
// server.Serve();
class USBServer final {
public:
- USBServer(const avd::SharedFD& fd);
+ USBServer(const cvd::SharedFD& fd);
~USBServer() = default;
// Serve incoming USB requests.
@@ -82,13 +82,13 @@
std::shared_ptr<libusb_device_handle> handle_;
libusb_hotplug_callback_handle hotplug_handle_;
- std::unique_ptr<avd::ScopedThread> libusb_thread_;
- avd::Mutex write_mutex_;
- avd::SharedFD fd_;
- avd::SharedFD device_event_fd_;
- avd::SharedFD thread_event_fd_;
+ std::unique_ptr<cvd::ScopedThread> libusb_thread_;
+ cvd::Mutex write_mutex_;
+ cvd::SharedFD fd_;
+ cvd::SharedFD device_event_fd_;
+ cvd::SharedFD thread_event_fd_;
- avd::Mutex requests_mutex_;
+ cvd::Mutex requests_mutex_;
std::map<uint32_t, std::unique_ptr<TransportRequest>> requests_in_flight_;
USBServer(const USBServer& other) = delete;
diff --git a/guest/hals/camera/CameraConfiguration.cpp b/guest/hals/camera/CameraConfiguration.cpp
index fb93485..8023045 100644
--- a/guest/hals/camera/CameraConfiguration.cpp
+++ b/guest/hals/camera/CameraConfiguration.cpp
@@ -24,7 +24,7 @@
#include <json/reader.h>
#include <stdlib.h>
-namespace avd {
+namespace cvd {
namespace {
////////////////////// Device Personality keys //////////////////////
//
@@ -300,6 +300,6 @@
return ConfigureCameras(root, &cameras_);
}
-} // namespace avd
+} // namespace cvd
diff --git a/guest/hals/camera/CameraConfiguration.h b/guest/hals/camera/CameraConfiguration.h
index 10f155e..90aa087 100644
--- a/guest/hals/camera/CameraConfiguration.h
+++ b/guest/hals/camera/CameraConfiguration.h
@@ -18,7 +18,7 @@
#include <vector>
-namespace avd {
+namespace cvd {
// Camera properties and features.
struct CameraDefinition {
@@ -60,6 +60,6 @@
std::vector<CameraDefinition> cameras_;
};
-} // namespace avd
+} // namespace cvd
#endif // GUEST_HALS_CAMERA_CAMERACONFIGURATION_H_
diff --git a/guest/hals/camera/EmulatedBaseCamera.cpp b/guest/hals/camera/EmulatedBaseCamera.cpp
index 2e08e50..2fbbc0b 100644
--- a/guest/hals/camera/EmulatedBaseCamera.cpp
+++ b/guest/hals/camera/EmulatedBaseCamera.cpp
@@ -70,7 +70,7 @@
// The CAMERA_MODULE_API_VERSION is above 2 on all of the supported
// branches.
//
- // The AVD supports both CAMERA_DEVICE_API_VERSION_1_0 and
+ // The CVD supports both CAMERA_DEVICE_API_VERSION_1_0 and
// CAMERA_DEVICE_API_VERSION_3_0.
//
// By the spec, the framework should not look at this field on
diff --git a/guest/hals/camera/EmulatedBaseCamera.h b/guest/hals/camera/EmulatedBaseCamera.h
index b57624b..ab64b45 100644
--- a/guest/hals/camera/EmulatedBaseCamera.h
+++ b/guest/hals/camera/EmulatedBaseCamera.h
@@ -53,7 +53,7 @@
* Return:
* NO_ERROR on success, or an appropriate error status on failure.
*/
- virtual status_t Initialize(const avd::CameraDefinition& params) = 0;
+ virtual status_t Initialize(const cvd::CameraDefinition& params) = 0;
/****************************************************************************
* Camera API implementation
diff --git a/guest/hals/camera/EmulatedCamera.cpp b/guest/hals/camera/EmulatedCamera.cpp
index 8ac6364..dd0a4cb 100755
--- a/guest/hals/camera/EmulatedCamera.cpp
+++ b/guest/hals/camera/EmulatedCamera.cpp
@@ -110,7 +110,7 @@
* Public API
***************************************************************************/
-status_t EmulatedCamera::Initialize(const avd::CameraDefinition&)
+status_t EmulatedCamera::Initialize(const cvd::CameraDefinition&)
{
/* Preview formats supported by this HAL. */
char preview_formats[1024];
diff --git a/guest/hals/camera/EmulatedCamera.h b/guest/hals/camera/EmulatedCamera.h
index 798f2d7..9976250 100755
--- a/guest/hals/camera/EmulatedCamera.h
+++ b/guest/hals/camera/EmulatedCamera.h
@@ -72,7 +72,7 @@
public:
/** Override of base class method */
- virtual status_t Initialize(const avd::CameraDefinition& properties);
+ virtual status_t Initialize(const cvd::CameraDefinition& properties);
/* Next frame is available in the camera device.
* This is a notification callback that is invoked by the camera device when
diff --git a/guest/hals/camera/EmulatedCamera2.cpp b/guest/hals/camera/EmulatedCamera2.cpp
index 445aa44..bc5e391 100644
--- a/guest/hals/camera/EmulatedCamera2.cpp
+++ b/guest/hals/camera/EmulatedCamera2.cpp
@@ -76,7 +76,7 @@
* Public API
***************************************************************************/
-status_t EmulatedCamera2::Initialize(const avd::CameraDefinition& props) {
+status_t EmulatedCamera2::Initialize(const cvd::CameraDefinition& props) {
return NO_ERROR;
}
diff --git a/guest/hals/camera/EmulatedCamera2.h b/guest/hals/camera/EmulatedCamera2.h
index aee1c36..baf5a18 100644
--- a/guest/hals/camera/EmulatedCamera2.h
+++ b/guest/hals/camera/EmulatedCamera2.h
@@ -66,7 +66,7 @@
***************************************************************************/
public:
- virtual status_t Initialize(const avd::CameraDefinition& props);
+ virtual status_t Initialize(const cvd::CameraDefinition& props);
/****************************************************************************
* Camera module API and generic hardware device API implementation
diff --git a/guest/hals/camera/EmulatedCamera3.cpp b/guest/hals/camera/EmulatedCamera3.cpp
index 133cca4..c9e48a5 100644
--- a/guest/hals/camera/EmulatedCamera3.cpp
+++ b/guest/hals/camera/EmulatedCamera3.cpp
@@ -65,7 +65,7 @@
* Public API
***************************************************************************/
-status_t EmulatedCamera3::Initialize(const avd::CameraDefinition& params) {
+status_t EmulatedCamera3::Initialize(const cvd::CameraDefinition& params) {
ALOGV("%s", __FUNCTION__);
mStatus = STATUS_CLOSED;
diff --git a/guest/hals/camera/EmulatedCamera3.h b/guest/hals/camera/EmulatedCamera3.h
index 79bf53c..e7a2ac1 100644
--- a/guest/hals/camera/EmulatedCamera3.h
+++ b/guest/hals/camera/EmulatedCamera3.h
@@ -86,7 +86,7 @@
***************************************************************************/
public:
- virtual status_t Initialize(const avd::CameraDefinition& params);
+ virtual status_t Initialize(const cvd::CameraDefinition& params);
/****************************************************************************
* Camera module API and generic hardware device API implementation
diff --git a/guest/hals/camera/EmulatedCameraFactory.cpp b/guest/hals/camera/EmulatedCameraFactory.cpp
index a59224a..00a3c99 100755
--- a/guest/hals/camera/EmulatedCameraFactory.cpp
+++ b/guest/hals/camera/EmulatedCameraFactory.cpp
@@ -51,7 +51,7 @@
#endif
{
mCameraConfiguration.Init();
- const std::vector<avd::CameraDefinition>& cameras =
+ const std::vector<cvd::CameraDefinition>& cameras =
mCameraConfiguration.cameras();
for (size_t camera_index = 0;
camera_index < cameras.size();
@@ -73,7 +73,7 @@
}
EmulatedBaseCamera* EmulatedCameraFactory::getOrCreateFakeCamera(size_t cameraId) {
- ::avd::LockGuard< ::avd::Mutex > lock(mEmulatedCamerasMutex);
+ ::cvd::LockGuard< ::cvd::Mutex > lock(mEmulatedCamerasMutex);
if (cameraId >= getEmulatedCameraNum()) {
ALOGE("%s: Invalid camera ID: %d", __FUNCTION__, cameraId);
@@ -84,25 +84,25 @@
return mEmulatedCameras[cameraId];
}
- const avd::CameraDefinition& definition = mCameraDefinitions[cameraId];
+ const cvd::CameraDefinition& definition = mCameraDefinitions[cameraId];
bool is_back_facing =
- (definition.orientation == avd::CameraDefinition::kBack);
+ (definition.orientation == cvd::CameraDefinition::kBack);
EmulatedBaseCamera* camera;
/* Create, and initialize the fake camera */
switch (definition.hal_version) {
- case avd::CameraDefinition::kHalV1:
+ case cvd::CameraDefinition::kHalV1:
camera = new EmulatedFakeCamera(cameraId, is_back_facing,
&HAL_MODULE_INFO_SYM.common);
break;
#if VSOC_PLATFORM_SDK_AFTER(J_MR2)
- case avd::CameraDefinition::kHalV2:
+ case cvd::CameraDefinition::kHalV2:
camera = new EmulatedFakeCamera2(cameraId, is_back_facing,
&HAL_MODULE_INFO_SYM.common);
break;
#endif
#if VSOC_PLATFORM_SDK_AFTER(L_MR1)
- case avd::CameraDefinition::kHalV3:
+ case cvd::CameraDefinition::kHalV3:
camera = new EmulatedFakeCamera3(cameraId, is_back_facing,
&HAL_MODULE_INFO_SYM.common);
break;
diff --git a/guest/hals/camera/EmulatedCameraFactory.h b/guest/hals/camera/EmulatedCameraFactory.h
index 4e92ffc..e354e29 100755
--- a/guest/hals/camera/EmulatedCameraFactory.h
+++ b/guest/hals/camera/EmulatedCameraFactory.h
@@ -171,7 +171,7 @@
Vector<EmulatedBaseCamera*> mEmulatedCameras;
/* Guards access to mEmulatedCameras. */
- avd::Mutex mEmulatedCamerasMutex;
+ cvd::Mutex mEmulatedCamerasMutex;
#if VSOC_PLATFORM_SDK_AFTER(J_MR2)
/* Camera callbacks (for status changing) */
@@ -182,8 +182,8 @@
#endif
/* Back- and front camera properties accessed from cloud metadata server. */
- avd::CameraConfiguration mCameraConfiguration;
- Vector<avd::CameraDefinition> mCameraDefinitions;
+ cvd::CameraConfiguration mCameraConfiguration;
+ Vector<cvd::CameraDefinition> mCameraDefinitions;
public:
/* Contains device open entry point, as required by HAL API. */
diff --git a/guest/hals/camera/EmulatedFakeCamera.cpp b/guest/hals/camera/EmulatedFakeCamera.cpp
index 3a02394..55dbc6c 100755
--- a/guest/hals/camera/EmulatedFakeCamera.cpp
+++ b/guest/hals/camera/EmulatedFakeCamera.cpp
@@ -47,7 +47,7 @@
* Public API overrides
***************************************************************************/
-status_t EmulatedFakeCamera::Initialize(const avd::CameraDefinition& params)
+status_t EmulatedFakeCamera::Initialize(const cvd::CameraDefinition& params)
{
status_t res = mFakeCameraDevice.Initialize();
if (res != NO_ERROR) {
diff --git a/guest/hals/camera/EmulatedFakeCamera.h b/guest/hals/camera/EmulatedFakeCamera.h
index f2adead..8657df9 100755
--- a/guest/hals/camera/EmulatedFakeCamera.h
+++ b/guest/hals/camera/EmulatedFakeCamera.h
@@ -46,7 +46,7 @@
public:
/* Initializes EmulatedFakeCamera instance. */
- status_t Initialize(const avd::CameraDefinition& params);
+ status_t Initialize(const cvd::CameraDefinition& params);
/****************************************************************************
* EmulatedCamera abstract API implementation.
diff --git a/guest/hals/camera/EmulatedFakeCamera2.cpp b/guest/hals/camera/EmulatedFakeCamera2.cpp
index 681953a..e5f2387 100644
--- a/guest/hals/camera/EmulatedFakeCamera2.cpp
+++ b/guest/hals/camera/EmulatedFakeCamera2.cpp
@@ -113,7 +113,7 @@
* Public API overrides
***************************************************************************/
-status_t EmulatedFakeCamera2::Initialize(const avd::CameraDefinition& params) {
+status_t EmulatedFakeCamera2::Initialize(const cvd::CameraDefinition& params) {
status_t res;
for (size_t index = 0; index < params.resolutions.size(); ++index) {
@@ -146,7 +146,7 @@
kAvailableRawSizes + arraysize(kAvailableRawSizes),
std::back_inserter(mAvailableRawSizes));
- if (params.orientation == avd::CameraDefinition::kFront) {
+ if (params.orientation == cvd::CameraDefinition::kFront) {
std::copy(kAvailableProcessedSizesFront,
kAvailableProcessedSizesFront +
arraysize(kAvailableProcessedSizesFront),
diff --git a/guest/hals/camera/EmulatedFakeCamera2.h b/guest/hals/camera/EmulatedFakeCamera2.h
index a859211..c622d26 100644
--- a/guest/hals/camera/EmulatedFakeCamera2.h
+++ b/guest/hals/camera/EmulatedFakeCamera2.h
@@ -53,7 +53,7 @@
public:
/* Initializes EmulatedFakeCamera2 instance. */
- status_t Initialize(const avd::CameraDefinition& props);
+ status_t Initialize(const cvd::CameraDefinition& props);
/****************************************************************************
* Camera Module API and generic hardware device API implementation
diff --git a/guest/hals/camera/EmulatedFakeCamera3.cpp b/guest/hals/camera/EmulatedFakeCamera3.cpp
index 238a6fb..dcfc34c 100644
--- a/guest/hals/camera/EmulatedFakeCamera3.cpp
+++ b/guest/hals/camera/EmulatedFakeCamera3.cpp
@@ -105,7 +105,7 @@
}
}
-status_t EmulatedFakeCamera3::Initialize(const avd::CameraDefinition& params) {
+status_t EmulatedFakeCamera3::Initialize(const cvd::CameraDefinition& params) {
ALOGV("%s: E", __FUNCTION__);
status_t res;
@@ -1103,7 +1103,7 @@
}
status_t EmulatedFakeCamera3::constructStaticInfo(
- const avd::CameraDefinition& params) {
+ const cvd::CameraDefinition& params) {
CameraMetadata info;
Vector<int32_t> availableCharacteristicsKeys;
diff --git a/guest/hals/camera/EmulatedFakeCamera3.h b/guest/hals/camera/EmulatedFakeCamera3.h
index 9fa56c9..f0cf68f 100644
--- a/guest/hals/camera/EmulatedFakeCamera3.h
+++ b/guest/hals/camera/EmulatedFakeCamera3.h
@@ -58,7 +58,7 @@
public:
- virtual status_t Initialize(const avd::CameraDefinition& params);
+ virtual status_t Initialize(const cvd::CameraDefinition& params);
/****************************************************************************
* Camera module API and generic hardware device API implementation
@@ -108,7 +108,7 @@
/**
* Build the static info metadata buffer for this device
*/
- status_t constructStaticInfo(const avd::CameraDefinition& params);
+ status_t constructStaticInfo(const cvd::CameraDefinition& params);
/**
* Run the fake 3A algorithms as needed. May override/modify settings
diff --git a/guest/hals/ril/vsoc_ril.cpp b/guest/hals/ril/vsoc_ril.cpp
index d6977af..70c6633 100644
--- a/guest/hals/ril/vsoc_ril.cpp
+++ b/guest/hals/ril/vsoc_ril.cpp
@@ -165,7 +165,7 @@
// TearDownNetworkInterface disables network interface.
// This call returns true, if operation was successful.
bool TearDownNetworkInterface() {
- auto nm(avd::NetworkInterfaceManager::New(nullptr));
+ auto nm(cvd::NetworkInterfaceManager::New(nullptr));
auto ni(nm->Open("rmnet0"));
if (ni) {
@@ -1030,7 +1030,7 @@
rc.session = 1;
rc.phase = RC_PHASE_CONFIGURED;
rc.rat = RAF_HSPAP;
- strncpy(rc.logicalModemUuid, "com.google.avdgce1.modem", MAX_UUID_LENGTH);
+ strncpy(rc.logicalModemUuid, "com.google.cvdgce1.modem", MAX_UUID_LENGTH);
rc.status = RC_STATUS_SUCCESS;
gce_ril_env->OnRequestComplete(t, RIL_E_SUCCESS, &rc, sizeof(rc));
}
@@ -1157,7 +1157,7 @@
}
static void request_baseband_version(RIL_Token t) {
- const char* response_str = "AVD_R1.0.0";
+ const char* response_str = "CVD_R1.0.0";
ALOGV("Requested phone baseband version.");
@@ -1340,8 +1340,8 @@
ALOGV("Requesting hardware configuration.");
- strncpy(hw_cfg[0].uuid, "com.google.avdgce1.modem", sizeof(hw_cfg[0].uuid));
- strncpy(hw_cfg[1].uuid, "com.google.avdgce1.sim", sizeof(hw_cfg[1].uuid));
+ strncpy(hw_cfg[0].uuid, "com.google.cvdgce1.modem", sizeof(hw_cfg[0].uuid));
+ strncpy(hw_cfg[1].uuid, "com.google.cvdgce1.sim", sizeof(hw_cfg[1].uuid));
int technologies = 0; // = unknown.
std::map<RIL_PreferredNetworkType, int>::iterator iter =
diff --git a/guest/hals/sensors/sensors.cpp b/guest/hals/sensors/sensors.cpp
index 28b7cf1..eb1dda6 100644
--- a/guest/hals/sensors/sensors.cpp
+++ b/guest/hals/sensors/sensors.cpp
@@ -19,9 +19,9 @@
#include "guest/hals/sensors/sensors.h"
-namespace avd {
+namespace cvd {
namespace {
-const avd::time::Milliseconds kDefaultSamplingRate(200);
+const cvd::time::Milliseconds kDefaultSamplingRate(200);
#if !VSOC_SENSORS_DEVICE_API_VERSION_ATLEAST(1_3)
namespace {
@@ -37,8 +37,8 @@
}
} // namespace
-const avd::time::MonotonicTimePoint SensorState::kInfinity =
- avd::time::MonotonicTimePoint(infinity());
+const cvd::time::MonotonicTimePoint SensorState::kInfinity =
+ cvd::time::MonotonicTimePoint(infinity());
SensorState::SensorState(SensorInfo info)
: enabled_(false),
@@ -195,4 +195,4 @@
flags);
}
-} // namespace avd
+} // namespace cvd
diff --git a/guest/hals/sensors/sensors.h b/guest/hals/sensors/sensors.h
index 343329d..c4305ce 100644
--- a/guest/hals/sensors/sensors.h
+++ b/guest/hals/sensors/sensors.h
@@ -19,7 +19,7 @@
#include "guest/hals/sensors/sensors_hal.h"
#include "guest/libs/platform_support/api_level_fixes.h"
-namespace avd {
+namespace cvd {
// Stores static information about a sensor.
// Must be completely compatible with sensor_t (i.e. no additional
@@ -72,12 +72,12 @@
// The deadline at which we should report the next sensor event
// to the framework in order to meet our frequency constraints.
// For disabled sensors, should be 'infinity'.
- avd::time::MonotonicTimePoint deadline_;
+ cvd::time::MonotonicTimePoint deadline_;
// Delay time between consecutive sensor samples, in ns.
- avd::time::Nanoseconds sampling_period_;
+ cvd::time::Nanoseconds sampling_period_;
// Time 'infinity'.
- static const avd::time::MonotonicTimePoint kInfinity;
+ static const cvd::time::MonotonicTimePoint kInfinity;
};
namespace sensors_constants {
@@ -227,5 +227,5 @@
const bool kRelativeHumidityIsWakeup = false;
} // namespace sensors_constants
-} // namespace avd
+} // namespace cvd
diff --git a/guest/hals/sensors/sensors_hal.cpp b/guest/hals/sensors/sensors_hal.cpp
index 3b45b0e..4761d3d 100644
--- a/guest/hals/sensors/sensors_hal.cpp
+++ b/guest/hals/sensors/sensors_hal.cpp
@@ -19,7 +19,7 @@
#include "guest/libs/platform_support/api_level_fixes.h"
static hw_module_methods_t hal_module_methods = {
- VSOC_STATIC_INITIALIZER(open) avd::GceSensors::Open,
+ VSOC_STATIC_INITIALIZER(open) cvd::GceSensors::Open,
};
sensors_module_t HAL_MODULE_INFO_SYM = {
@@ -32,8 +32,8 @@
VSOC_STATIC_INITIALIZER(author) "Google",
VSOC_STATIC_INITIALIZER(methods) & hal_module_methods,
},
- VSOC_STATIC_INITIALIZER(get_sensors_list) avd::GceSensors::GetSensorsList,
+ VSOC_STATIC_INITIALIZER(get_sensors_list) cvd::GceSensors::GetSensorsList,
#if VSOC_SENSORS_DEVICE_API_VERSION_ATLEAST(1_4)
- VSOC_STATIC_INITIALIZER(set_operation_mode) avd::GceSensors::SetOperationMode,
+ VSOC_STATIC_INITIALIZER(set_operation_mode) cvd::GceSensors::SetOperationMode,
#endif
};
diff --git a/guest/hals/sensors/vsoc_sensors.cpp b/guest/hals/sensors/vsoc_sensors.cpp
index f9397c8..86809a0 100644
--- a/guest/hals/sensors/vsoc_sensors.cpp
+++ b/guest/hals/sensors/vsoc_sensors.cpp
@@ -32,13 +32,13 @@
#include "guest/libs/platform_support/api_level_fixes.h"
#include "guest/libs/remoter/remoter_framework_pkt.h"
-using avd::LockGuard;
-using avd::Mutex;
-using avd::time::Milliseconds;
-using avd::time::MonotonicTimePoint;
-using avd::time::Nanoseconds;
+using cvd::LockGuard;
+using cvd::Mutex;
+using cvd::time::Milliseconds;
+using cvd::time::MonotonicTimePoint;
+using cvd::time::Nanoseconds;
-namespace avd {
+namespace cvd {
namespace {
template <typename F>
@@ -68,7 +68,7 @@
if (control_sender_socket_->IsOpen() || control_receiver_socket_->IsOpen()) {
ALOGE("%s: Receiver control FDs are opened", __FUNCTION__);
}
- if (!avd::SharedFD::Pipe(&control_receiver_socket_,
+ if (!cvd::SharedFD::Pipe(&control_receiver_socket_,
&control_sender_socket_)) {
ALOGE("%s: Unable to create thread control FDs: %d -> %s", __FUNCTION__,
errno, strerror(errno));
@@ -252,7 +252,7 @@
void *GceSensors::Receiver() {
// Initialize the server.
- sensor_listener_socket_ = avd::SharedFD::SocketSeqPacketServer(
+ sensor_listener_socket_ = cvd::SharedFD::SocketSeqPacketServer(
gce_sensors_message::kSensorsHALSocketName, 0777);
if (!sensor_listener_socket_->IsOpen()) {
ALOGE("GceSensors::%s: Could not listen for sensor connections. (%s).",
@@ -268,18 +268,18 @@
ALOGI("Notified remoter that HAL is ready.");
}
- typedef std::vector<avd::SharedFD> FDVec;
+ typedef std::vector<cvd::SharedFD> FDVec;
FDVec connected;
// Listen for incoming sensor data and control messages
// from the HAL.
while (true) {
- avd::SharedFDSet fds;
+ cvd::SharedFDSet fds;
for (FDVec::iterator it = connected.begin(); it != connected.end(); ++it) {
fds.Set(*it);
}
fds.Set(control_receiver_socket_);
// fds.Set(sensor_listener_socket_);
- int res = avd::Select(&fds, NULL, NULL, NULL);
+ int res = cvd::Select(&fds, NULL, NULL, NULL);
if (res == -1) {
ALOGE("%s: select returned %d and failed %d -> %s", __FUNCTION__, res,
errno, strerror(errno));
@@ -288,7 +288,7 @@
ALOGE("%s: select timed out", __FUNCTION__);
break;
} else if (fds.IsSet(sensor_listener_socket_)) {
- connected.push_back(avd::SharedFD::Accept(*sensor_listener_socket_));
+ connected.push_back(cvd::SharedFD::Accept(*sensor_listener_socket_));
ALOGI("GceSensors::%s: new client connected", __FUNCTION__);
} else if (fds.IsSet(control_receiver_socket_)) {
// We received a control message.
@@ -329,7 +329,7 @@
for (FDVec::iterator it = connected.begin(); it != connected.end();
++it) {
- avd::SharedFD &fd = *it;
+ cvd::SharedFD &fd = *it;
if (fd->SendMsg(&msg, 0) == -1) {
ALOGE("GceSensors::%s. Could not send sensor state (%s).",
__FUNCTION__, fd->StrError());
@@ -343,7 +343,7 @@
} else {
for (FDVec::iterator it = connected.begin(); it != connected.end();
++it) {
- avd::SharedFD &fd = *it;
+ cvd::SharedFD &fd = *it;
if (fds.IsSet(fd)) {
// We received a sensor update from remoter.
sensors_event_t event;
@@ -524,4 +524,4 @@
return total_sensor_count_;
}
-} // namespace avd
+} // namespace cvd
diff --git a/guest/hals/sensors/vsoc_sensors.h b/guest/hals/sensors/vsoc_sensors.h
index dbbeddd..dec7102 100644
--- a/guest/hals/sensors/vsoc_sensors.h
+++ b/guest/hals/sensors/vsoc_sensors.h
@@ -22,7 +22,7 @@
#include "guest/hals/sensors/sensors.h"
#include "guest/hals/sensors/sensors_hal.h"
-namespace avd {
+namespace cvd {
// Used for sending control messages to the receiver thread.
// The sensor_handle field may be left unused if it is not needed.
@@ -177,7 +177,7 @@
// contiguous up to the number of supported sensors.
SensorStateVector sensor_states_;
// Keep track of the time when the thread in Poll() is scheduled to wake.
- avd::time::MonotonicTimePoint current_deadline_;
+ cvd::time::MonotonicTimePoint current_deadline_;
// Ordered set of sensor values.
// TODO(ghartman): Simulate FIFO overflow.
@@ -185,18 +185,18 @@
// Thread to handle new connections.
pthread_t receiver_thread_;
// Socket to receive sensor events on.
- avd::SharedFD sensor_listener_socket_;
+ cvd::SharedFD sensor_listener_socket_;
// Socket for listener thread to receive control messages.
- avd::SharedFD control_receiver_socket_;
+ cvd::SharedFD control_receiver_socket_;
// Socket to send control messages to listener thread.
- avd::SharedFD control_sender_socket_;
+ cvd::SharedFD control_sender_socket_;
// Lock to protect shared state, including
// sensor_states_ and next_deadline_.
// Associated with deadline_change_ condition variable.
- avd::Mutex sensor_state_lock_;
+ cvd::Mutex sensor_state_lock_;
// Condition variable to signal changes in the deadline.
- avd::ConditionVariable deadline_change_;
+ cvd::ConditionVariable deadline_change_;
// When events are arriving from a client, we report only
// when they arrive, rather than at a fixed cycle. After not
@@ -204,7 +204,7 @@
// and a given time period, we will give up and resume
// sending mock events.
const static int kInjectedEventWaitPeriods;
- const static avd::time::Nanoseconds kInjectedEventWaitTime;
+ const static cvd::time::Nanoseconds kInjectedEventWaitTime;
/**
** UTILITY FUNCTIONS
@@ -222,7 +222,7 @@
// This should be called anytime the next deadline may have changed.
// Can only be called while holding sensor_state_lock_.
// Returns true if the deadline has changed.
- avd::time::MonotonicTimePoint UpdateDeadline();
+ cvd::time::MonotonicTimePoint UpdateDeadline();
// Sends an update for the sensor with the given handle to the remoter.
// Update will be enqueued for receiver, not send immediately.
@@ -237,5 +237,5 @@
};
-} //namespace avd
+} //namespace cvd
diff --git a/guest/libs/remoter/remoter_framework_pkt.cpp b/guest/libs/remoter/remoter_framework_pkt.cpp
index ef1258d..68564f1 100644
--- a/guest/libs/remoter/remoter_framework_pkt.cpp
+++ b/guest/libs/remoter/remoter_framework_pkt.cpp
@@ -15,8 +15,8 @@
*/
#include "guest/libs/remoter/remoter_framework_pkt.h"
-void remoter_connect(avd::SharedFD* dest) {
- *dest = avd::SharedFD::SocketLocalClient(
+void remoter_connect(cvd::SharedFD* dest) {
+ *dest = cvd::SharedFD::SocketLocalClient(
"remoter", ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_STREAM);
if ((*dest)->IsOpen()) {
ALOGE("Failed to connect to remoter (%s)", (*dest)->StrError());
diff --git a/guest/libs/remoter/remoter_framework_pkt.h b/guest/libs/remoter/remoter_framework_pkt.h
index 55d1219..9fc6173 100644
--- a/guest/libs/remoter/remoter_framework_pkt.h
+++ b/guest/libs/remoter/remoter_framework_pkt.h
@@ -126,11 +126,11 @@
pkt->status = status;
}
-void remoter_connect(avd::SharedFD* dest);
+void remoter_connect(cvd::SharedFD* dest);
int remoter_connect();
static inline int remoter_read_request(
- const avd::SharedFD& socket,
+ const cvd::SharedFD& socket,
struct remoter_request_packet* request) {
int len;
int remaining_data;
@@ -231,7 +231,7 @@
}
static inline int remoter_send_response(
- const avd::SharedFD& socket,
+ const cvd::SharedFD& socket,
struct remoter_response_packet* response) {
int len = socket->Write(response, sizeof(*response));
if (len <=0) {
diff --git a/guest/monitoring/vsoc_service/java/com/android/google/gce/gceservice/PackageVerificationConsentEnforcer.java b/guest/monitoring/vsoc_service/java/com/android/google/gce/gceservice/PackageVerificationConsentEnforcer.java
index 5028eae..e45d656 100644
--- a/guest/monitoring/vsoc_service/java/com/android/google/gce/gceservice/PackageVerificationConsentEnforcer.java
+++ b/guest/monitoring/vsoc_service/java/com/android/google/gce/gceservice/PackageVerificationConsentEnforcer.java
@@ -24,7 +24,7 @@
/**
* Forces pacakge verification to be off on N and N-MR1 by adjusting package_verifier_user_consent.
*
- * This is needed because AVDs don't have a touch screen, and the consent
+ * This is needed because CVDs don't have a touch screen, and the consent
* dialog will block apk installs.
*
* Possible values for consent seem to be:
diff --git a/guest/vsoc/lib/region_control.cpp b/guest/vsoc/lib/region_control.cpp
index cf48218..c308e6d 100644
--- a/guest/vsoc/lib/region_control.cpp
+++ b/guest/vsoc/lib/region_control.cpp
@@ -29,7 +29,7 @@
#include <android-base/logging.h>
#include <uapi/vsoc_shm.h>
-using avd::SharedFD;
+using cvd::SharedFD;
namespace {
class GuestRegionControl : public vsoc::RegionControl {
@@ -49,7 +49,7 @@
vsoc_reg_off_t owner_offset, uint32_t owned_val,
vsoc_reg_off_t begin_offset,
vsoc_reg_off_t end_offset) override;
- avd::SharedFD region_fd_;
+ cvd::SharedFD region_fd_;
};
std::string device_path_from_name(const char* region_name) {
diff --git a/host/commands/launch/README.md b/host/commands/launch/README.md
index e6b1e8f..05bb716 100644
--- a/host/commands/launch/README.md
+++ b/host/commands/launch/README.md
@@ -111,7 +111,7 @@
listed. If device is reported as `????????`, or as:
```log
-CUTTLEFISHAVD_01 no permissions (verify udev rules); see [http://developer.android.com/tools/device.html]
+CUTTLEFISHCVD01 no permissions (verify udev rules); see [http://developer.android.com/tools/device.html]
```
you may have to re-start adb as root (we don't have udev rules updating virtual
diff --git a/host/commands/launch/main.cc b/host/commands/launch/main.cc
index 05d97759..0ed8767 100644
--- a/host/commands/launch/main.cc
+++ b/host/commands/launch/main.cc
@@ -121,13 +121,13 @@
private:
void Thread() {
for (;;) {
- avd::SharedFDSet fd_read;
+ cvd::SharedFDSet fd_read;
fd_read.Zero();
adb_.BeforeSelect(&fd_read);
usbip_.BeforeSelect(&fd_read);
- int ret = avd::Select(&fd_read, nullptr, nullptr, nullptr);
+ int ret = cvd::Select(&fd_read, nullptr, nullptr, nullptr);
if (ret <= 0) continue;
adb_.AfterSelect(fd_read);
diff --git a/host/frontend/vnc_server/blackboard.cpp b/host/frontend/vnc_server/blackboard.cpp
index 65145b2..b842648 100644
--- a/host/frontend/vnc_server/blackboard.cpp
+++ b/host/frontend/vnc_server/blackboard.cpp
@@ -29,10 +29,10 @@
#define DLOG(LEVEL) \
if (FLAGS_debug_blackboard) LOG(LEVEL)
-using avd::vnc::BlackBoard;
-using avd::vnc::Stripe;
+using cvd::vnc::BlackBoard;
+using cvd::vnc::Stripe;
-avd::vnc::SeqNumberVec avd::vnc::MakeSeqNumberVec() {
+cvd::vnc::SeqNumberVec cvd::vnc::MakeSeqNumberVec() {
return SeqNumberVec(FrameBufferWatcher::StripesPerFrame());
}
@@ -75,7 +75,7 @@
return true;
}
-avd::vnc::StripePtrVec BlackBoard::WaitForSenderWork(
+cvd::vnc::StripePtrVec BlackBoard::WaitForSenderWork(
const VncClientConnection* conn) {
std::unique_lock<std::mutex> guard(m_);
auto& state = GetStateForClient(conn);
@@ -139,7 +139,7 @@
}
void BlackBoard::set_frame_buffer_watcher(
- avd::vnc::FrameBufferWatcher* frame_buffer_watcher) {
+ cvd::vnc::FrameBufferWatcher* frame_buffer_watcher) {
std::lock_guard<std::mutex> guard(m_);
frame_buffer_watcher_ = frame_buffer_watcher;
}
diff --git a/host/frontend/vnc_server/blackboard.h b/host/frontend/vnc_server/blackboard.h
index cd3ef1b..1119dd3 100644
--- a/host/frontend/vnc_server/blackboard.h
+++ b/host/frontend/vnc_server/blackboard.h
@@ -25,7 +25,7 @@
#include "common/libs/threads/thread_annotations.h"
#include "host/frontend/vnc_server/vnc_utils.h"
-namespace avd {
+namespace cvd {
namespace vnc {
class VncClientConnection;
@@ -110,4 +110,4 @@
};
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/frame_buffer_watcher.cpp b/host/frontend/vnc_server/frame_buffer_watcher.cpp
index d7a9818..a09269a 100644
--- a/host/frontend/vnc_server/frame_buffer_watcher.cpp
+++ b/host/frontend/vnc_server/frame_buffer_watcher.cpp
@@ -28,7 +28,7 @@
#include <glog/logging.h>
#include "host/frontend/vnc_server/vnc_utils.h"
-using avd::vnc::FrameBufferWatcher;
+using cvd::vnc::FrameBufferWatcher;
FrameBufferWatcher::FrameBufferWatcher(BlackBoard* bb)
: bb_{bb}, hwcomposer{bb_} {
@@ -59,7 +59,7 @@
return closed_;
}
-avd::vnc::Stripe FrameBufferWatcher::Rotated(Stripe stripe) {
+cvd::vnc::Stripe FrameBufferWatcher::Rotated(Stripe stripe) {
if (stripe.orientation == ScreenOrientation::Landscape) {
LOG(FATAL) << "Rotating a landscape stripe, this is a mistake";
}
@@ -88,7 +88,7 @@
return Stripes(stripe.orientation)[stripe.index]->raw_data != stripe.raw_data;
}
-avd::vnc::StripePtrVec FrameBufferWatcher::StripesNewerThan(
+cvd::vnc::StripePtrVec FrameBufferWatcher::StripesNewerThan(
ScreenOrientation orientation, const SeqNumberVec& seq_numbers) const {
std::lock_guard<std::mutex> guard(stripes_lock_);
const auto& stripes = Stripes(orientation);
@@ -102,12 +102,12 @@
return new_stripes;
}
-avd::vnc::StripePtrVec& FrameBufferWatcher::Stripes(
+cvd::vnc::StripePtrVec& FrameBufferWatcher::Stripes(
ScreenOrientation orientation) {
return stripes_[static_cast<int>(orientation)];
}
-const avd::vnc::StripePtrVec& FrameBufferWatcher::Stripes(
+const cvd::vnc::StripePtrVec& FrameBufferWatcher::Stripes(
ScreenOrientation orientation) const {
return stripes_[static_cast<int>(orientation)];
}
diff --git a/host/frontend/vnc_server/frame_buffer_watcher.h b/host/frontend/vnc_server/frame_buffer_watcher.h
index d24766c..40ab270 100644
--- a/host/frontend/vnc_server/frame_buffer_watcher.h
+++ b/host/frontend/vnc_server/frame_buffer_watcher.h
@@ -27,7 +27,7 @@
#include "host/frontend/vnc_server/jpeg_compressor.h"
#include "host/frontend/vnc_server/simulated_hw_composer.h"
-namespace avd {
+namespace cvd {
namespace vnc {
class FrameBufferWatcher {
public:
@@ -73,4 +73,4 @@
};
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/jpeg_compressor.cpp b/host/frontend/vnc_server/jpeg_compressor.cpp
index a5423f0..711a762 100644
--- a/host/frontend/vnc_server/jpeg_compressor.cpp
+++ b/host/frontend/vnc_server/jpeg_compressor.cpp
@@ -21,7 +21,7 @@
#include "host/frontend/vnc_server/jpeg_compressor.h"
#include "host/frontend/vnc_server/vnc_utils.h"
-using avd::vnc::JpegCompressor;
+using cvd::vnc::JpegCompressor;
namespace {
void InitCinfo(jpeg_compress_struct* cinfo, jpeg_error_mgr* err,
@@ -31,7 +31,7 @@
cinfo->image_width = width;
cinfo->image_height = height;
- cinfo->input_components = avd::vnc::BytesPerPixel();
+ cinfo->input_components = cvd::vnc::BytesPerPixel();
cinfo->in_color_space = JCS_EXT_RGBX;
jpeg_set_defaults(cinfo);
@@ -39,7 +39,7 @@
}
} // namespace
-avd::vnc::Message JpegCompressor::Compress(const Message& frame,
+cvd::vnc::Message JpegCompressor::Compress(const Message& frame,
int jpeg_quality, std::uint16_t x,
std::uint16_t y, std::uint16_t width,
std::uint16_t height,
diff --git a/host/frontend/vnc_server/jpeg_compressor.h b/host/frontend/vnc_server/jpeg_compressor.h
index 86bd2d3..ae3af18 100644
--- a/host/frontend/vnc_server/jpeg_compressor.h
+++ b/host/frontend/vnc_server/jpeg_compressor.h
@@ -22,7 +22,7 @@
#include "host/frontend/vnc_server/vnc_utils.h"
-namespace avd {
+namespace cvd {
namespace vnc {
// libjpeg-turbo with jpeg_mem_dest (using memory as a destination) is funky.
@@ -49,4 +49,4 @@
};
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/keysyms.h b/host/frontend/vnc_server/keysyms.h
index 51d9f07..41ff7c7 100644
--- a/host/frontend/vnc_server/keysyms.h
+++ b/host/frontend/vnc_server/keysyms.h
@@ -18,7 +18,7 @@
#include <cstdint>
-namespace avd {
+namespace cvd {
namespace xk {
constexpr uint32_t BackSpace = 0xff08, Tab = 0xff09, Return = 0xff0d,
@@ -51,4 +51,4 @@
VNCMenu = 0xffed; // VNC seems to translate MENU to this
} // namespace xk
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/main.cpp b/host/frontend/vnc_server/main.cpp
index c47a687..97266ee 100644
--- a/host/frontend/vnc_server/main.cpp
+++ b/host/frontend/vnc_server/main.cpp
@@ -31,9 +31,9 @@
using ::android::base::ERROR;
::android::base::InitLogging(argv, android::base::StderrLogger);
::gflags::ParseCommandLineFlags(&argc, &argv, true);
- if (!avd::vnc::GetFBBroadcastRegionView()->Open()) {
+ if (!cvd::vnc::GetFBBroadcastRegionView()->Open()) {
LOG(FATAL) << "Unable to open FBBroadcastRegion";
}
- avd::vnc::VncServer vnc_server(FLAGS_port, FLAGS_agressive);
+ cvd::vnc::VncServer vnc_server(FLAGS_port, FLAGS_agressive);
vnc_server.MainLoop();
}
diff --git a/host/frontend/vnc_server/simulated_hw_composer.cpp b/host/frontend/vnc_server/simulated_hw_composer.cpp
index db9b866..3b21e7b 100644
--- a/host/frontend/vnc_server/simulated_hw_composer.cpp
+++ b/host/frontend/vnc_server/simulated_hw_composer.cpp
@@ -20,7 +20,7 @@
#include "host/frontend/vnc_server/vnc_utils.h"
#include "host/vsoc/gralloc/gralloc_buffer_region.h"
-using avd::vnc::SimulatedHWComposer;
+using cvd::vnc::SimulatedHWComposer;
using vsoc::gralloc::GrallocBufferRegion;
SimulatedHWComposer::SimulatedHWComposer(BlackBoard* bb)
@@ -38,7 +38,7 @@
stripe_maker_.join();
}
-avd::vnc::Stripe SimulatedHWComposer::GetNewStripe() {
+cvd::vnc::Stripe SimulatedHWComposer::GetNewStripe() {
auto s = stripes_.Pop();
#ifdef FUZZ_TEST_VNC
if (random_(engine_)) {
diff --git a/host/frontend/vnc_server/simulated_hw_composer.h b/host/frontend/vnc_server/simulated_hw_composer.h
index 0a50d62..87eb26a 100644
--- a/host/frontend/vnc_server/simulated_hw_composer.h
+++ b/host/frontend/vnc_server/simulated_hw_composer.h
@@ -28,7 +28,7 @@
#include "common/vsoc/framebuffer/fb_bcast_region_view.h"
#include "host/frontend/vnc_server/blackboard.h"
-namespace avd {
+namespace cvd {
namespace vnc {
class SimulatedHWComposer {
public:
@@ -62,4 +62,4 @@
std::thread stripe_maker_;
};
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/tcp_socket.cpp b/host/frontend/vnc_server/tcp_socket.cpp
index a8caef5..92aed93 100644
--- a/host/frontend/vnc_server/tcp_socket.cpp
+++ b/host/frontend/vnc_server/tcp_socket.cpp
@@ -24,10 +24,10 @@
#include <glog/logging.h>
-using avd::SharedFD;
-using avd::vnc::ClientSocket;
-using avd::vnc::Message;
-using avd::vnc::ServerSocket;
+using cvd::SharedFD;
+using cvd::vnc::ClientSocket;
+using cvd::vnc::Message;
+using cvd::vnc::ServerSocket;
Message ClientSocket::Recv(size_t length) {
Message buf(length);
diff --git a/host/frontend/vnc_server/tcp_socket.h b/host/frontend/vnc_server/tcp_socket.h
index a130ef4..f926642 100644
--- a/host/frontend/vnc_server/tcp_socket.h
+++ b/host/frontend/vnc_server/tcp_socket.h
@@ -24,7 +24,7 @@
#include <cstdint>
#include <mutex>
-namespace avd {
+namespace cvd {
namespace vnc {
class ServerSocket;
@@ -56,9 +56,9 @@
private:
friend ServerSocket;
- explicit ClientSocket(avd::SharedFD fd) : fd_(fd) {}
+ explicit ClientSocket(cvd::SharedFD fd) : fd_(fd) {}
- avd::SharedFD fd_;
+ cvd::SharedFD fd_;
bool other_side_closed_{};
std::mutex send_lock_;
};
@@ -73,8 +73,8 @@
ClientSocket Accept();
private:
- avd::SharedFD fd_;
+ cvd::SharedFD fd_;
};
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/virtual_input_device.cpp b/host/frontend/vnc_server/virtual_input_device.cpp
index 82c1757..66cedc2 100644
--- a/host/frontend/vnc_server/virtual_input_device.cpp
+++ b/host/frontend/vnc_server/virtual_input_device.cpp
@@ -31,7 +31,7 @@
#include <glog/logging.h>
#include "host/frontend/vnc_server/keysyms.h"
-namespace avd {
+namespace cvd {
//////////////////////////
// VirtualButton Support
@@ -281,4 +281,4 @@
std::to_string(y) + "\n");
}
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/virtual_input_device.h b/host/frontend/vnc_server/virtual_input_device.h
index a46bee5..5fb0be5 100644
--- a/host/frontend/vnc_server/virtual_input_device.h
+++ b/host/frontend/vnc_server/virtual_input_device.h
@@ -20,7 +20,7 @@
#include <map>
#include <string>
-namespace avd {
+namespace cvd {
// Base virtual input device class which contains a bunch of boiler-plate code.
class VirtualInputDevice {
@@ -75,4 +75,4 @@
std::map<uint32_t, std::string> keymapping_;
};
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/virtual_inputs.cpp b/host/frontend/vnc_server/virtual_inputs.cpp
index c638d13..369fa96 100644
--- a/host/frontend/vnc_server/virtual_inputs.cpp
+++ b/host/frontend/vnc_server/virtual_inputs.cpp
@@ -23,7 +23,7 @@
DEFINE_string(input_socket, "/tmp/android-cuttlefish-1-input",
"The name of unix socket where the monkey server is listening "
"for input commands");
-using avd::vnc::VirtualInputs;
+using cvd::vnc::VirtualInputs;
VirtualInputs::VirtualInputs()
: virtual_keyboard_(
@@ -33,13 +33,13 @@
virtual_power_button_("KEYCODE_POWER", [this](std::string cmd) {
return SendMonkeyComand(cmd);
}) {
- monkey_socket_ = avd::SharedFD::SocketLocalClient(FLAGS_input_socket.c_str(),
+ monkey_socket_ = cvd::SharedFD::SocketLocalClient(FLAGS_input_socket.c_str(),
false, SOCK_STREAM);
if (!monkey_socket_->IsOpen()) {
// Monkey is known to die on the second conection, so let's wait a litttle
// bit and try again.
std::this_thread::sleep_for(std::chrono::milliseconds(500));
- monkey_socket_ = avd::SharedFD::SocketLocalClient(
+ monkey_socket_ = cvd::SharedFD::SocketLocalClient(
FLAGS_input_socket.c_str(), false, SOCK_STREAM);
if (!monkey_socket_->IsOpen()) {
LOG(FATAL) << "Unable to connect to the mokey server";
diff --git a/host/frontend/vnc_server/virtual_inputs.h b/host/frontend/vnc_server/virtual_inputs.h
index d0e9ffa..d5d00b9 100644
--- a/host/frontend/vnc_server/virtual_inputs.h
+++ b/host/frontend/vnc_server/virtual_inputs.h
@@ -25,7 +25,7 @@
#include "host/frontend/vnc_server/virtual_input_device.h"
#include "host/frontend/vnc_server/vnc_utils.h"
-namespace avd {
+namespace cvd {
namespace vnc {
class VirtualInputs {
@@ -38,7 +38,7 @@
void HandlePointerEvent(bool touch_down, int x, int y);
private:
- avd::SharedFD monkey_socket_;
+ cvd::SharedFD monkey_socket_;
bool SendMonkeyComand(std::string cmd);
std::mutex m_;
VirtualKeyboard virtual_keyboard_ GUARDED_BY(m_);
@@ -47,4 +47,4 @@
};
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/vnc_client_connection.cpp b/host/frontend/vnc_server/vnc_client_connection.cpp
index 533d6bc..c9a87c8 100644
--- a/host/frontend/vnc_server/vnc_client_connection.cpp
+++ b/host/frontend/vnc_server/vnc_client_connection.cpp
@@ -37,10 +37,10 @@
#include "host/frontend/vnc_server/tcp_socket.h"
#include "host/frontend/vnc_server/vnc_utils.h"
-using avd::vnc::Message;
-using avd::vnc::Stripe;
-using avd::vnc::StripePtrVec;
-using avd::vnc::VncClientConnection;
+using cvd::vnc::Message;
+using cvd::vnc::Stripe;
+using cvd::vnc::StripePtrVec;
+using cvd::vnc::VncClientConnection;
DEFINE_bool(debug_client, false, "Turn on detailed logging for the client");
@@ -158,7 +158,7 @@
((0x1 << GceFrameBuffer::kGreenBits) - 1);
}
} // namespace
-namespace avd {
+namespace cvd {
namespace vnc {
bool operator==(const VncClientConnection::FrameBufferUpdateRequest& lhs,
const VncClientConnection::FrameBufferUpdateRequest& rhs) {
@@ -171,13 +171,13 @@
return !(lhs == rhs);
}
} // namespace vnc
-} // namespace avd
+} // namespace cvd
VncClientConnection::VncClientConnection(ClientSocket client,
VirtualInputs* virtual_inputs,
BlackBoard* bb, bool aggressive)
: client_{std::move(client)},
- sensor_event_hal_{avd::SharedFD::SocketSeqPacketClient(
+ sensor_event_hal_{cvd::SharedFD::SocketSeqPacketClient(
gce_sensors_message::kSensorsHALSocketName)},
virtual_inputs_{virtual_inputs},
bb_{bb} {
@@ -526,7 +526,7 @@
// // Construct the sensor message.
// gce_sensors_message message{};
// message.version = sizeof message;
- // message.sensor = avd::sensors_constants::kAccelerometerHandle;
+ // message.sensor = cvd::sensors_constants::kAccelerometerHandle;
// message.type = SENSOR_TYPE_ACCELEROMETER;
// message.timestamp = current_time.tv_sec * static_cast<int64_t>(1000000000)
// +
@@ -612,13 +612,13 @@
return false;
}
switch (key) {
- case avd::xk::Right:
- case avd::xk::F12:
+ case cvd::xk::Right:
+ case cvd::xk::F12:
DLOG(INFO) << "switching to portrait";
SetScreenOrientation(ScreenOrientation::Portrait);
break;
- case avd::xk::Left:
- case avd::xk::F11:
+ case cvd::xk::Left:
+ case cvd::xk::F11:
DLOG(INFO) << "switching to landscape";
SetScreenOrientation(ScreenOrientation::Landscape);
break;
@@ -637,18 +637,18 @@
auto key = uint32_tAt(&msg[3]);
bool key_down = msg[0];
switch (key) {
- case avd::xk::ControlLeft:
- case avd::xk::ControlRight:
+ case cvd::xk::ControlLeft:
+ case cvd::xk::ControlRight:
control_key_down_ = key_down;
break;
- case avd::xk::MetaLeft:
- case avd::xk::MetaRight:
+ case cvd::xk::MetaLeft:
+ case cvd::xk::MetaRight:
meta_key_down_ = key_down;
break;
- case avd::xk::F5:
- key = avd::xk::Menu;
+ case cvd::xk::F5:
+ key = cvd::xk::Menu;
break;
- case avd::xk::F7:
+ case cvd::xk::F7:
virtual_inputs_->PressPowerButton(key_down);
return;
default:
diff --git a/host/frontend/vnc_server/vnc_client_connection.h b/host/frontend/vnc_server/vnc_client_connection.h
index 75d9fe1..9b403bb 100644
--- a/host/frontend/vnc_server/vnc_client_connection.h
+++ b/host/frontend/vnc_server/vnc_client_connection.h
@@ -30,7 +30,7 @@
#include "host/frontend/vnc_server/virtual_inputs.h"
#include "host/frontend/vnc_server/vnc_utils.h"
-namespace avd {
+namespace cvd {
namespace vnc {
class VncClientConnection {
@@ -137,7 +137,7 @@
mutable std::mutex m_;
ClientSocket client_;
- avd::SharedFD sensor_event_hal_;
+ cvd::SharedFD sensor_event_hal_;
bool control_key_down_ = false;
bool meta_key_down_ = false;
VirtualInputs* virtual_inputs_{};
@@ -168,4 +168,4 @@
};
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/vnc_server.cpp b/host/frontend/vnc_server/vnc_server.cpp
index 150c38d..2c013af 100644
--- a/host/frontend/vnc_server/vnc_server.cpp
+++ b/host/frontend/vnc_server/vnc_server.cpp
@@ -25,7 +25,7 @@
#include "host/frontend/vnc_server/vnc_client_connection.h"
#include "host/frontend/vnc_server/vnc_utils.h"
-using avd::vnc::VncServer;
+using cvd::vnc::VncServer;
VncServer::VncServer(int port, bool aggressive)
: server_(port), frame_buffer_watcher_{&bb_}, aggressive_{aggressive} {}
diff --git a/host/frontend/vnc_server/vnc_server.h b/host/frontend/vnc_server/vnc_server.h
index 8fd26a7..7b50367 100644
--- a/host/frontend/vnc_server/vnc_server.h
+++ b/host/frontend/vnc_server/vnc_server.h
@@ -28,7 +28,7 @@
#include "host/frontend/vnc_server/vnc_client_connection.h"
#include "host/frontend/vnc_server/vnc_utils.h"
-namespace avd {
+namespace cvd {
namespace vnc {
class VncServer {
@@ -53,4 +53,4 @@
};
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/vnc_utils.cpp b/host/frontend/vnc_server/vnc_utils.cpp
index 78414fb..3832121 100644
--- a/host/frontend/vnc_server/vnc_utils.cpp
+++ b/host/frontend/vnc_server/vnc_utils.cpp
@@ -18,7 +18,7 @@
using vsoc::framebuffer::FBBroadcastRegionView;
-namespace avd {
+namespace cvd {
namespace vnc {
FBBroadcastRegionView* GetFBBroadcastRegionView() {
@@ -27,4 +27,4 @@
}
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/frontend/vnc_server/vnc_utils.h b/host/frontend/vnc_server/vnc_utils.h
index ff75a8b..5c88754 100644
--- a/host/frontend/vnc_server/vnc_utils.h
+++ b/host/frontend/vnc_server/vnc_utils.h
@@ -23,7 +23,7 @@
#include "common/vsoc/framebuffer/fb_bcast_region_view.h"
-namespace avd {
+namespace cvd {
namespace vnc {
// TODO(haining) when the hwcomposer gives a sequence number type, use that
@@ -83,4 +83,4 @@
}
} // namespace vnc
-} // namespace avd
+} // namespace cvd
diff --git a/host/libs/config/file_partition.cpp b/host/libs/config/file_partition.cpp
index fff1b8d..2ebe314 100644
--- a/host/libs/config/file_partition.cpp
+++ b/host/libs/config/file_partition.cpp
@@ -63,7 +63,7 @@
std::unique_ptr<FilePartition> FilePartition::ReuseExistingFile(
const std::string& path) {
- avd::SharedFD fd(avd::SharedFD::Open(path.c_str(), O_RDWR));
+ cvd::SharedFD fd(cvd::SharedFD::Open(path.c_str(), O_RDWR));
CHECK(fd->IsOpen()) << "Could not open file: " << path << ": "
<< fd->StrError();
@@ -74,7 +74,7 @@
std::unique_ptr<FilePartition> FilePartition::CreateNewFile(
const std::string& path, int size_mb) {
{
- avd::SharedFD fd(avd::SharedFD::Open(path.c_str(), O_CREAT | O_RDWR, 0600));
+ cvd::SharedFD fd(cvd::SharedFD::Open(path.c_str(), O_CREAT | O_RDWR, 0600));
CHECK(fd->IsOpen()) << "Could not open file: " << path << ": "
<< fd->StrError();
CHECK(fd->Truncate(size_mb << 20) == 0)
diff --git a/host/libs/ivserver/README.md b/host/libs/ivserver/README.md
index 5fe4300..ea1d2c2 100644
--- a/host/libs/ivserver/README.md
+++ b/host/libs/ivserver/README.md
@@ -1,6 +1,6 @@
## Overview
-This is the native ivshmem-server implementation catering to the GCE AVD
+This is the native ivshmem-server implementation catering to the GCE CVD
vSoC project.
We are breaking from the general philosophy of ivshmem-server inter-vm
diff --git a/host/libs/ivserver/hald_client.cc b/host/libs/ivserver/hald_client.cc
index f13adcf..6f2f6b8 100644
--- a/host/libs/ivserver/hald_client.cc
+++ b/host/libs/ivserver/hald_client.cc
@@ -27,7 +27,7 @@
} // anonymous namespace
std::unique_ptr<HaldClient> HaldClient::New(const VSoCSharedMemory& shmem,
- const avd::SharedFD& clientfd) {
+ const cvd::SharedFD& clientfd) {
std::unique_ptr<HaldClient> res;
if (!clientfd->IsOpen()) {
@@ -45,7 +45,7 @@
return res;
}
-HaldClient::HaldClient(const avd::SharedFD& client_socket)
+HaldClient::HaldClient(const cvd::SharedFD& client_socket)
: client_socket_(client_socket) {}
bool HaldClient::PerformHandshake(const VSoCSharedMemory& shared_mem) {
@@ -85,8 +85,8 @@
LOG(INFO) << "New HALD requesting region: " << region_name;
// Send Host, Guest and SharedMemory FDs associated with this region.
- avd::SharedFD guest_to_host_efd;
- avd::SharedFD host_to_guest_efd;
+ cvd::SharedFD guest_to_host_efd;
+ cvd::SharedFD host_to_guest_efd;
if (!shared_mem.GetEventFdPairForRegion(region_name, &guest_to_host_efd,
&host_to_guest_efd)) {
@@ -112,8 +112,8 @@
struct iovec vec {
&control_data, sizeof(control_data)
};
- avd::InbandMessageHeader hdr{nullptr, 0, &vec, 1, 0};
- avd::SharedFD fds[3] = {guest_to_host_efd, host_to_guest_efd,
+ cvd::InbandMessageHeader hdr{nullptr, 0, &vec, 1, 0};
+ cvd::SharedFD fds[3] = {guest_to_host_efd, host_to_guest_efd,
shared_mem.SharedMemFD()};
rval = client_socket_->SendMsgAndFDs<3>(hdr, MSG_NOSIGNAL, fds);
if (rval == -1) {
diff --git a/host/libs/ivserver/hald_client.h b/host/libs/ivserver/hald_client.h
index e8c1366..99b5fee 100644
--- a/host/libs/ivserver/hald_client.h
+++ b/host/libs/ivserver/hald_client.h
@@ -28,13 +28,13 @@
class HaldClient final {
public:
static std::unique_ptr<HaldClient> New(const VSoCSharedMemory &shared_mem,
- const avd::SharedFD &client_fd);
+ const cvd::SharedFD &client_fd);
private:
- avd::SharedFD client_socket_;
+ cvd::SharedFD client_socket_;
// Initialize new instance of HAL Client.
- HaldClient(const avd::SharedFD &client_fd);
+ HaldClient(const cvd::SharedFD &client_fd);
// Perform handshake with HAL Client.
// If the region is not found approprate status (-1) is sent.
diff --git a/host/libs/ivserver/hald_client_test.cc b/host/libs/ivserver/hald_client_test.cc
index 46d0a4e..c566079 100644
--- a/host/libs/ivserver/hald_client_test.cc
+++ b/host/libs/ivserver/hald_client_test.cc
@@ -43,12 +43,12 @@
<< "Could not create temp file";
LOG(INFO) << "Temp file location: " << socket_location;
- hald_server_socket_ = avd::SharedFD::SocketLocalServer(
+ hald_server_socket_ = cvd::SharedFD::SocketLocalServer(
socket_location.c_str(), false, SOCK_STREAM, 0666);
- test_socket_ = avd::SharedFD::SocketLocalClient(socket_location.c_str(),
+ test_socket_ = cvd::SharedFD::SocketLocalClient(socket_location.c_str(),
false, SOCK_STREAM);
hald_socket_ =
- avd::SharedFD::Accept(*hald_server_socket_, nullptr, nullptr);
+ cvd::SharedFD::Accept(*hald_server_socket_, nullptr, nullptr);
EXPECT_TRUE(hald_server_socket_->IsOpen());
EXPECT_TRUE(test_socket_->IsOpen());
@@ -79,9 +79,9 @@
protected:
::testing::NiceMock<VSoCSharedMemoryMock> vsoc_;
- avd::SharedFD hald_server_socket_;
- avd::SharedFD hald_socket_;
- avd::SharedFD test_socket_;
+ cvd::SharedFD hald_server_socket_;
+ cvd::SharedFD hald_socket_;
+ cvd::SharedFD test_socket_;
private:
std::vector<std::string> cleanup_files_;
@@ -122,18 +122,18 @@
TEST_F(HaldClientTest, FullSaneHandshake) {
std::string temp;
ASSERT_TRUE(GetTempLocation(&temp));
- avd::SharedFD host_fd(
- avd::SharedFD::Open(temp.c_str(), O_CREAT | O_RDWR, 0666));
+ cvd::SharedFD host_fd(
+ cvd::SharedFD::Open(temp.c_str(), O_CREAT | O_RDWR, 0666));
EXPECT_TRUE(host_fd->IsOpen());
ASSERT_TRUE(GetTempLocation(&temp));
- avd::SharedFD guest_fd(
- avd::SharedFD::Open(temp.c_str(), O_CREAT | O_RDWR, 0666));
+ cvd::SharedFD guest_fd(
+ cvd::SharedFD::Open(temp.c_str(), O_CREAT | O_RDWR, 0666));
EXPECT_TRUE(guest_fd->IsOpen());
ASSERT_TRUE(GetTempLocation(&temp));
- avd::SharedFD shmem_fd(
- avd::SharedFD::Open(temp.c_str(), O_CREAT | O_RDWR, 0666));
+ cvd::SharedFD shmem_fd(
+ cvd::SharedFD::Open(temp.c_str(), O_CREAT | O_RDWR, 0666));
EXPECT_TRUE(shmem_fd->IsOpen());
const std::string test_location("testing");
@@ -163,8 +163,8 @@
struct iovec vec {
&control_data, sizeof(control_data)
};
- avd::InbandMessageHeader hdr{nullptr, 0, &vec, 1, 0};
- avd::SharedFD fds[3];
+ cvd::InbandMessageHeader hdr{nullptr, 0, &vec, 1, 0};
+ cvd::SharedFD fds[3];
EXPECT_GT(test_socket_->RecvMsgAndFDs<3>(hdr, MSG_NOSIGNAL, &fds), 0);
EXPECT_TRUE(fds[0]->IsOpen());
diff --git a/host/libs/ivserver/ivserver.cc b/host/libs/ivserver/ivserver.cc
index c074ecc..d966764 100644
--- a/host/libs/ivserver/ivserver.cc
+++ b/host/libs/ivserver/ivserver.cc
@@ -32,7 +32,7 @@
LOG_IF(WARNING, unlink(options.qemu_socket_path.c_str()) == 0)
<< "Removed existing unix socket: " << options.qemu_socket_path
<< ". We can't confirm yet whether another instance is running.";
- qemu_channel_ = avd::SharedFD::SocketLocalServer(
+ qemu_channel_ = cvd::SharedFD::SocketLocalServer(
options.qemu_socket_path.c_str(), false, SOCK_STREAM, 0666);
LOG_IF(FATAL, !qemu_channel_->IsOpen())
<< "Could not create QEmu channel: " << qemu_channel_->StrError();
@@ -40,7 +40,7 @@
LOG_IF(WARNING, unlink(options.client_socket_path.c_str()) == 0)
<< "Removed existing unix socket: " << options.client_socket_path
<< ". We can't confirm yet whether another instance is running.";
- client_channel_ = avd::SharedFD::SocketLocalServer(
+ client_channel_ = cvd::SharedFD::SocketLocalServer(
options.client_socket_path.c_str(), false, SOCK_STREAM, 0666);
LOG_IF(FATAL, !client_channel_->IsOpen())
<< "Could not create Client channel: " << client_channel_->StrError();
@@ -48,10 +48,10 @@
void IVServer::Serve() {
while (true) {
- avd::SharedFDSet rset;
+ cvd::SharedFDSet rset;
rset.Set(qemu_channel_);
rset.Set(client_channel_);
- avd::Select(&rset, nullptr, nullptr, nullptr);
+ cvd::Select(&rset, nullptr, nullptr, nullptr);
if (rset.IsSet(qemu_channel_)) {
HandleNewQemuConnection();
@@ -67,7 +67,7 @@
void IVServer::HandleNewClientConnection() {
std::unique_ptr<HaldClient> res = HaldClient::New(
- *vsoc_shmem_, avd::SharedFD::Accept(*client_channel_, nullptr, nullptr));
+ *vsoc_shmem_, cvd::SharedFD::Accept(*client_channel_, nullptr, nullptr));
if (!res) {
LOG(WARNING) << "Rejecting unsuccessful HALD connection.";
}
@@ -75,7 +75,7 @@
void IVServer::HandleNewQemuConnection() {
std::unique_ptr<QemuClient> res = QemuClient::New(
- *vsoc_shmem_, avd::SharedFD::Accept(*qemu_channel_, nullptr, nullptr));
+ *vsoc_shmem_, cvd::SharedFD::Accept(*qemu_channel_, nullptr, nullptr));
if (!res) {
LOG(WARNING) << "Could not accept new QEmu client.";
diff --git a/host/libs/ivserver/ivserver.h b/host/libs/ivserver/ivserver.h
index 57e5623..ad32d81 100644
--- a/host/libs/ivserver/ivserver.h
+++ b/host/libs/ivserver/ivserver.h
@@ -41,8 +41,8 @@
const Json::Value &json_root_;
std::unique_ptr<VSoCSharedMemory> vsoc_shmem_;
- avd::SharedFD qemu_channel_;
- avd::SharedFD client_channel_;
+ cvd::SharedFD qemu_channel_;
+ cvd::SharedFD client_channel_;
};
} // namespace ivserver
diff --git a/host/libs/ivserver/qemu_client.cc b/host/libs/ivserver/qemu_client.cc
index 37e3835..2771e06 100644
--- a/host/libs/ivserver/qemu_client.cc
+++ b/host/libs/ivserver/qemu_client.cc
@@ -20,7 +20,7 @@
namespace ivserver {
std::unique_ptr<QemuClient> QemuClient::New(const VSoCSharedMemory& shmem,
- const avd::SharedFD& socket) {
+ const cvd::SharedFD& socket) {
std::unique_ptr<QemuClient> res;
if (!socket->IsOpen()) {
LOG(WARNING) << "Invalid socket passed to QemuClient: "
@@ -37,7 +37,7 @@
return res;
}
-QemuClient::QemuClient(avd::SharedFD socket) : client_socket_(socket) {}
+QemuClient::QemuClient(cvd::SharedFD socket) : client_socket_(socket) {}
// Once the QemuClient object is constructed, invoking the following
// method will perform the actual handshake with a QEMU instance.
@@ -105,12 +105,12 @@
}
bool QemuClient::SendSocketInfo(QemuFDMsg message,
- const avd::SharedFD& socket) {
+ const cvd::SharedFD& socket) {
struct iovec vec {
&message, sizeof(message)
};
- avd::InbandMessageHeader hdr{nullptr, 0, &vec, 1, 0};
- avd::SharedFD fds[] = {socket};
+ cvd::InbandMessageHeader hdr{nullptr, 0, &vec, 1, 0};
+ cvd::SharedFD fds[] = {socket};
int rval = client_socket_->SendMsgAndFDs(hdr, 0, fds);
if (rval == -1) {
LOG(ERROR) << "failed to send shared_mem_fd: "
diff --git a/host/libs/ivserver/qemu_client.h b/host/libs/ivserver/qemu_client.h
index d3363da..658b42c 100644
--- a/host/libs/ivserver/qemu_client.h
+++ b/host/libs/ivserver/qemu_client.h
@@ -30,9 +30,9 @@
class QemuClient final {
public:
static std::unique_ptr<QemuClient> New(const VSoCSharedMemory &shmem,
- const avd::SharedFD &connection);
+ const cvd::SharedFD &connection);
- avd::SharedFD client_socket() const { return client_socket_; }
+ cvd::SharedFD client_socket() const { return client_socket_; }
private:
enum QemuConstants : int64_t {
@@ -60,17 +60,17 @@
kGuestSideHal = QemuConstants::kGuestID,
};
- avd::SharedFD client_socket_;
+ cvd::SharedFD client_socket_;
// Initialize new instance of QemuClient.
- QemuClient(avd::SharedFD qemu_listener_socket);
+ QemuClient(cvd::SharedFD qemu_listener_socket);
// Once the QemuClient object is constructed, invoking the following
// method will perform the actual handshake with a QEMU instance.
bool PerformHandshake(const VSoCSharedMemory &shmem_fd);
// Send socket data to Qemu.
- bool SendSocketInfo(QemuFDMsg message, const avd::SharedFD &socket);
+ bool SendSocketInfo(QemuFDMsg message, const cvd::SharedFD &socket);
QemuClient(const QemuClient &) = delete;
QemuClient &operator=(const QemuClient &) = delete;
diff --git a/host/libs/ivserver/vsocsharedmem.cc b/host/libs/ivserver/vsocsharedmem.cc
index deaf821..9714d23 100644
--- a/host/libs/ivserver/vsocsharedmem.cc
+++ b/host/libs/ivserver/vsocsharedmem.cc
@@ -91,10 +91,10 @@
const std::string &path);
bool GetEventFdPairForRegion(const std::string ®ion_name,
- avd::SharedFD *guest_to_host,
- avd::SharedFD *host_to_guest) const override;
+ cvd::SharedFD *guest_to_host,
+ cvd::SharedFD *host_to_guest) const override;
- const avd::SharedFD &SharedMemFD() const override;
+ const cvd::SharedFD &SharedMemFD() const override;
const std::vector<Region> &Regions() const override;
@@ -102,7 +102,7 @@
void CreateLayout();
const vsoc_shm_layout_descriptor &header_;
- avd::SharedFD shared_mem_fd_;
+ cvd::SharedFD shared_mem_fd_;
const std::map<std::string, size_t> region_name_to_index_;
const std::vector<Region> region_data_;
@@ -122,7 +122,7 @@
LOG_IF(WARNING, unlink(path.c_str()) == 0)
<< "Removed existing instance of " << path
<< ". We currently don't know if another instance of daemon is running";
- shared_mem_fd_ = avd::SharedFD::Open(path.c_str(), O_RDWR | O_CREAT | O_EXCL,
+ shared_mem_fd_ = cvd::SharedFD::Open(path.c_str(), O_RDWR | O_CREAT | O_EXCL,
S_IRUSR | S_IWUSR);
LOG_IF(FATAL, !shared_mem_fd_->IsOpen())
<< "Error in creating shared_memory file: " << shared_mem_fd_->StrError();
@@ -134,7 +134,7 @@
CreateLayout();
}
-const avd::SharedFD &VSoCSharedMemoryImpl::SharedMemFD() const {
+const cvd::SharedFD &VSoCSharedMemoryImpl::SharedMemFD() const {
return shared_mem_fd_;
}
@@ -159,8 +159,8 @@
}
bool VSoCSharedMemoryImpl::GetEventFdPairForRegion(
- const std::string ®ion_name, avd::SharedFD *guest_to_host,
- avd::SharedFD *host_to_guest) const {
+ const std::string ®ion_name, cvd::SharedFD *guest_to_host,
+ cvd::SharedFD *host_to_guest) const {
auto it = region_name_to_index_.find(region_name);
if (it == region_name_to_index_.end()) return false;
@@ -274,13 +274,13 @@
// Create one pair of eventfds for this region. Note that the guest to host
// eventfd is non-blocking, whereas the host to guest eventfd is blocking.
// This is in anticipation of blocking semantics for the host side locks.
- region->host_fd = avd::SharedFD::Event(0, EFD_NONBLOCK);
+ region->host_fd = cvd::SharedFD::Event(0, EFD_NONBLOCK);
if (!region->host_fd->IsOpen()) {
failed = true;
LOG(ERROR) << "Failed to create host eventfd for " << device_name << ": "
<< region->host_fd->StrError();
}
- region->guest_fd = avd::SharedFD::Event(0, EFD_NONBLOCK);
+ region->guest_fd = cvd::SharedFD::Event(0, EFD_NONBLOCK);
if (!region->guest_fd->IsOpen()) {
failed = true;
LOG(ERROR) << "Failed to create guest eventfd for " << device_name << ": "
diff --git a/host/libs/ivserver/vsocsharedmem.h b/host/libs/ivserver/vsocsharedmem.h
index 4da6435..1edab05 100644
--- a/host/libs/ivserver/vsocsharedmem.h
+++ b/host/libs/ivserver/vsocsharedmem.h
@@ -31,8 +31,8 @@
// Region describes a VSoCSharedMem region.
struct Region {
vsoc_device_region values{};
- avd::SharedFD host_fd;
- avd::SharedFD guest_fd;
+ cvd::SharedFD host_fd;
+ cvd::SharedFD guest_fd;
};
// Max name length of a memory region.
@@ -45,10 +45,10 @@
const Json::Value &json_root);
virtual bool GetEventFdPairForRegion(const std::string ®ion_name,
- avd::SharedFD *guest_to_host,
- avd::SharedFD *host_to_guest) const = 0;
+ cvd::SharedFD *guest_to_host,
+ cvd::SharedFD *host_to_guest) const = 0;
- virtual const avd::SharedFD &SharedMemFD() const = 0;
+ virtual const cvd::SharedFD &SharedMemFD() const = 0;
virtual const std::vector<Region> &Regions() const = 0;
private:
diff --git a/host/libs/ivserver/vsocsharedmem_mock.h b/host/libs/ivserver/vsocsharedmem_mock.h
index ef5d8e9..5ce64ae 100644
--- a/host/libs/ivserver/vsocsharedmem_mock.h
+++ b/host/libs/ivserver/vsocsharedmem_mock.h
@@ -24,8 +24,8 @@
class VSoCSharedMemoryMock : public VSoCSharedMemory {
public:
MOCK_CONST_METHOD3(GetEventFdPairForRegion,
- bool(const std::string&, avd::SharedFD*, avd::SharedFD*));
- MOCK_CONST_METHOD0(SharedMemFD, const avd::SharedFD&());
+ bool(const std::string&, cvd::SharedFD*, cvd::SharedFD*));
+ MOCK_CONST_METHOD0(SharedMemFD, const cvd::SharedFD&());
MOCK_CONST_METHOD0(Regions,
const std::vector<VSoCSharedMemory::Region>&());
};
diff --git a/host/libs/usbip/client.cpp b/host/libs/usbip/client.cpp
index 2e8ee0e..7860f24 100644
--- a/host/libs/usbip/client.cpp
+++ b/host/libs/usbip/client.cpp
@@ -24,11 +24,11 @@
namespace vadb {
namespace usbip {
-void Client::BeforeSelect(avd::SharedFDSet* fd_read) const {
+void Client::BeforeSelect(cvd::SharedFDSet* fd_read) const {
fd_read->Set(fd_);
}
-bool Client::AfterSelect(const avd::SharedFDSet& fd_read) {
+bool Client::AfterSelect(const cvd::SharedFDSet& fd_read) {
if (fd_read.IsSet(fd_)) return HandleIncomingMessage();
return true;
}
diff --git a/host/libs/usbip/client.h b/host/libs/usbip/client.h
index c0704a1..ae2cff2 100644
--- a/host/libs/usbip/client.h
+++ b/host/libs/usbip/client.h
@@ -28,19 +28,19 @@
// connection at the time.
class Client final {
public:
- Client(const DevicePool& pool, const avd::SharedFD& fd)
+ Client(const DevicePool& pool, const cvd::SharedFD& fd)
: pool_(pool), fd_(fd) {}
~Client() {}
// BeforeSelect is Called right before Select() to populate interesting
// SharedFDs.
- void BeforeSelect(avd::SharedFDSet* fd_read) const;
+ void BeforeSelect(cvd::SharedFDSet* fd_read) const;
// AfterSelect is Called right after Select() to detect and respond to changes
// on affected SharedFDs.
// Return value indicates whether this client is still valid.
- bool AfterSelect(const avd::SharedFDSet& fd_read);
+ bool AfterSelect(const cvd::SharedFDSet& fd_read);
private:
// Respond to message from remote client.
@@ -62,7 +62,7 @@
bool HandleUnlinkCmd(const CmdHeader& hdr);
const DevicePool& pool_;
- avd::SharedFD fd_;
+ cvd::SharedFD fd_;
Client(const Client&) = delete;
Client& operator=(const Client&) = delete;
diff --git a/host/libs/usbip/messages.h b/host/libs/usbip/messages.h
index 6bf8651..8941df1 100644
--- a/host/libs/usbip/messages.h
+++ b/host/libs/usbip/messages.h
@@ -36,7 +36,7 @@
// Accept data by value and modify it to match net endian locally.
// Returns true, if message was sent successfully.
template <typename T>
-bool SendUSBIPMsg(const avd::SharedFD& fd, T data) {
+bool SendUSBIPMsg(const cvd::SharedFD& fd, T data) {
internal::HostToNet(&data);
return fd->Send(&data, sizeof(T), MSG_NOSIGNAL) == sizeof(T);
}
@@ -45,7 +45,7 @@
// After message is received, it's updated to match host endian.
// Returns true, if message was received successfully.
template <typename T>
-bool RecvUSBIPMsg(const avd::SharedFD& fd, T* data) {
+bool RecvUSBIPMsg(const cvd::SharedFD& fd, T* data) {
bool res = fd->Recv(data, sizeof(T), MSG_NOSIGNAL) == sizeof(T);
if (res) {
internal::NetToHost(data);
diff --git a/host/libs/usbip/server.cpp b/host/libs/usbip/server.cpp
index 299da22..bada417 100644
--- a/host/libs/usbip/server.cpp
+++ b/host/libs/usbip/server.cpp
@@ -20,7 +20,7 @@
#include <netinet/in.h>
#include "common/libs/fs/shared_select.h"
-using avd::SharedFD;
+using cvd::SharedFD;
namespace vadb {
namespace usbip {
@@ -42,12 +42,12 @@
return true;
}
-void Server::BeforeSelect(avd::SharedFDSet* fd_read) const {
+void Server::BeforeSelect(cvd::SharedFDSet* fd_read) const {
fd_read->Set(server_);
for (const auto& client : clients_) client.BeforeSelect(fd_read);
}
-void Server::AfterSelect(const avd::SharedFDSet& fd_read) {
+void Server::AfterSelect(const cvd::SharedFDSet& fd_read) {
if (fd_read.IsSet(server_)) HandleIncomingConnection();
for (auto iter = clients_.begin(); iter != clients_.end();) {
diff --git a/host/libs/usbip/server.h b/host/libs/usbip/server.h
index 6413617..ec47e43 100644
--- a/host/libs/usbip/server.h
+++ b/host/libs/usbip/server.h
@@ -36,11 +36,11 @@
// BeforeSelect is Called right before Select() to populate interesting
// SharedFDs.
- void BeforeSelect(avd::SharedFDSet* fd_read) const;
+ void BeforeSelect(cvd::SharedFDSet* fd_read) const;
// AfterSelect is Called right after Select() to detect and respond to changes
// on affected SharedFDs.
- void AfterSelect(const avd::SharedFDSet& fd_read);
+ void AfterSelect(const cvd::SharedFDSet& fd_read);
private:
// Create USBIP server socket.
@@ -52,7 +52,7 @@
void HandleIncomingConnection();
std::string name_;
- avd::SharedFD server_;
+ cvd::SharedFD server_;
std::list<Client> clients_;
const DevicePool& device_pool_;
diff --git a/host/libs/usbip/vhci_instrument.cpp b/host/libs/usbip/vhci_instrument.cpp
index 53bdf3b..179d6c5 100644
--- a/host/libs/usbip/vhci_instrument.cpp
+++ b/host/libs/usbip/vhci_instrument.cpp
@@ -86,7 +86,7 @@
}
bool VHCIInstrument::Init() {
- avd::SharedFD::Pipe(&control_read_end_, &control_write_end_);
+ cvd::SharedFD::Pipe(&control_read_end_, &control_write_end_);
struct stat buf;
for (const auto* path : kVHCIPlatformPaths) {
@@ -149,7 +149,7 @@
}
void VHCIInstrument::AttachThread() {
- avd::SharedFD epoll = avd::SharedFD::Epoll();
+ cvd::SharedFD epoll = cvd::SharedFD::Epoll();
// Trigger attach upon start.
bool want_attach = true;
// Operation is pending on read.
@@ -180,7 +180,7 @@
LOG(INFO) << (want_attach ? "Attach" : "Detach") << " triggered.";
break;
case kVHCIEvent:
- vhci_socket_ = avd::SharedFD();
+ vhci_socket_ = cvd::SharedFD();
// Only re-establish VHCI if it was already established before.
is_pending = want_attach;
// Do not immediately fall into attach cycle. It will likely complete
@@ -220,7 +220,7 @@
bool VHCIInstrument::Attach() {
if (!vhci_socket_->IsOpen()) {
vhci_socket_ =
- avd::SharedFD::SocketLocalClient(name_.c_str(), true, SOCK_STREAM);
+ cvd::SharedFD::SocketLocalClient(name_.c_str(), true, SOCK_STREAM);
if (!vhci_socket_->IsOpen()) return false;
}
diff --git a/host/libs/usbip/vhci_instrument.h b/host/libs/usbip/vhci_instrument.h
index 9fa5ece..ccb641e 100644
--- a/host/libs/usbip/vhci_instrument.h
+++ b/host/libs/usbip/vhci_instrument.h
@@ -60,9 +60,9 @@
std::string name_;
std::unique_ptr<std::thread> attach_thread_;
std::string syspath_;
- avd::SharedFD control_write_end_;
- avd::SharedFD control_read_end_;
- avd::SharedFD vhci_socket_;
+ cvd::SharedFD control_write_end_;
+ cvd::SharedFD control_read_end_;
+ cvd::SharedFD vhci_socket_;
int port_;
VHCIInstrument(const VHCIInstrument& other) = delete;
diff --git a/host/libs/vadb/usb_cmd.h b/host/libs/vadb/usb_cmd.h
index 9090f20..7039fbe 100644
--- a/host/libs/vadb/usb_cmd.h
+++ b/host/libs/vadb/usb_cmd.h
@@ -47,13 +47,13 @@
// (other than RequestHeader) should be sent.
// Returns false, if communication with remote host failed (and should be
// terminated).
- virtual bool OnRequest(const avd::SharedFD& data) = 0;
+ virtual bool OnRequest(const cvd::SharedFD& data) = 0;
// OnResponse is called whenever additional data relevant to this command
// (other than ResponseHeader) should be received.
// Returns false, if communication with remote host failed (and should be
// terminated).
- virtual bool OnResponse(bool is_success, const avd::SharedFD& data) = 0;
+ virtual bool OnResponse(bool is_success, const cvd::SharedFD& data) = 0;
private:
USBCommand(const USBCommand& other) = delete;
diff --git a/host/libs/vadb/usb_cmd_attach.cpp b/host/libs/vadb/usb_cmd_attach.cpp
index af4f1a5..02ade80 100644
--- a/host/libs/vadb/usb_cmd_attach.cpp
+++ b/host/libs/vadb/usb_cmd_attach.cpp
@@ -19,7 +19,7 @@
#include "host/libs/vadb/usb_cmd_attach.h"
namespace vadb {
-bool USBCmdAttach::OnRequest(const avd::SharedFD& fd) {
+bool USBCmdAttach::OnRequest(const cvd::SharedFD& fd) {
if (fd->Write(&req_, sizeof(req_)) != sizeof(req_)) {
LOG(ERROR) << "Short write: " << fd->StrError();
return false;
@@ -27,7 +27,7 @@
return true;
}
-bool USBCmdAttach::OnResponse(bool is_success, const avd::SharedFD& data) {
+bool USBCmdAttach::OnResponse(bool is_success, const cvd::SharedFD& data) {
if (!is_success) return false;
LOG(INFO) << "Attach successful.";
return true;
diff --git a/host/libs/vadb/usb_cmd_attach.h b/host/libs/vadb/usb_cmd_attach.h
index c814b90..9cdd89e 100644
--- a/host/libs/vadb/usb_cmd_attach.h
+++ b/host/libs/vadb/usb_cmd_attach.h
@@ -29,11 +29,11 @@
// Send request body to the server.
// Return false, if communication failed.
- bool OnRequest(const avd::SharedFD& data) override;
+ bool OnRequest(const cvd::SharedFD& data) override;
// Receive response data from the server.
// Return false, if communication failed.
- bool OnResponse(bool is_success, const avd::SharedFD& data) override;
+ bool OnResponse(bool is_success, const cvd::SharedFD& data) override;
private:
usb_forward::AttachRequest req_;
diff --git a/host/libs/vadb/usb_cmd_control_transfer.cpp b/host/libs/vadb/usb_cmd_control_transfer.cpp
index 2d8ce5c..643d416 100644
--- a/host/libs/vadb/usb_cmd_control_transfer.cpp
+++ b/host/libs/vadb/usb_cmd_control_transfer.cpp
@@ -33,7 +33,7 @@
req_.timeout = timeout;
}
-bool USBCmdControlTransfer::OnRequest(const avd::SharedFD& fd) {
+bool USBCmdControlTransfer::OnRequest(const cvd::SharedFD& fd) {
if (fd->Write(&req_, sizeof(req_)) != sizeof(req_)) {
LOG(ERROR) << "Short write: " << fd->StrError();
return false;
@@ -52,7 +52,7 @@
}
bool USBCmdControlTransfer::OnResponse(bool is_success,
- const avd::SharedFD& fd) {
+ const cvd::SharedFD& fd) {
if (!is_success) {
callback_(false, std::move(data_));
return true;
diff --git a/host/libs/vadb/usb_cmd_control_transfer.h b/host/libs/vadb/usb_cmd_control_transfer.h
index 7723de6..74607d0 100644
--- a/host/libs/vadb/usb_cmd_control_transfer.h
+++ b/host/libs/vadb/usb_cmd_control_transfer.h
@@ -41,11 +41,11 @@
// Send request body to the server.
// Return false, if communication failed.
- bool OnRequest(const avd::SharedFD& data) override;
+ bool OnRequest(const cvd::SharedFD& data) override;
// Receive response data from the server.
// Return false, if communication failed.
- bool OnResponse(bool is_success, const avd::SharedFD& data) override;
+ bool OnResponse(bool is_success, const cvd::SharedFD& data) override;
private:
usb_forward::ControlTransfer req_;
diff --git a/host/libs/vadb/usb_cmd_data_transfer.cpp b/host/libs/vadb/usb_cmd_data_transfer.cpp
index 5c8031d..7503374 100644
--- a/host/libs/vadb/usb_cmd_data_transfer.cpp
+++ b/host/libs/vadb/usb_cmd_data_transfer.cpp
@@ -31,7 +31,7 @@
req_.timeout = deadline;
}
-bool USBCmdDataTransfer::OnRequest(const avd::SharedFD& fd) {
+bool USBCmdDataTransfer::OnRequest(const cvd::SharedFD& fd) {
if (fd->Write(&req_, sizeof(req_)) != sizeof(req_)) {
LOG(ERROR) << "Short write: " << fd->StrError();
return false;
@@ -47,7 +47,7 @@
return true;
}
-bool USBCmdDataTransfer::OnResponse(bool is_success, const avd::SharedFD& fd) {
+bool USBCmdDataTransfer::OnResponse(bool is_success, const cvd::SharedFD& fd) {
if (!is_success) {
callback_(false, std::move(data_));
return true;
diff --git a/host/libs/vadb/usb_cmd_data_transfer.h b/host/libs/vadb/usb_cmd_data_transfer.h
index 5cb3cb3..8cba30f 100644
--- a/host/libs/vadb/usb_cmd_data_transfer.h
+++ b/host/libs/vadb/usb_cmd_data_transfer.h
@@ -40,11 +40,11 @@
// Send request body to the server.
// Return false, if communication failed.
- bool OnRequest(const avd::SharedFD& data) override;
+ bool OnRequest(const cvd::SharedFD& data) override;
// Receive response data from the server.
// Return false, if communication failed.
- bool OnResponse(bool is_success, const avd::SharedFD& data) override;
+ bool OnResponse(bool is_success, const cvd::SharedFD& data) override;
private:
usb_forward::DataTransfer req_;
diff --git a/host/libs/vadb/usb_cmd_device_list.cpp b/host/libs/vadb/usb_cmd_device_list.cpp
index 4fb514e..ce561de 100644
--- a/host/libs/vadb/usb_cmd_device_list.cpp
+++ b/host/libs/vadb/usb_cmd_device_list.cpp
@@ -18,13 +18,13 @@
#include "host/libs/vadb/usb_cmd_device_list.h"
namespace vadb {
-bool USBCmdDeviceList::OnRequest(const avd::SharedFD& data) {
+bool USBCmdDeviceList::OnRequest(const cvd::SharedFD& data) {
LOG(INFO) << "Requesting device list from Cuttlefish...";
// No action required.
return true;
}
-bool USBCmdDeviceList::OnResponse(bool is_success, const avd::SharedFD& fd) {
+bool USBCmdDeviceList::OnResponse(bool is_success, const cvd::SharedFD& fd) {
// This should never happen. If this command fails, something is very wrong.
if (!is_success) return false;
diff --git a/host/libs/vadb/usb_cmd_device_list.h b/host/libs/vadb/usb_cmd_device_list.h
index 9438b7b..2972ed2 100644
--- a/host/libs/vadb/usb_cmd_device_list.h
+++ b/host/libs/vadb/usb_cmd_device_list.h
@@ -40,11 +40,11 @@
// Send request body to the server.
// Return false, if communication failed.
- bool OnRequest(const avd::SharedFD& data) override;
+ bool OnRequest(const cvd::SharedFD& data) override;
// Receive response data from the server.
// Return false, if communication failed.
- bool OnResponse(bool is_success, const avd::SharedFD& data) override;
+ bool OnResponse(bool is_success, const cvd::SharedFD& data) override;
private:
DeviceDiscoveredCB on_device_discovered_;
diff --git a/host/libs/vadb/usb_cmd_heartbeat.cpp b/host/libs/vadb/usb_cmd_heartbeat.cpp
index f2d3b48..59138bc 100644
--- a/host/libs/vadb/usb_cmd_heartbeat.cpp
+++ b/host/libs/vadb/usb_cmd_heartbeat.cpp
@@ -19,9 +19,9 @@
#include "host/libs/vadb/usb_cmd_heartbeat.h"
namespace vadb {
-bool USBCmdHeartbeat::OnRequest(const avd::SharedFD& fd) { return true; }
+bool USBCmdHeartbeat::OnRequest(const cvd::SharedFD& fd) { return true; }
-bool USBCmdHeartbeat::OnResponse(bool is_success, const avd::SharedFD& data) {
+bool USBCmdHeartbeat::OnResponse(bool is_success, const cvd::SharedFD& data) {
callback_(is_success);
return true;
}
diff --git a/host/libs/vadb/usb_cmd_heartbeat.h b/host/libs/vadb/usb_cmd_heartbeat.h
index 6d6a586..e0bc20e 100644
--- a/host/libs/vadb/usb_cmd_heartbeat.h
+++ b/host/libs/vadb/usb_cmd_heartbeat.h
@@ -33,11 +33,11 @@
// Send request body to the server.
// Return false, if communication failed.
- bool OnRequest(const avd::SharedFD& data) override;
+ bool OnRequest(const cvd::SharedFD& data) override;
// Receive response data from the server.
// Return false, if communication failed.
- bool OnResponse(bool is_success, const avd::SharedFD& data) override;
+ bool OnResponse(bool is_success, const cvd::SharedFD& data) override;
private:
HeartbeatResultCB callback_;
diff --git a/host/libs/vadb/virtual_adb_client.cpp b/host/libs/vadb/virtual_adb_client.cpp
index 3abf93a..71a5c73 100644
--- a/host/libs/vadb/virtual_adb_client.cpp
+++ b/host/libs/vadb/virtual_adb_client.cpp
@@ -34,11 +34,11 @@
constexpr int kHeartbeatTimeoutSeconds = 3;
} // namespace
-VirtualADBClient::VirtualADBClient(usbip::DevicePool* pool, avd::SharedFD fd,
+VirtualADBClient::VirtualADBClient(usbip::DevicePool* pool, cvd::SharedFD fd,
const std::string& usbip_socket_name)
: pool_{pool}, fd_{fd}, vhci_{usbip_socket_name} {
CHECK(vhci_.Init());
- timer_ = avd::SharedFD::TimerFD(CLOCK_MONOTONIC, 0);
+ timer_ = cvd::SharedFD::TimerFD(CLOCK_MONOTONIC, 0);
SendHeartbeat();
}
@@ -191,7 +191,7 @@
// BeforeSelect is Called right before Select() to populate interesting
// SharedFDs.
-void VirtualADBClient::BeforeSelect(avd::SharedFDSet* fd_read) const {
+void VirtualADBClient::BeforeSelect(cvd::SharedFDSet* fd_read) const {
fd_read->Set(fd_);
fd_read->Set(timer_);
}
@@ -199,7 +199,7 @@
// AfterSelect is Called right after Select() to detect and respond to changes
// on affected SharedFDs.
// Return value indicates whether this client is still valid.
-bool VirtualADBClient::AfterSelect(const avd::SharedFDSet& fd_read) {
+bool VirtualADBClient::AfterSelect(const cvd::SharedFDSet& fd_read) {
if (fd_read.IsSet(timer_)) {
HandleHeartbeatTimeout();
}
diff --git a/host/libs/vadb/virtual_adb_client.h b/host/libs/vadb/virtual_adb_client.h
index e1c9813..d521c74 100644
--- a/host/libs/vadb/virtual_adb_client.h
+++ b/host/libs/vadb/virtual_adb_client.h
@@ -35,7 +35,7 @@
// remote USB devices possible with help of USB/IP protocol.
class VirtualADBClient {
public:
- VirtualADBClient(usbip::DevicePool* pool, avd::SharedFD fd,
+ VirtualADBClient(usbip::DevicePool* pool, cvd::SharedFD fd,
const std::string& usbip_socket_name);
virtual ~VirtualADBClient() = default;
@@ -45,12 +45,12 @@
// BeforeSelect is Called right before Select() to populate interesting
// SharedFDs.
- void BeforeSelect(avd::SharedFDSet* fd_read) const;
+ void BeforeSelect(cvd::SharedFDSet* fd_read) const;
// AfterSelect is Called right after Select() to detect and respond to changes
// on affected SharedFDs.
// Return value indicates whether this client is still valid.
- bool AfterSelect(const avd::SharedFDSet& fd_read);
+ bool AfterSelect(const cvd::SharedFDSet& fd_read);
private:
// Register new device in a device pool.
@@ -90,8 +90,8 @@
bool ExecuteCommand(std::unique_ptr<USBCommand> cmd);
usbip::DevicePool* pool_;
- avd::SharedFD fd_;
- avd::SharedFD timer_;
+ cvd::SharedFD fd_;
+ cvd::SharedFD timer_;
usbip::VHCIInstrument vhci_;
bool is_remote_server_ready_ = false;
diff --git a/host/libs/vadb/virtual_adb_server.cpp b/host/libs/vadb/virtual_adb_server.cpp
index 92fabd3..63283e1 100644
--- a/host/libs/vadb/virtual_adb_server.cpp
+++ b/host/libs/vadb/virtual_adb_server.cpp
@@ -22,7 +22,7 @@
LOG(INFO) << "Starting server socket: " << name_;
server_ =
- avd::SharedFD::SocketLocalServer(name_.c_str(), false, SOCK_STREAM, 0666);
+ cvd::SharedFD::SocketLocalServer(name_.c_str(), false, SOCK_STREAM, 0666);
if (!server_->IsOpen()) {
LOG(ERROR) << "Could not create socket: " << server_->StrError();
return false;
@@ -30,12 +30,12 @@
return true;
}
-void VirtualADBServer::BeforeSelect(avd::SharedFDSet* fd_read) const {
+void VirtualADBServer::BeforeSelect(cvd::SharedFDSet* fd_read) const {
fd_read->Set(server_);
for (const auto& client : clients_) client.BeforeSelect(fd_read);
}
-void VirtualADBServer::AfterSelect(const avd::SharedFDSet& fd_read) {
+void VirtualADBServer::AfterSelect(const cvd::SharedFDSet& fd_read) {
if (fd_read.IsSet(server_)) HandleIncomingConnection();
for (auto iter = clients_.begin(); iter != clients_.end();) {
@@ -52,7 +52,7 @@
// Typically we will have no more than one QEmu connection, but the nature
// of server requires proper handling nonetheless.
void VirtualADBServer::HandleIncomingConnection() {
- avd::SharedFD client = avd::SharedFD::Accept(*server_, nullptr, nullptr);
+ cvd::SharedFD client = cvd::SharedFD::Accept(*server_, nullptr, nullptr);
if (!client->IsOpen()) {
LOG(ERROR) << "Client connection failed: " << client->StrError();
return;
diff --git a/host/libs/vadb/virtual_adb_server.h b/host/libs/vadb/virtual_adb_server.h
index 33946c3..d679a5d 100644
--- a/host/libs/vadb/virtual_adb_server.h
+++ b/host/libs/vadb/virtual_adb_server.h
@@ -41,11 +41,11 @@
// BeforeSelect is Called right before Select() to populate interesting
// SharedFDs.
- void BeforeSelect(avd::SharedFDSet* fd_read) const;
+ void BeforeSelect(cvd::SharedFDSet* fd_read) const;
// AfterSelect is Called right after Select() to detect and respond to changes
// on affected SharedFDs.
- void AfterSelect(const avd::SharedFDSet& fd_read);
+ void AfterSelect(const cvd::SharedFDSet& fd_read);
private:
void HandleIncomingConnection();
@@ -53,7 +53,7 @@
usbip::DevicePool pool_;
std::string name_;
std::string usbip_name_;
- avd::SharedFD server_;
+ cvd::SharedFD server_;
std::list<VirtualADBClient> clients_;
VirtualADBServer(const VirtualADBServer&) = delete;
diff --git a/host/vsoc/lib/region_control.cpp b/host/vsoc/lib/region_control.cpp
index 8f53508..c333894 100644
--- a/host/vsoc/lib/region_control.cpp
+++ b/host/vsoc/lib/region_control.cpp
@@ -37,7 +37,7 @@
#include "common/libs/fs/shared_fd.h"
#include "common/libs/fs/shared_select.h"
-using avd::SharedFD;
+using cvd::SharedFD;
DEFINE_int32(instance, 1, "Instance number. Must be unique.");
DEFINE_string(vsoc_run_dir, "/var/run/cvd-",
@@ -95,9 +95,9 @@
// back to 1 while we are going to sleep the sleep will return
// immediately.
uint64_t missed{};
- avd::SharedFDSet readset;
+ cvd::SharedFDSet readset;
readset.Set(incoming_interrupt_fd_);
- avd::Select(&readset, NULL, NULL, NULL);
+ cvd::Select(&readset, NULL, NULL, NULL);
ssize_t rval = incoming_interrupt_fd_->Read(&missed, sizeof(missed));
if (rval != sizeof(missed)) {
LOG(FATAL) << __FUNCTION__ << ": rval (" << rval
@@ -127,13 +127,13 @@
protected:
const char* region_name_{};
- avd::SharedFD incoming_interrupt_fd_;
- avd::SharedFD outgoing_interrupt_fd_;
- avd::SharedFD shared_memory_fd_;
+ cvd::SharedFD incoming_interrupt_fd_;
+ cvd::SharedFD outgoing_interrupt_fd_;
+ cvd::SharedFD shared_memory_fd_;
};
// Default path to the ivshmem_server socket. This can vary when we're
-// launching multiple AVDs.
+// launching multiple CVDs.
constexpr int kMaxSupportedProtocolVersion = 0;
bool HostRegionControl::InitializeRegion() {
@@ -242,7 +242,7 @@
struct iovec iov {
&control_data, sizeof(control_data)
};
- avd::InbandMessageHeader hdr{};
+ cvd::InbandMessageHeader hdr{};
hdr.msg_iov = &iov;
hdr.msg_iovlen = 1;
SharedFD fds[3];