Apply cosmetic changes
This CL makes a few cosmetic changes in EVS components to remove
redundant lines and adjust their log verbosity.
Bug: 199626993
Test: m -j
Change-Id: I8df13abbf62980a4d13d475d2346cf502db49a98
diff --git a/cpp/evs/manager/1.1/Enumerator.cpp b/cpp/evs/manager/1.1/Enumerator.cpp
index d6f532d..8add160 100644
--- a/cpp/evs/manager/1.1/Enumerator.cpp
+++ b/cpp/evs/manager/1.1/Enumerator.cpp
@@ -79,7 +79,7 @@
// Connect with the underlying hardware enumerator
mHwEnumerator = IEvsEnumerator::getService(hardwareServiceName);
- bool result = (mHwEnumerator.get() != nullptr);
+ bool result = (mHwEnumerator != nullptr);
if (result) {
// Get an internal display identifier.
mHwEnumerator->getDisplayIdList(
@@ -296,7 +296,7 @@
Return<void> Enumerator::closeCamera(const ::android::sp<IEvsCamera_1_0>& clientCamera) {
LOG(DEBUG) << __FUNCTION__;
- if (clientCamera.get() == nullptr) {
+ if (clientCamera == nullptr) {
LOG(ERROR) << "Ignoring call with null camera pointer.";
return Void();
}
@@ -358,8 +358,7 @@
mEmulatedCameraDevices[id]);
}
} else {
- device = IEvsCamera_1_1::castFrom(mHwEnumerator->openCamera_1_1(id, streamCfg))
- .withDefault(nullptr);
+ device = mHwEnumerator->openCamera_1_1(id, streamCfg);
}
if (device == nullptr) {
diff --git a/cpp/evs/manager/1.1/HalCamera.cpp b/cpp/evs/manager/1.1/HalCamera.cpp
index e527840..654eb99 100644
--- a/cpp/evs/manager/1.1/HalCamera.cpp
+++ b/cpp/evs/manager/1.1/HalCamera.cpp
@@ -89,7 +89,7 @@
void HalCamera::disownVirtualCamera(sp<VirtualCamera> virtualCamera) {
// Ignore calls with null pointers
- if (virtualCamera.get() == nullptr) {
+ if (virtualCamera == nullptr) {
LOG(WARNING) << "Ignoring disownVirtualCamera call with null pointer";
return;
}
diff --git a/cpp/evs/manager/1.1/VirtualCamera.cpp b/cpp/evs/manager/1.1/VirtualCamera.cpp
index 3b0ef95..62b9f67 100644
--- a/cpp/evs/manager/1.1/VirtualCamera.cpp
+++ b/cpp/evs/manager/1.1/VirtualCamera.cpp
@@ -385,7 +385,6 @@
// This happens when either a new frame does not arrive
// before a timer expires or we're requested to stop
// capturing frames.
- LOG(DEBUG) << "Exiting a capture thread.";
break;
} else if (mStreamState == RUNNING) {
// Fetch frames and forward to the client
@@ -681,7 +680,7 @@
return EvsResult::INVALID_ARG;
}
- if (display.get() == nullptr) {
+ if (display == nullptr) {
LOG(ERROR) << __FUNCTION__
<< ": Passed display is invalid";
return EvsResult::INVALID_ARG;
diff --git a/cpp/evs/sampleDriver/EvsV4lCamera.cpp b/cpp/evs/sampleDriver/EvsV4lCamera.cpp
index db6e4ee..47861a7 100644
--- a/cpp/evs/sampleDriver/EvsV4lCamera.cpp
+++ b/cpp/evs/sampleDriver/EvsV4lCamera.cpp
@@ -739,7 +739,7 @@
android::base::unique_fd fd(open(filename.c_str(),
O_WRONLY | O_CREAT,
S_IRUSR | S_IWUSR | S_IRGRP));
- LOG(ERROR) << filename << ", " << fd;
+ LOG(INFO) << filename << ", " << fd;
if (fd == -1) {
PLOG(ERROR) << "Failed to open a file, " << filename;
} else {