Introduce brillo binder interface

This is more or less an exact analogue of the DBus interface, but
available over binder. We also add support to the client library and let
update_engine_client build with binder. We don't yet support an
equivalent of the status signal/the HandleStatusUpdate method. That will
come in a future CL.

Bug: 25908638
TEST=Verified update_engine_client functionality

Change-Id: Ic793619c8019b0d50aa184e0f592b6a9ab71e0b0
diff --git a/client_library/client.cc b/client_library/client.cc
index f4a24cf..9a42696 100644
--- a/client_library/client.cc
+++ b/client_library/client.cc
@@ -18,14 +18,22 @@
 
 #include <memory>
 
-#include "update_engine/client_library/client_impl.h"
+#if USE_BINDER
+#include "update_engine/client_library/client_binder.h"
+#else  // !USE_BINDER
+#include "update_engine/client_library/client_dbus.h"
+#endif  // USE_BINDER
 
 using std::unique_ptr;
 
 namespace update_engine {
 
-std::unique_ptr<UpdateEngineClient> UpdateEngineClient::CreateInstance() {
-  auto update_engine_client_impl = new internal::UpdateEngineClientImpl{};
+unique_ptr<UpdateEngineClient> UpdateEngineClient::CreateInstance() {
+#if USE_BINDER
+  auto update_engine_client_impl = new internal::BinderUpdateEngineClient{};
+#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()) {
diff --git a/client_library/client_binder.cc b/client_library/client_binder.cc
new file mode 100644
index 0000000..b3bd3e7
--- /dev/null
+++ b/client_library/client_binder.cc
@@ -0,0 +1,157 @@
+//
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "update_engine/client_library/client_binder.h"
+
+#include <binder/IServiceManager.h>
+
+#include <base/message_loop/message_loop.h>
+#include <utils/String16.h>
+#include <utils/String8.h>
+
+#include "update_engine/parcelable_update_engine_status.h"
+#include "update_engine/update_status_utils.h"
+
+using android::OK;
+using android::String16;
+using android::String8;
+using android::brillo::ParcelableUpdateEngineStatus;
+using android::getService;
+using chromeos_update_engine::StringToUpdateStatus;
+using std::string;
+
+namespace update_engine {
+namespace internal {
+
+bool BinderUpdateEngineClient::Init() {
+  return getService(String16{"android.brillo.UpdateEngineService"},
+      &service_) == OK;
+}
+
+bool BinderUpdateEngineClient::AttemptUpdate(const string& in_app_version,
+                                             const string& in_omaha_url,
+                                             bool at_user_request) {
+  return service_->AttemptUpdate(String16{in_app_version.c_str()},
+                                 String16{in_omaha_url.c_str()},
+                                 at_user_request ? 1 : 0).isOk();
+}
+
+bool BinderUpdateEngineClient::GetStatus(int64_t* out_last_checked_time,
+                                         double* out_progress,
+                                         UpdateStatus* out_update_status,
+                                         string* out_new_version,
+                                         int64_t* out_new_size) const {
+  ParcelableUpdateEngineStatus status;
+
+  if (!service_->GetStatus(&status).isOk())
+    return false;
+
+  *out_last_checked_time = status.last_checked_time_;
+  *out_progress = status.progress_;
+  StringToUpdateStatus(String8{status.current_operation_}.string(),
+                       out_update_status);
+  *out_new_version = String8{status.new_version_}.string();
+  *out_new_size = status.new_size_;
+  return true;
+}
+
+bool BinderUpdateEngineClient::SetUpdateOverCellularPermission(bool allowed) {
+  return service_->SetUpdateOverCellularPermission(allowed).isOk();
+}
+
+bool BinderUpdateEngineClient::GetUpdateOverCellularPermission(
+    bool* allowed) const {
+  return service_->GetUpdateOverCellularPermission(allowed).isOk();
+}
+
+bool BinderUpdateEngineClient::SetP2PUpdatePermission(bool enabled) {
+  return service_->SetP2PUpdatePermission(enabled).isOk();
+}
+
+bool BinderUpdateEngineClient::GetP2PUpdatePermission(bool* enabled) const {
+  return service_->GetP2PUpdatePermission(enabled).isOk();
+}
+
+bool BinderUpdateEngineClient::Rollback(bool powerwash) {
+  return service_->AttemptRollback(powerwash).isOk();
+}
+
+bool BinderUpdateEngineClient::GetRollbackPartition(
+    string* rollback_partition) const {
+  String16 out_as_string16;
+
+  if (!service_->GetRollbackPartition(&out_as_string16).isOk())
+    return false;
+
+  *rollback_partition = String8{out_as_string16}.string();
+  return true;
+}
+
+bool BinderUpdateEngineClient::GetPrevVersion(string* prev_version) const {
+  String16 out_as_string16;
+
+  if (!service_->GetPrevVersion(&out_as_string16).isOk())
+    return false;
+
+  *prev_version = String8{out_as_string16}.string();
+  return true;
+}
+
+void BinderUpdateEngineClient::RebootIfNeeded() {
+  if (!service_->RebootIfNeeded().isOk()) {
+    // Reboot error code doesn't necessarily mean that a reboot
+    // failed. For example, D-Bus may be shutdown before we receive the
+    // result.
+    LOG(INFO) << "RebootIfNeeded() failure ignored.";
+  }
+}
+
+bool BinderUpdateEngineClient::ResetStatus() {
+  return service_->ResetStatus().isOk();
+}
+
+void BinderUpdateEngineClient::RegisterStatusUpdateHandler(
+    StatusUpdateHandler* handler) {
+}
+
+bool BinderUpdateEngineClient::SetTargetChannel(const string& in_target_channel,
+                                                bool allow_powerwash) {
+  return service_->SetChannel(String16{in_target_channel.c_str()},
+                              allow_powerwash).isOk();
+}
+
+bool BinderUpdateEngineClient::GetTargetChannel(string* out_channel) const {
+  String16 out_as_string16;
+
+  if (!service_->GetChannel(false, &out_as_string16).isOk())
+    return false;
+
+  *out_channel = String8{out_as_string16}.string();
+  return true;
+}
+
+bool BinderUpdateEngineClient::GetChannel(string* out_channel) const {
+  String16 out_as_string16;
+
+  if (!service_->GetChannel(true, &out_as_string16).isOk())
+    return false;
+
+  *out_channel = String8{out_as_string16}.string();
+  return true;
+}
+
+}  // namespace internal
+}  // namespace update_engine
diff --git a/client_library/client_impl.h b/client_library/client_binder.h
similarity index 64%
copy from client_library/client_impl.h
copy to client_library/client_binder.h
index cfd5395..22d1cf0 100644
--- a/client_library/client_impl.h
+++ b/client_library/client_binder.h
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2015 The Android Open Source Project
+// Copyright (C) 2016 The Android Open Source Project
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -14,27 +14,29 @@
 // limitations under the License.
 //
 
-#ifndef UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_
-#define UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_
+#ifndef UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_BINDER_H_
+#define UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_BINDER_H_
 
 #include <cstdint>
 #include <memory>
 #include <string>
 
 #include <base/macros.h>
+#include <utils/StrongPointer.h>
+
+#include "android/brillo/IUpdateEngine.h"
 
 #include "update_engine/client_library/include/update_engine/client.h"
-#include "update_engine/dbus-proxies.h"
 
 namespace update_engine {
 namespace internal {
 
-class UpdateEngineClientImpl : public UpdateEngineClient {
+class BinderUpdateEngineClient : public UpdateEngineClient {
  public:
-  explicit UpdateEngineClientImpl() = default;
+  BinderUpdateEngineClient() = default;
   bool Init();
 
-  virtual ~UpdateEngineClientImpl() = default;
+  virtual ~BinderUpdateEngineClient() = default;
 
   bool AttemptUpdate(const std::string& app_version,
                      const std::string& omaha_url,
@@ -72,24 +74,12 @@
   void RegisterStatusUpdateHandler(StatusUpdateHandler* handler) override;
 
  private:
-  std::unique_ptr<org::chromium::UpdateEngineInterfaceProxy> proxy_;
+  android::sp<android::brillo::IUpdateEngine> service_;
 
-  void StatusUpdateHandlerRegistered(StatusUpdateHandler* handler,
-                                     const std::string& interface,
-                                     const std::string& signal_name,
-                                     bool success) const;
-
-  void RunStatusUpdateHandler(StatusUpdateHandler* handler,
-                              int64_t last_checked_time,
-                              double progress,
-                              const std::string& current_operation,
-                              const std::string& new_version,
-                              int64_t new_size);
-
-  DISALLOW_COPY_AND_ASSIGN(UpdateEngineClientImpl);
-};  // class UpdateEngineClientImpl
+  DISALLOW_COPY_AND_ASSIGN(BinderUpdateEngineClient);
+};  // class BinderUpdateEngineClient
 
 }  // namespace internal
 }  // namespace update_engine
 
-#endif  // UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_
+#endif  // UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_BINDER_H_
diff --git a/client_library/client_dbus.cc b/client_library/client_dbus.cc
new file mode 100644
index 0000000..0d02936
--- /dev/null
+++ b/client_library/client_dbus.cc
@@ -0,0 +1,196 @@
+//
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "update_engine/client_library/client_dbus.h"
+
+#include <base/message_loop/message_loop.h>
+
+#include <dbus/bus.h>
+#include <update_engine/dbus-constants.h>
+
+#include "update_engine/update_status_utils.h"
+
+using chromeos_update_engine::StringToUpdateStatus;
+using dbus::Bus;
+using org::chromium::UpdateEngineInterfaceProxy;
+using std::string;
+
+namespace update_engine {
+namespace internal {
+
+bool DBusUpdateEngineClient::Init() {
+  Bus::Options options;
+  options.bus_type = Bus::SYSTEM;
+  scoped_refptr<Bus> bus{new Bus{options}};
+
+  if (!bus->Connect())
+    return false;
+
+  proxy_.reset(new UpdateEngineInterfaceProxy{bus});
+  return true;
+}
+
+bool DBusUpdateEngineClient::AttemptUpdate(const string& in_app_version,
+                                           const string& in_omaha_url,
+                                           bool at_user_request) {
+  return proxy_->AttemptUpdateWithFlags(
+      in_app_version,
+      in_omaha_url,
+      (at_user_request) ? 0 : kAttemptUpdateFlagNonInteractive,
+      nullptr);
+}
+
+bool DBusUpdateEngineClient::GetStatus(int64_t* out_last_checked_time,
+                                       double* out_progress,
+                                       UpdateStatus* out_update_status,
+                                       string* out_new_version,
+                                       int64_t* out_new_size) const {
+  string status_as_string;
+  const bool success = proxy_->GetStatus(out_last_checked_time,
+                                         out_progress,
+                                         &status_as_string,
+                                         out_new_version,
+                                         out_new_size,
+                                         nullptr);
+  if (!success) {
+    return false;
+  }
+
+  return StringToUpdateStatus(status_as_string, out_update_status);
+}
+
+bool DBusUpdateEngineClient::SetUpdateOverCellularPermission(bool allowed) {
+  return proxy_->SetUpdateOverCellularPermission(allowed, nullptr);
+}
+
+bool DBusUpdateEngineClient::GetUpdateOverCellularPermission(
+    bool* allowed) const {
+  return proxy_->GetUpdateOverCellularPermission(allowed, nullptr);
+}
+
+bool DBusUpdateEngineClient::SetP2PUpdatePermission(bool enabled) {
+  return proxy_->SetP2PUpdatePermission(enabled, nullptr);
+}
+
+bool DBusUpdateEngineClient::GetP2PUpdatePermission(bool* enabled) const {
+  return proxy_->GetP2PUpdatePermission(enabled, nullptr);
+}
+
+bool DBusUpdateEngineClient::Rollback(bool powerwash) {
+  return proxy_->AttemptRollback(powerwash, nullptr);
+}
+
+bool DBusUpdateEngineClient::GetRollbackPartition(
+    string* rollback_partition) const {
+  return proxy_->GetRollbackPartition(rollback_partition, nullptr);
+}
+
+bool DBusUpdateEngineClient::GetPrevVersion(string* prev_version) const {
+  return proxy_->GetPrevVersion(prev_version, nullptr);
+}
+
+void DBusUpdateEngineClient::RebootIfNeeded() {
+  bool ret = proxy_->RebootIfNeeded(nullptr);
+  if (!ret) {
+    // Reboot error code doesn't necessarily mean that a reboot
+    // failed. For example, D-Bus may be shutdown before we receive the
+    // result.
+    LOG(INFO) << "RebootIfNeeded() failure ignored.";
+  }
+}
+
+bool DBusUpdateEngineClient::ResetStatus() {
+  return proxy_->ResetStatus(nullptr);
+}
+
+void DBusUpdateEngineClient::StatusUpdateHandlerRegistered(
+    StatusUpdateHandler* handler,
+    const string& interface,
+    const string& signal_name,
+    bool success) const {
+  if (!success) {
+    handler->IPCError("Could not connect to" + signal_name);
+    return;
+  }
+
+  int64_t last_checked_time;
+  double progress;
+  UpdateStatus update_status;
+  string new_version;
+  int64_t new_size;
+
+  if (GetStatus(&last_checked_time,
+                &progress,
+                &update_status,
+                &new_version,
+                &new_size)) {
+    handler->HandleStatusUpdate(
+        last_checked_time, progress, update_status, new_version, new_size);
+    return;
+  }
+
+  handler->IPCError("Could not query current status");
+}
+
+void DBusUpdateEngineClient::RunStatusUpdateHandler(
+    StatusUpdateHandler* h,
+    int64_t last_checked_time,
+    double progress,
+    const string& current_operation,
+    const string& new_version,
+    int64_t new_size) {
+  UpdateStatus status;
+  StringToUpdateStatus(current_operation, &status);
+
+  h->HandleStatusUpdate(
+      last_checked_time, progress, status, new_version, new_size);
+}
+
+void DBusUpdateEngineClient::RegisterStatusUpdateHandler(
+    StatusUpdateHandler* handler) {
+  if (!base::MessageLoopForIO::current()) {
+    LOG(FATAL) << "Cannot get UpdateEngineClient outside of message loop.";
+    return;
+  }
+
+  proxy_->RegisterStatusUpdateSignalHandler(
+      base::Bind(&DBusUpdateEngineClient::RunStatusUpdateHandler,
+                 base::Unretained(this),
+                 base::Unretained(handler)),
+      base::Bind(&DBusUpdateEngineClient::StatusUpdateHandlerRegistered,
+                 base::Unretained(this),
+                 base::Unretained(handler)));
+}
+
+bool DBusUpdateEngineClient::SetTargetChannel(const string& in_target_channel,
+                                              bool allow_powerwash) {
+  return proxy_->SetChannel(in_target_channel, allow_powerwash, nullptr);
+}
+
+bool DBusUpdateEngineClient::GetTargetChannel(string* out_channel) const {
+  return proxy_->GetChannel(false,  // Get the target channel.
+                            out_channel,
+                            nullptr);
+}
+
+bool DBusUpdateEngineClient::GetChannel(string* out_channel) const {
+  return proxy_->GetChannel(true,  // Get the current channel.
+                            out_channel,
+                            nullptr);
+}
+
+}  // namespace internal
+}  // namespace update_engine
diff --git a/client_library/client_impl.h b/client_library/client_dbus.h
similarity index 87%
rename from client_library/client_impl.h
rename to client_library/client_dbus.h
index cfd5395..3590a21 100644
--- a/client_library/client_impl.h
+++ b/client_library/client_dbus.h
@@ -14,8 +14,8 @@
 // limitations under the License.
 //
 
-#ifndef UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_
-#define UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_
+#ifndef UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_DBUS_H_
+#define UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_DBUS_H_
 
 #include <cstdint>
 #include <memory>
@@ -29,12 +29,12 @@
 namespace update_engine {
 namespace internal {
 
-class UpdateEngineClientImpl : public UpdateEngineClient {
+class DBusUpdateEngineClient : public UpdateEngineClient {
  public:
-  explicit UpdateEngineClientImpl() = default;
+  DBusUpdateEngineClient() = default;
   bool Init();
 
-  virtual ~UpdateEngineClientImpl() = default;
+  virtual ~DBusUpdateEngineClient() = default;
 
   bool AttemptUpdate(const std::string& app_version,
                      const std::string& omaha_url,
@@ -86,10 +86,10 @@
                               const std::string& new_version,
                               int64_t new_size);
 
-  DISALLOW_COPY_AND_ASSIGN(UpdateEngineClientImpl);
-};  // class UpdateEngineClientImpl
+  DISALLOW_COPY_AND_ASSIGN(DBusUpdateEngineClient);
+};  // class DBusUpdateEngineClient
 
 }  // namespace internal
 }  // namespace update_engine
 
-#endif  // UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_
+#endif  // UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_DBUS_H_
diff --git a/client_library/client_impl.cc b/client_library/client_impl.cc
deleted file mode 100644
index 186301f..0000000
--- a/client_library/client_impl.cc
+++ /dev/null
@@ -1,176 +0,0 @@
-//
-// Copyright (C) 2015 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include "update_engine/client_library/client_impl.h"
-
-#include <base/message_loop/message_loop.h>
-
-#include <dbus/bus.h>
-#include <update_engine/dbus-constants.h>
-
-#include "update_engine/update_status_utils.h"
-
-using chromeos_update_engine::StringToUpdateStatus;
-using std::string;
-using dbus::Bus;
-using org::chromium::UpdateEngineInterfaceProxy;
-
-namespace update_engine {
-namespace internal {
-
-bool UpdateEngineClientImpl::Init() {
-  Bus::Options options;
-  options.bus_type = Bus::SYSTEM;
-  scoped_refptr<Bus> bus{new Bus{options}};
-
-  if (!bus->Connect()) return false;
-
-  proxy_.reset(new UpdateEngineInterfaceProxy{bus});
-  return true;
-}
-
-bool UpdateEngineClientImpl::AttemptUpdate(const string& in_app_version,
-                                           const string& in_omaha_url,
-                                           bool at_user_request) {
-  return proxy_->AttemptUpdateWithFlags(
-      in_app_version, in_omaha_url,
-      (at_user_request) ? 0 : kAttemptUpdateFlagNonInteractive, nullptr);
-}
-
-bool UpdateEngineClientImpl::GetStatus(int64_t* out_last_checked_time,
-                                       double* out_progress,
-                                       UpdateStatus* out_update_status,
-                                       string* out_new_version,
-                                       int64_t* out_new_size) const {
-  string status_as_string;
-  const bool success =
-      proxy_->GetStatus(out_last_checked_time, out_progress, &status_as_string,
-                        out_new_version, out_new_size, nullptr);
-  if (!success) {
-    return false;
-  }
-
-  return StringToUpdateStatus(status_as_string, out_update_status);
-}
-
-bool UpdateEngineClientImpl::SetUpdateOverCellularPermission(bool allowed) {
-  return proxy_->SetUpdateOverCellularPermission(allowed, nullptr);
-}
-
-bool UpdateEngineClientImpl::GetUpdateOverCellularPermission(bool* allowed) const {
-  return proxy_->GetUpdateOverCellularPermission(allowed, nullptr);
-}
-
-bool UpdateEngineClientImpl::SetP2PUpdatePermission(bool enabled) {
-  return proxy_->SetP2PUpdatePermission(enabled, nullptr);
-}
-
-bool UpdateEngineClientImpl::GetP2PUpdatePermission(bool* enabled) const {
-  return proxy_->GetP2PUpdatePermission(enabled, nullptr);
-}
-
-bool UpdateEngineClientImpl::Rollback(bool powerwash) {
-  return proxy_->AttemptRollback(powerwash, nullptr);
-}
-
-bool UpdateEngineClientImpl::GetRollbackPartition(string* rollback_partition) const {
-  return proxy_->GetRollbackPartition(rollback_partition, nullptr);
-}
-
-bool UpdateEngineClientImpl::GetPrevVersion(string* prev_version) const {
-  return proxy_->GetPrevVersion(prev_version, nullptr);
-}
-
-void UpdateEngineClientImpl::RebootIfNeeded() {
-  bool ret = proxy_->RebootIfNeeded(nullptr);
-  if (!ret) {
-    // Reboot error code doesn't necessarily mean that a reboot
-    // failed. For example, D-Bus may be shutdown before we receive the
-    // result.
-    LOG(INFO) << "RebootIfNeeded() failure ignored.";
-  }
-}
-
-bool UpdateEngineClientImpl::ResetStatus() {
-  return proxy_->ResetStatus(nullptr);
-}
-
-void UpdateEngineClientImpl::StatusUpdateHandlerRegistered(
-    StatusUpdateHandler* handler, const std::string& interface,
-    const std::string& signal_name, bool success) const {
-  if (!success) {
-    handler->IPCError("Could not connect to" + signal_name);
-    return;
-  }
-
-  int64_t last_checked_time;
-  double progress;
-  UpdateStatus update_status;
-  string new_version;
-  int64_t new_size;
-
-  if (GetStatus(&last_checked_time, &progress, &update_status, &new_version,
-                &new_size)) {
-    handler->HandleStatusUpdate(last_checked_time, progress, update_status,
-                                new_version, new_size);
-    return;
-  }
-
-  handler->IPCError("Could not query current status");
-}
-
-void UpdateEngineClientImpl::RunStatusUpdateHandler(
-    StatusUpdateHandler* h, int64_t last_checked_time, double progress,
-    const std::string& current_operation, const std::string& new_version,
-    int64_t new_size) {
-  UpdateStatus status;
-  StringToUpdateStatus(current_operation, &status);
-
-  h->HandleStatusUpdate(last_checked_time, progress, status, new_version,
-                        new_size);
-}
-
-void UpdateEngineClientImpl::RegisterStatusUpdateHandler(
-    StatusUpdateHandler* handler) {
-  if (!base::MessageLoopForIO::current()) {
-    LOG(FATAL) << "Cannot get UpdateEngineClient outside of message loop.";
-    return;
-  }
-
-  proxy_->RegisterStatusUpdateSignalHandler(
-      base::Bind(&UpdateEngineClientImpl::RunStatusUpdateHandler,
-                 base::Unretained(this), base::Unretained(handler)),
-      base::Bind(&UpdateEngineClientImpl::StatusUpdateHandlerRegistered,
-                 base::Unretained(this), base::Unretained(handler)));
-}
-
-bool UpdateEngineClientImpl::SetTargetChannel(const string& in_target_channel,
-                                              bool allow_powerwash) {
-  return proxy_->SetChannel(in_target_channel, allow_powerwash, nullptr);
-}
-
-bool UpdateEngineClientImpl::GetTargetChannel(string* out_channel) const {
-  return proxy_->GetChannel(false,  // Get the target channel.
-                            out_channel, nullptr);
-}
-
-bool UpdateEngineClientImpl::GetChannel(string* out_channel) const {
-  return proxy_->GetChannel(true,  // Get the current channel.
-                            out_channel, nullptr);
-}
-
-}  // namespace internal
-}  // namespace update_engine