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

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

Merge "libbinder_ndk: convenience method for isRemote"

am: 2cb822fe

Change-Id: I4c730553a55f78a09ae9147ee6c2ec92a96f33ea
parents 58edc4c7 2cb822fe
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;
};