diff options
author | Samuel Tan <samueltan@google.com> | 2016-01-15 19:41:00 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-01-15 19:41:00 +0000 |
commit | 803589483cc44272bfbc4fd31318921ac721f0e5 (patch) | |
tree | a6c13c0bb93b0303e336544198181302a9a4d265 | |
parent | b1261d2e65e158cae029eef8e1ad21c9b84516b2 (diff) | |
parent | b857a0f3b0cab7f2ba61fd9ac2235555c7098243 (diff) | |
download | shill-803589483cc44272bfbc4fd31318921ac721f0e5.tar.gz |
shill: use BinderWrapper
am: b857a0f3b0
* commit 'b857a0f3b0cab7f2ba61fd9ac2235555c7098243':
shill: use BinderWrapper
-rw-r--r-- | Android.mk | 6 | ||||
-rw-r--r-- | binder/binder_control.cc | 3 | ||||
-rw-r--r-- | binder/manager_binder_adaptor.cc | 9 |
3 files changed, 12 insertions, 6 deletions
@@ -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*/) { |