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

Commit 7dc29739 authored by Jason Simmons's avatar Jason Simmons Committed by Mike Lockwood
Browse files

Add a getEndpointInfo accessor to AIDL-generated RPC proxy classes

parent 5c55a051
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -293,6 +293,7 @@ public:

private:
    void generate_ctor();
    void generate_get_endpoint_info();
};

RpcProxyClass::RpcProxyClass(const interface_type* iface, InterfaceType* interfaceType)
@@ -312,6 +313,7 @@ RpcProxyClass::RpcProxyClass(const interface_type* iface, InterfaceType* interfa

    // methods
    generate_ctor();
    generate_get_endpoint_info();
}

RpcProxyClass::~RpcProxyClass()
@@ -335,6 +337,19 @@ RpcProxyClass::generate_ctor()
    ctor->statements->Add(new Assignment(this->endpoint, endpoint));
}

void
RpcProxyClass::generate_get_endpoint_info()
{
    Method* get = new Method;
    get->modifiers = PUBLIC;
    get->returnType = RPC_ENDPOINT_INFO_TYPE;
    get->name = "getEndpointInfo";
    get->statements = new StatementBlock;
    this->elements.push_back(get);

    get->statements->Add(new ReturnStatement(this->endpoint));
}

// =================================================
class EventListenerClass : public DispatcherClass
{