summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Tan <samueltan@google.com>2016-01-15 19:41:00 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-15 19:41:00 +0000
commit803589483cc44272bfbc4fd31318921ac721f0e5 (patch)
treea6c13c0bb93b0303e336544198181302a9a4d265
parentb1261d2e65e158cae029eef8e1ad21c9b84516b2 (diff)
parentb857a0f3b0cab7f2ba61fd9ac2235555c7098243 (diff)
downloadshill-803589483cc44272bfbc4fd31318921ac721f0e5.tar.gz
shill: use BinderWrapper
am: b857a0f3b0 * commit 'b857a0f3b0cab7f2ba61fd9ac2235555c7098243': shill: use BinderWrapper
-rw-r--r--Android.mk6
-rw-r--r--binder/binder_control.cc3
-rw-r--r--binder/manager_binder_adaptor.cc9
3 files changed, 12 insertions, 6 deletions
diff --git a/Android.mk b/Android.mk
index 83b6a1b4..72cb4c03 100644
--- a/Android.mk
+++ b/Android.mk
@@ -281,7 +281,7 @@ ifeq ($(SHILL_USE_BINDER), true)
LOCAL_AIDL_INCLUDES := \
system/connectivity/shill/binder \
frameworks/native/aidl/binder
-LOCAL_SHARED_LIBRARIES += libbinder libutils libbrillo-binder
+LOCAL_SHARED_LIBRARIES += libbinder libbinderwrapper libutils libbrillo-binder
LOCAL_SRC_FILES += \
adaptor_stub.cc \
binder/android/system/connectivity/shill/IDevice.aidl \
@@ -371,7 +371,7 @@ LOCAL_SHARED_LIBRARIES := \
libmetrics \
libprotobuf-cpp-lite
ifeq ($(SHILL_USE_BINDER), true)
-LOCAL_SHARED_LIBRARIES += libbinder libutils libbrillo-binder
+LOCAL_SHARED_LIBRARIES += libbinder libbinderwrapper libutils libbrillo-binder
endif # SHILL_USE_BINDER
ifdef BRILLO
LOCAL_SHARED_LIBRARIES += libhardware
@@ -554,7 +554,7 @@ LOCAL_SRC_FILES := \
vpn/mock_vpn_provider.cc \
json_store_unittest.cc
ifeq ($(SHILL_USE_BINDER), true)
-LOCAL_SHARED_LIBRARIES += libbinder libutils libbrillo-binder
+LOCAL_SHARED_LIBRARIES += libbinder libbinderwrapper libutils libbrillo-binder
else
LOCAL_SRC_FILES += \
dbus/chromeos_dbus_adaptor_unittest.cc
diff --git a/binder/binder_control.cc b/binder/binder_control.cc
index 96adbad1..75dc6984 100644
--- a/binder/binder_control.cc
+++ b/binder/binder_control.cc
@@ -18,6 +18,7 @@
#include <base/bind.h>
#include <binder/IServiceManager.h>
+#include <binderwrapper/binder_wrapper.h>
#include <brillo/binder_watcher.h>
// TODO(samueltan): remove when shill is no longer dependent on DBus proxies.
@@ -47,6 +48,7 @@
#include "shill/dbus/chromeos_supplicant_process_proxy.h"
#endif // DISABLE_WIFI || DISABLE_WIRED_8021X
+using android::BinderWrapper;
using android::defaultServiceManager;
using std::string;
using std::to_string;
@@ -60,6 +62,7 @@ BinderControl::BinderControl(EventDispatcher* dispatcher)
: next_unique_binder_adaptor_id_(0),
dispatcher_(dispatcher),
null_identifier_(kNullRpcIdentifier) {
+ BinderWrapper::Create();
// Watch Binder events in the main loop
brillo::BinderWatcher binder_watcher;
CHECK(binder_watcher.Init()) << "Binder FD watcher init failed";
diff --git a/binder/manager_binder_adaptor.cc b/binder/manager_binder_adaptor.cc
index 43ce1e6e..cfa34da5 100644
--- a/binder/manager_binder_adaptor.cc
+++ b/binder/manager_binder_adaptor.cc
@@ -16,18 +16,20 @@
#include "shill/binder/manager_binder_adaptor.h"
-#include <binder/IServiceManager.h>
#include <binder/Status.h>
+#include <binderwrapper/binder_wrapper.h>
#include <utils/String16.h>
+#include <utils/String8.h>
#include "shill/logging.h"
#include "shill/manager.h"
using android::binder::Status;
-using android::defaultServiceManager;
+using android::BinderWrapper;
using android::IBinder;
using android::sp;
using android::String16;
+using android::String8;
using android::system::connectivity::shill::IPropertyChangedCallback;
using std::string;
using std::vector;
@@ -50,7 +52,8 @@ ManagerBinderAdaptor::~ManagerBinderAdaptor() { manager_ = nullptr; }
void ManagerBinderAdaptor::RegisterAsync(
const base::Callback<void(bool)>& /*completion_callback*/) {
// Registration is performed synchronously in Binder.
- defaultServiceManager()->addService(getInterfaceDescriptor(), this);
+ BinderWrapper::Get()->RegisterService(
+ String8(getInterfaceDescriptor()).string(), this);
}
void ManagerBinderAdaptor::EmitBoolChanged(const string& name, bool /*value*/) {