0

I would like to write a userspace program to talk to SurfaceFlinger and call its dump function. How can I access SurfaceFlinger and make such a call from my C++ program?

I know that SurfaceFlinger is instantiated in main_surfaceflinger.cpp and is published. I don't know how to use it in my C++ program.

Matt
  • 796
  • 12
  • 25
  • You can either exec `dumpsys SurfaceFlinger`, or you can talk to SurfaceFlinger through Binder IPC the way that dumpsys does: https://android.googlesource.com/platform/frameworks/native/+/lollipop-mr1-release/cmds/dumpsys/dumpsys.cpp – fadden Aug 13 '15 at 15:09
  • @fadden I tried to write a program to do what you mentioned. However, when I want to compile it with Android NDK, I face an error that utils/Logs.h could not be found (no such file or directory) – Matt Aug 19 '15 at 05:34
  • Have you checked https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer for graphics related API? – Brad Chou Jul 19 '18 at 06:47

0 Answers0