Loading include/binderwrapper/binder_wrapper.h +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ class BBinder; class IBinder; // Wraps libbinder to make it testable. // NOTE: Static methods of this class are not thread-safe. class BinderWrapper { public: virtual ~BinderWrapper() {} Loading @@ -50,6 +51,10 @@ class BinderWrapper { // InitForTesting(). static BinderWrapper* Get(); // Returns the singleton instance if it was previously created by Create() or // set by InitForTesting(), or creates a new one by calling Create(). static BinderWrapper* GetOrCreateInstance(); // Gets the binder for communicating with the service identified by // |service_name|, returning null immediately if it doesn't exist. virtual sp<IBinder> GetService(const std::string& service_name) = 0; Loading libbinderwrapper/binder_wrapper.cc +7 −0 Original line number Diff line number Diff line Loading @@ -50,4 +50,11 @@ BinderWrapper* BinderWrapper::Get() { return instance_; } // static BinderWrapper* BinderWrapper::GetOrCreateInstance() { if (!instance_) instance_ = new RealBinderWrapper(); return instance_; } } // namespace android Loading
include/binderwrapper/binder_wrapper.h +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ class BBinder; class IBinder; // Wraps libbinder to make it testable. // NOTE: Static methods of this class are not thread-safe. class BinderWrapper { public: virtual ~BinderWrapper() {} Loading @@ -50,6 +51,10 @@ class BinderWrapper { // InitForTesting(). static BinderWrapper* Get(); // Returns the singleton instance if it was previously created by Create() or // set by InitForTesting(), or creates a new one by calling Create(). static BinderWrapper* GetOrCreateInstance(); // Gets the binder for communicating with the service identified by // |service_name|, returning null immediately if it doesn't exist. virtual sp<IBinder> GetService(const std::string& service_name) = 0; Loading
libbinderwrapper/binder_wrapper.cc +7 −0 Original line number Diff line number Diff line Loading @@ -50,4 +50,11 @@ BinderWrapper* BinderWrapper::Get() { return instance_; } // static BinderWrapper* BinderWrapper::GetOrCreateInstance() { if (!instance_) instance_ = new RealBinderWrapper(); return instance_; } } // namespace android