Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e689ce3f authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge "libbinder_ndk: convenience method for isRemote" am: 2cb822fe

am: 3d5c7047

Change-Id: I1beae44f6845468c150d17d404a5ab49906237eb
parents 77847f7e 3d5c7047
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -69,6 +69,12 @@ public:

    // This either returns the single existing implementation or creates a new implementation.
    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
@@ -80,6 +86,8 @@ public:

    SpAIBinder asBinder() override;

    bool isRemote() override { return true; }

protected:
    // 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.
@@ -99,6 +107,8 @@ public:

    SpAIBinder asBinder() override;

    bool isRemote() override { return AIBinder_isRemote(mBinder.get()); }

private:
    SpAIBinder mBinder;
};