update_engine: Run clang-format on client_library/
BUG=none
TEST=unittests
Change-Id: I0963049abcafbcba0094ec594afec583fe37c1ef
Reviewed-on: https://chromium-review.googlesource.com/1409706
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/client_library/client.cc b/client_library/client.cc
index 9a42696..b05df90 100644
--- a/client_library/client.cc
+++ b/client_library/client.cc
@@ -31,13 +31,13 @@
unique_ptr<UpdateEngineClient> UpdateEngineClient::CreateInstance() {
#if USE_BINDER
auto update_engine_client_impl = new internal::BinderUpdateEngineClient{};
-#else // !USE_BINDER
+#else // !USE_BINDER
auto update_engine_client_impl = new internal::DBusUpdateEngineClient{};
#endif // USE_BINDER
auto ret = unique_ptr<UpdateEngineClient>{update_engine_client_impl};
if (!update_engine_client_impl->Init()) {
- ret.reset();
+ ret.reset();
}
return ret;
diff --git a/client_library/client_binder.cc b/client_library/client_binder.cc
index 5c22f84..588bc64 100644
--- a/client_library/client_binder.cc
+++ b/client_library/client_binder.cc
@@ -25,12 +25,12 @@
#include "update_engine/parcelable_update_engine_status.h"
#include "update_engine/update_status_utils.h"
-using android::binder::Status;
-using android::brillo::ParcelableUpdateEngineStatus;
using android::getService;
using android::OK;
using android::String16;
using android::String8;
+using android::binder::Status;
+using android::brillo::ParcelableUpdateEngineStatus;
using chromeos_update_engine::StringToUpdateStatus;
using std::string;
using update_engine::UpdateAttemptFlags;
@@ -39,10 +39,11 @@
namespace internal {
bool BinderUpdateEngineClient::Init() {
- if (!binder_watcher_.Init()) return false;
+ if (!binder_watcher_.Init())
+ return false;
return getService(String16{"android.brillo.UpdateEngineService"},
- &service_) == OK;
+ &service_) == OK;
}
bool BinderUpdateEngineClient::AttemptUpdate(const string& in_app_version,
@@ -172,8 +173,7 @@
bool BinderUpdateEngineClient::RegisterStatusUpdateHandler(
StatusUpdateHandler* handler) {
if (!status_callback_.get()) {
- status_callback_ =
- new BinderUpdateEngineClient::StatusUpdateCallback(this);
+ status_callback_ = new BinderUpdateEngineClient::StatusUpdateCallback(this);
if (!service_->RegisterStatusCallback(status_callback_).isOk()) {
return false;
}
@@ -187,13 +187,16 @@
string new_version;
int64_t new_size;
- if (!GetStatus(&last_checked_time, &progress, &update_status,
- &new_version, &new_size)) {
+ if (!GetStatus(&last_checked_time,
+ &progress,
+ &update_status,
+ &new_version,
+ &new_size)) {
handler->IPCError("Could not get status from binder service");
}
- handler->HandleStatusUpdate(last_checked_time, progress, update_status,
- new_version, new_size);
+ handler->HandleStatusUpdate(
+ last_checked_time, progress, update_status, new_version, new_size);
return true;
}
@@ -211,8 +214,9 @@
bool BinderUpdateEngineClient::SetTargetChannel(const string& in_target_channel,
bool allow_powerwash) {
- return service_->SetChannel(String16{in_target_channel.c_str()},
- allow_powerwash).isOk();
+ return service_
+ ->SetChannel(String16{in_target_channel.c_str()}, allow_powerwash)
+ .isOk();
}
bool BinderUpdateEngineClient::GetTargetChannel(string* out_channel) const {
diff --git a/client_library/client_binder.h b/client_library/client_binder.h
index b3c8940..f3e4102 100644
--- a/client_library/client_binder.h
+++ b/client_library/client_binder.h
@@ -90,8 +90,8 @@
bool GetEolStatus(int32_t* eol_status) const override;
private:
- class StatusUpdateCallback :
- public android::brillo::BnUpdateEngineStatusCallback {
+ class StatusUpdateCallback
+ : public android::brillo::BnUpdateEngineStatusCallback {
public:
explicit StatusUpdateCallback(BinderUpdateEngineClient* client)
: client_(client) {}
diff --git a/client_library/client_dbus.cc b/client_library/client_dbus.cc
index e0d1f64..7ca6307 100644
--- a/client_library/client_dbus.cc
+++ b/client_library/client_dbus.cc
@@ -147,13 +147,11 @@
}
void DBusUpdateEngineClient::DBusStatusHandlersRegistered(
- const string& interface,
- const string& signal_name,
- bool success) const {
+ const string& interface, const string& signal_name, bool success) const {
if (!success) {
for (auto handler : handlers_) {
- handler->IPCError("Could not connect to" + signal_name +
- " on " + interface);
+ handler->IPCError("Could not connect to" + signal_name + " on " +
+ interface);
}
} else {
StatusUpdateHandlersRegistered(nullptr);