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

Commit 4bff5965 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Expose display manager client event fd"

parents 95d45fd5 c8c6860e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -41,6 +41,23 @@ void dvrDisplayManagerClientDestroy(DvrDisplayManagerClient* client) {
  delete client;
}

int dvrDisplayManagerClientGetEventFd(DvrDisplayManagerClient* client) {
  return client->client->event_fd();
}

int dvrDisplayManagerClientTranslateEpollEventMask(
    DvrDisplayManagerClient* client, int in_events, int* out_events) {
  auto result = client->client->GetChannel()->GetEventMask(in_events);

  if (!result) {
    return -EIO;
  }

  *out_events = result.get();

  return 0;
}

int dvrDisplayManagerClientGetSurfaceList(
    DvrDisplayManagerClient* client,
    DvrDisplayManagerClientSurfaceList** surface_list) {
+15 −0
Original line number Diff line number Diff line
@@ -19,6 +19,21 @@ DvrDisplayManagerClient* dvrDisplayManagerClientCreate();

void dvrDisplayManagerClientDestroy(DvrDisplayManagerClient* client);

// Return an event fd for checking if there was an event on the server
// Note that the only event which will be flagged is POLLIN. You must use
// dvrDisplayManagerClientTranslateEpollEventMask in order to get the real
// event flags.
// @return the fd
int dvrDisplayManagerClientGetEventFd(DvrDisplayManagerClient* client);

// Once you have received an epoll event, you must translate it to its true
// flags. This is a workaround for working with UDS.
// @param in_events pass in the epoll revents that were initially returned
// @param on success, this value will be overwritten with the true epoll values
// @return 0 on success, non-zero otherwise
int dvrDisplayManagerClientTranslateEpollEventMask(
    DvrDisplayManagerClient* client, int in_events, int* out_events);

// If successful, populates |surface_list| with a list of application
// surfaces the display is currently using.
//
+3 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ class DisplayManagerClient : public pdx::ClientBase<DisplayManagerClient> {
  int GetSurfaceBuffers(
      int surface_id, std::vector<std::unique_ptr<BufferConsumer>>* consumers);

  using Client::event_fd;
  using Client::GetChannel;

 private:
  friend BASE;