Loading libs/binder/ndk/include_ndk/android/binder_interface_utils.h +10 −0 Original line number Original line Diff line number Diff line Loading @@ -69,6 +69,12 @@ public: // This either returns the single existing implementation or creates a new implementation. // This either returns the single existing implementation or creates a new implementation. virtual SpAIBinder asBinder() = 0; virtual SpAIBinder asBinder() = 0; /** * Returns whether this interface is in a remote process. If it cannot be determined locally, * this will be checked using AIBinder_isRemote. */ virtual bool isRemote() = 0; }; }; // wrapper analog to BnInterface // wrapper analog to BnInterface Loading @@ -80,6 +86,8 @@ public: SpAIBinder asBinder() override; SpAIBinder asBinder() override; bool isRemote() override { return true; } protected: protected: // This function should only be called by asBinder. Otherwise, there is a possibility of // This function should only be called by asBinder. Otherwise, there is a possibility of // multiple AIBinder* objects being created for the same instance of an object. // multiple AIBinder* objects being created for the same instance of an object. Loading @@ -99,6 +107,8 @@ public: SpAIBinder asBinder() override; SpAIBinder asBinder() override; bool isRemote() override { return AIBinder_isRemote(mBinder.get()); } private: private: SpAIBinder mBinder; SpAIBinder mBinder; }; }; Loading Loading
libs/binder/ndk/include_ndk/android/binder_interface_utils.h +10 −0 Original line number Original line Diff line number Diff line Loading @@ -69,6 +69,12 @@ public: // This either returns the single existing implementation or creates a new implementation. // This either returns the single existing implementation or creates a new implementation. virtual SpAIBinder asBinder() = 0; virtual SpAIBinder asBinder() = 0; /** * Returns whether this interface is in a remote process. If it cannot be determined locally, * this will be checked using AIBinder_isRemote. */ virtual bool isRemote() = 0; }; }; // wrapper analog to BnInterface // wrapper analog to BnInterface Loading @@ -80,6 +86,8 @@ public: SpAIBinder asBinder() override; SpAIBinder asBinder() override; bool isRemote() override { return true; } protected: protected: // This function should only be called by asBinder. Otherwise, there is a possibility of // This function should only be called by asBinder. Otherwise, there is a possibility of // multiple AIBinder* objects being created for the same instance of an object. // multiple AIBinder* objects being created for the same instance of an object. Loading @@ -99,6 +107,8 @@ public: SpAIBinder asBinder() override; SpAIBinder asBinder() override; bool isRemote() override { return AIBinder_isRemote(mBinder.get()); } private: private: SpAIBinder mBinder; SpAIBinder mBinder; }; }; Loading