Migrate CAN bus HAL to nested namespaces
Test: it builds
Change-Id: I83d9ef4f1fff1585e6487c95f09b55b1aa5b3e63
diff --git a/automotive/can/1.0/default/CanBus.cpp b/automotive/can/1.0/default/CanBus.cpp
index 86df5dc..454ab00 100644
--- a/automotive/can/1.0/default/CanBus.cpp
+++ b/automotive/can/1.0/default/CanBus.cpp
@@ -25,12 +25,7 @@
#include <linux/can/error.h>
#include <linux/can/raw.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
/** Whether to log sent/received packets. */
static constexpr bool kSuperVerbose = false;
@@ -345,9 +340,4 @@
if (errcb != nullptr) errcb();
}
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanBus.h b/automotive/can/1.0/default/CanBus.h
index da3fc5a..8b73258 100644
--- a/automotive/can/1.0/default/CanBus.h
+++ b/automotive/can/1.0/default/CanBus.h
@@ -26,12 +26,7 @@
#include <atomic>
#include <thread>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
struct CanBus : public ICanBus {
using ErrorCallback = std::function<void()>;
@@ -114,9 +109,4 @@
ErrorCallback mErrCb;
};
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanBusNative.cpp b/automotive/can/1.0/default/CanBusNative.cpp
index 365b749..88f9175 100644
--- a/automotive/can/1.0/default/CanBusNative.cpp
+++ b/automotive/can/1.0/default/CanBusNative.cpp
@@ -20,12 +20,7 @@
#include <libnetdevice/can.h>
#include <libnetdevice/libnetdevice.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
CanBusNative::CanBusNative(const std::string& ifname, uint32_t baudrate)
: CanBus(ifname), mBaudrate(baudrate) {}
@@ -49,9 +44,4 @@
return ICanController::Result::OK;
}
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanBusNative.h b/automotive/can/1.0/default/CanBusNative.h
index 126f1cb..7eda683 100644
--- a/automotive/can/1.0/default/CanBusNative.h
+++ b/automotive/can/1.0/default/CanBusNative.h
@@ -18,12 +18,7 @@
#include "CanBus.h"
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
struct CanBusNative : public CanBus {
CanBusNative(const std::string& ifname, uint32_t baudrate);
@@ -35,9 +30,4 @@
const uint32_t mBaudrate;
};
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanBusSlcan.cpp b/automotive/can/1.0/default/CanBusSlcan.cpp
index 7dce838..29d9d3c 100644
--- a/automotive/can/1.0/default/CanBusSlcan.cpp
+++ b/automotive/can/1.0/default/CanBusSlcan.cpp
@@ -25,12 +25,7 @@
#include <sys/stat.h>
#include <termios.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
namespace slcanprotocol {
static const std::string kOpenCommand = "O\r";
@@ -158,9 +153,4 @@
return true;
}
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanBusSlcan.h b/automotive/can/1.0/default/CanBusSlcan.h
index 2713da8..3328a9f 100644
--- a/automotive/can/1.0/default/CanBusSlcan.h
+++ b/automotive/can/1.0/default/CanBusSlcan.h
@@ -22,12 +22,7 @@
#include <termios.h>
#include "CanBus.h"
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
struct CanBusSlcan : public CanBus {
CanBusSlcan(const std::string& uartName, uint32_t bitrate);
@@ -42,9 +37,4 @@
base::unique_fd mFd;
};
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanBusVirtual.cpp b/automotive/can/1.0/default/CanBusVirtual.cpp
index cc59fa9..32fe8d6 100644
--- a/automotive/can/1.0/default/CanBusVirtual.cpp
+++ b/automotive/can/1.0/default/CanBusVirtual.cpp
@@ -19,12 +19,7 @@
#include <android-base/logging.h>
#include <libnetdevice/libnetdevice.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
CanBusVirtual::CanBusVirtual(const std::string& ifname) : CanBus(ifname) {}
@@ -52,9 +47,4 @@
return true;
}
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanBusVirtual.h b/automotive/can/1.0/default/CanBusVirtual.h
index c2d5794..3990b20 100644
--- a/automotive/can/1.0/default/CanBusVirtual.h
+++ b/automotive/can/1.0/default/CanBusVirtual.h
@@ -18,12 +18,7 @@
#include "CanBus.h"
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
struct CanBusVirtual : public CanBus {
CanBusVirtual(const std::string& ifname);
@@ -36,9 +31,4 @@
bool mWasCreated = false;
};
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanController.cpp b/automotive/can/1.0/default/CanController.cpp
index ffdc912..cd17dd8 100644
--- a/automotive/can/1.0/default/CanController.cpp
+++ b/automotive/can/1.0/default/CanController.cpp
@@ -25,12 +25,7 @@
#include <regex>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
using IfaceIdDisc = ICanController::BusConfiguration::InterfaceIdentifier::hidl_discriminator;
@@ -139,9 +134,4 @@
return success;
}
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanController.h b/automotive/can/1.0/default/CanController.h
index 0674d0e..99a551a 100644
--- a/automotive/can/1.0/default/CanController.h
+++ b/automotive/can/1.0/default/CanController.h
@@ -20,12 +20,7 @@
#include <android/hardware/automotive/can/1.0/ICanController.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
struct CanController : public ICanController {
Return<void> getSupportedInterfaceTypes(getSupportedInterfaceTypes_cb _hidl_cb) override;
@@ -39,9 +34,4 @@
std::map<std::string, sp<CanBus>> mCanBuses GUARDED_BY(mCanBusesGuard);
};
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanSocket.cpp b/automotive/can/1.0/default/CanSocket.cpp
index 86e12d1..86ccc0e 100644
--- a/automotive/can/1.0/default/CanSocket.cpp
+++ b/automotive/can/1.0/default/CanSocket.cpp
@@ -24,12 +24,7 @@
#include <chrono>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
using namespace std::chrono_literals;
@@ -152,9 +147,4 @@
LOG(VERBOSE) << "Reader thread stopped";
}
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanSocket.h b/automotive/can/1.0/default/CanSocket.h
index c98330b..fd956b5 100644
--- a/automotive/can/1.0/default/CanSocket.h
+++ b/automotive/can/1.0/default/CanSocket.h
@@ -24,12 +24,7 @@
#include <chrono>
#include <thread>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
/** Wrapper around SocketCAN socket. */
struct CanSocket {
@@ -71,9 +66,4 @@
DISALLOW_COPY_AND_ASSIGN(CanSocket);
};
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CloseHandle.cpp b/automotive/can/1.0/default/CloseHandle.cpp
index aba2c49..e1ffe2b 100644
--- a/automotive/can/1.0/default/CloseHandle.cpp
+++ b/automotive/can/1.0/default/CloseHandle.cpp
@@ -16,12 +16,7 @@
#include "CloseHandle.h"
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
CloseHandle::CloseHandle(Callback callback) : mCallback(callback) {}
@@ -37,9 +32,4 @@
return {};
}
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CloseHandle.h b/automotive/can/1.0/default/CloseHandle.h
index eade109..c332d74 100644
--- a/automotive/can/1.0/default/CloseHandle.h
+++ b/automotive/can/1.0/default/CloseHandle.h
@@ -19,12 +19,7 @@
#include <android-base/macros.h>
#include <android/hardware/automotive/can/1.0/ICloseHandle.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
/** Generic ICloseHandle implementation ignoring double-close events. */
struct CloseHandle : public ICloseHandle {
@@ -49,9 +44,4 @@
DISALLOW_COPY_AND_ASSIGN(CloseHandle);
};
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/libnetdevice/NetlinkRequest.cpp b/automotive/can/1.0/default/libnetdevice/NetlinkRequest.cpp
index 9845bc7..556debf 100644
--- a/automotive/can/1.0/default/libnetdevice/NetlinkRequest.cpp
+++ b/automotive/can/1.0/default/libnetdevice/NetlinkRequest.cpp
@@ -18,9 +18,7 @@
#include <android-base/logging.h>
-namespace android {
-namespace netdevice {
-namespace impl {
+namespace android::netdevice::impl {
static struct rtattr* nlmsg_tail(struct nlmsghdr* n) {
return reinterpret_cast<struct rtattr*>( //
@@ -53,6 +51,4 @@
nest->rta_len = nestLen;
}
-} // namespace impl
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice::impl
diff --git a/automotive/can/1.0/default/libnetdevice/NetlinkRequest.h b/automotive/can/1.0/default/libnetdevice/NetlinkRequest.h
index ba9b65b..3e28d78 100644
--- a/automotive/can/1.0/default/libnetdevice/NetlinkRequest.h
+++ b/automotive/can/1.0/default/libnetdevice/NetlinkRequest.h
@@ -21,8 +21,7 @@
#include <string>
-namespace android {
-namespace netdevice {
+namespace android::netdevice {
typedef unsigned short rtattrtype_t; // as in rtnetlink.h
typedef __u16 nlmsgtype_t; // as in netlink.h
@@ -151,5 +150,4 @@
}
};
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice
diff --git a/automotive/can/1.0/default/libnetdevice/NetlinkSocket.cpp b/automotive/can/1.0/default/libnetdevice/NetlinkSocket.cpp
index 0514764..6a7f506 100644
--- a/automotive/can/1.0/default/libnetdevice/NetlinkSocket.cpp
+++ b/automotive/can/1.0/default/libnetdevice/NetlinkSocket.cpp
@@ -18,8 +18,7 @@
#include <android-base/logging.h>
-namespace android {
-namespace netdevice {
+namespace android::netdevice {
NetlinkSocket::NetlinkSocket(int protocol) {
mFd.reset(socket(AF_NETLINK, SOCK_RAW, protocol));
@@ -110,5 +109,4 @@
return false;
}
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice
diff --git a/automotive/can/1.0/default/libnetdevice/NetlinkSocket.h b/automotive/can/1.0/default/libnetdevice/NetlinkSocket.h
index 90e1f3f..2b40ea2 100644
--- a/automotive/can/1.0/default/libnetdevice/NetlinkSocket.h
+++ b/automotive/can/1.0/default/libnetdevice/NetlinkSocket.h
@@ -23,8 +23,7 @@
#include <linux/netlink.h>
-namespace android {
-namespace netdevice {
+namespace android::netdevice {
/**
* A wrapper around AF_NETLINK sockets.
@@ -64,5 +63,4 @@
DISALLOW_COPY_AND_ASSIGN(NetlinkSocket);
};
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice
diff --git a/automotive/can/1.0/default/libnetdevice/can.cpp b/automotive/can/1.0/default/libnetdevice/can.cpp
index 6452d9b..06d45d3 100644
--- a/automotive/can/1.0/default/libnetdevice/can.cpp
+++ b/automotive/can/1.0/default/libnetdevice/can.cpp
@@ -28,9 +28,7 @@
#include <linux/can/netlink.h>
#include <linux/can/raw.h>
-namespace android {
-namespace netdevice {
-namespace can {
+namespace android::netdevice::can {
static constexpr can_err_mask_t kErrMask = CAN_ERR_MASK;
@@ -95,6 +93,4 @@
return sock.send(req) && sock.receiveAck();
}
-} // namespace can
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice::can
diff --git a/automotive/can/1.0/default/libnetdevice/common.cpp b/automotive/can/1.0/default/libnetdevice/common.cpp
index 3deac3e..5c62443 100644
--- a/automotive/can/1.0/default/libnetdevice/common.cpp
+++ b/automotive/can/1.0/default/libnetdevice/common.cpp
@@ -20,8 +20,7 @@
#include <net/if.h>
-namespace android {
-namespace netdevice {
+namespace android::netdevice {
unsigned int nametoindex(const std::string& ifname) {
const auto ifidx = if_nametoindex(ifname.c_str());
@@ -34,5 +33,4 @@
return 0;
}
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice
diff --git a/automotive/can/1.0/default/libnetdevice/common.h b/automotive/can/1.0/default/libnetdevice/common.h
index 9bdff4d..8097f37 100644
--- a/automotive/can/1.0/default/libnetdevice/common.h
+++ b/automotive/can/1.0/default/libnetdevice/common.h
@@ -18,8 +18,7 @@
#include <string>
-namespace android {
-namespace netdevice {
+namespace android::netdevice {
/**
* Returns the index of a given network interface.
@@ -32,5 +31,4 @@
*/
unsigned int nametoindex(const std::string& ifname);
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice
diff --git a/automotive/can/1.0/default/libnetdevice/include/libnetdevice/can.h b/automotive/can/1.0/default/libnetdevice/include/libnetdevice/can.h
index d75361e..3886acf 100644
--- a/automotive/can/1.0/default/libnetdevice/include/libnetdevice/can.h
+++ b/automotive/can/1.0/default/libnetdevice/include/libnetdevice/can.h
@@ -20,9 +20,7 @@
#include <string>
-namespace android {
-namespace netdevice {
-namespace can {
+namespace android::netdevice::can {
/**
* Opens and binds SocketCAN socket.
@@ -40,6 +38,4 @@
*/
bool setBitrate(std::string ifname, uint32_t bitrate);
-} // namespace can
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice::can
diff --git a/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h b/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h
index e22eafb..3818a31 100644
--- a/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h
+++ b/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h
@@ -19,8 +19,7 @@
#include <optional>
#include <string>
-namespace android {
-namespace netdevice {
+namespace android::netdevice {
/**
* Checks, if the network interface exists.
@@ -71,5 +70,4 @@
*/
bool del(std::string dev);
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice
diff --git a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
index fc2b193..aee8205 100644
--- a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
+++ b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
@@ -25,8 +25,7 @@
#include <linux/can.h>
#include <net/if.h>
-namespace android {
-namespace netdevice {
+namespace android::netdevice {
bool exists(std::string ifname) {
return nametoindex(ifname) != 0;
@@ -96,5 +95,4 @@
return sock.send(req) && sock.receiveAck();
}
-} // namespace netdevice
-} // namespace android
+} // namespace android::netdevice
diff --git a/automotive/can/1.0/default/service.cpp b/automotive/can/1.0/default/service.cpp
index ebc2f8c..b52a54a 100644
--- a/automotive/can/1.0/default/service.cpp
+++ b/automotive/can/1.0/default/service.cpp
@@ -19,12 +19,7 @@
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace implementation {
+namespace android::hardware::automotive::can::V1_0::implementation {
static void canControllerService() {
base::SetDefaultTag("CanController");
@@ -42,12 +37,7 @@
joinRpcThreadpool();
}
-} // namespace implementation
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::implementation
int main() {
::android::hardware::automotive::can::V1_0::implementation::canControllerService();
diff --git a/automotive/can/1.0/hidl-utils/include/hidl-utils/hidl-utils.h b/automotive/can/1.0/hidl-utils/include/hidl-utils/hidl-utils.h
index 039f971..f63d43c 100644
--- a/automotive/can/1.0/hidl-utils/include/hidl-utils/hidl-utils.h
+++ b/automotive/can/1.0/hidl-utils/include/hidl-utils/hidl-utils.h
@@ -16,10 +16,7 @@
#pragma once
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace hidl_utils {
+namespace android::hardware::automotive::hidl_utils {
/**
* Helper functor to fetch results from multi-return HIDL calls.
@@ -61,7 +58,4 @@
}
};
-} // namespace hidl_utils
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::hidl_utils
diff --git a/automotive/can/1.0/tools/canhalctrl.cpp b/automotive/can/1.0/tools/canhalctrl.cpp
index fa1048d..5c9849b 100644
--- a/automotive/can/1.0/tools/canhalctrl.cpp
+++ b/automotive/can/1.0/tools/canhalctrl.cpp
@@ -22,10 +22,7 @@
#include <iostream>
#include <string>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
+namespace android::hardware::automotive::can {
using ICanController = V1_0::ICanController;
@@ -170,10 +167,7 @@
}
}
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can
int main(int argc, char* argv[]) {
if (argc < 1) return -1;
diff --git a/automotive/can/1.0/tools/canhaldump.cpp b/automotive/can/1.0/tools/canhaldump.cpp
index 55b2a34..2f5ca61 100644
--- a/automotive/can/1.0/tools/canhaldump.cpp
+++ b/automotive/can/1.0/tools/canhaldump.cpp
@@ -27,10 +27,7 @@
#include <string>
#include <thread>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
+namespace android::hardware::automotive::can {
using namespace std::chrono_literals;
@@ -128,10 +125,7 @@
return candump(argv[0]);
}
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can
int main(int argc, char* argv[]) {
if (argc < 1) return -1;
diff --git a/automotive/can/1.0/tools/canhalsend.cpp b/automotive/can/1.0/tools/canhalsend.cpp
index 29330c9..7e6833a 100644
--- a/automotive/can/1.0/tools/canhalsend.cpp
+++ b/automotive/can/1.0/tools/canhalsend.cpp
@@ -21,10 +21,7 @@
#include <iostream>
#include <string>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
+namespace android::hardware::automotive::can {
using ICanBus = V1_0::ICanBus;
using Result = V1_0::Result;
@@ -125,10 +122,7 @@
return cansend(busname, msgid, payload);
}
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can
int main(int argc, char* argv[]) {
if (argc < 1) return -1;
diff --git a/automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp b/automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp
index 250caf2..8deaed6 100644
--- a/automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp
+++ b/automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp
@@ -24,12 +24,7 @@
#include <gmock/gmock.h>
#include <hidl-utils/hidl-utils.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace vts {
+namespace android::hardware::automotive::can::V1_0::vts {
using hardware::hidl_vec;
@@ -173,12 +168,7 @@
ASSERT_NE(nullptr, closeHandle.get());
}
-} // namespace vts
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::vts
/**
* Example manual invocation:
diff --git a/automotive/can/1.0/vts/functional/VtsHalCanBusVirtualV1_0TargetTest.cpp b/automotive/can/1.0/vts/functional/VtsHalCanBusVirtualV1_0TargetTest.cpp
index 695b9fb..1663663 100644
--- a/automotive/can/1.0/vts/functional/VtsHalCanBusVirtualV1_0TargetTest.cpp
+++ b/automotive/can/1.0/vts/functional/VtsHalCanBusVirtualV1_0TargetTest.cpp
@@ -31,12 +31,7 @@
#include <chrono>
#include <thread>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace vts {
+namespace android::hardware::automotive::can::V1_0::vts {
using namespace std::chrono_literals;
@@ -290,12 +285,7 @@
ASSERT_EQ(expectedPositive, messagesPositive);
}
-} // namespace vts
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::vts
/**
* Example manual invocation:
diff --git a/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp b/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp
index 64e7a96..22dec2c 100644
--- a/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp
+++ b/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp
@@ -26,12 +26,7 @@
#include <gmock/gmock.h>
#include <hidl-utils/hidl-utils.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace vts {
+namespace android::hardware::automotive::can::V1_0::vts {
using hardware::hidl_vec;
using InterfaceType = ICanController::InterfaceType;
@@ -233,12 +228,7 @@
assertRegistered(name, false);
}
-} // namespace vts
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::vts
/**
* Example manual invocation:
diff --git a/automotive/can/1.0/vts/utils/include/can-vts-utils/can-hal-printers.h b/automotive/can/1.0/vts/utils/include/can-vts-utils/can-hal-printers.h
index 0923998..3c30744 100644
--- a/automotive/can/1.0/vts/utils/include/can-vts-utils/can-hal-printers.h
+++ b/automotive/can/1.0/vts/utils/include/can-vts-utils/can-hal-printers.h
@@ -18,11 +18,7 @@
#include <android/hardware/automotive/can/1.0/ICanController.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
+namespace android::hardware::automotive::can::V1_0 {
/**
* Define gTest printer for a given HIDL type, but skip definition for Return<T>.
@@ -48,8 +44,4 @@
#undef DEFINE_CAN_HAL_PRINTER
#undef DEFINE_CAN_HAL_PRINTER_SIMPLE
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0
diff --git a/automotive/can/1.0/vts/utils/include/can-vts-utils/environment-utils.h b/automotive/can/1.0/vts/utils/include/can-vts-utils/environment-utils.h
index a722dd0..3eb9cc1 100644
--- a/automotive/can/1.0/vts/utils/include/can-vts-utils/environment-utils.h
+++ b/automotive/can/1.0/vts/utils/include/can-vts-utils/environment-utils.h
@@ -18,13 +18,7 @@
#include <VtsHalHidlTargetTestEnvBase.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace can {
-namespace V1_0 {
-namespace vts {
-namespace utils {
+namespace android::hardware::automotive::can::V1_0::vts::utils {
/**
* Simple test environment.
@@ -63,10 +57,4 @@
}
};
-} // namespace utils
-} // namespace vts
-} // namespace V1_0
-} // namespace can
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::can::V1_0::vts::utils