Add SurfaceInterceptor initial implementation
SurfaceInterceptor allows capturing streams of surface updates
that come into SurfaceFlinger. It captures the creation and
deletion of surfaces, changes to a surface like size or position,
buffer updates, and hw vsync updates (for a complete list of what
is captured see
/frameworks/native/cmds/surfacecapturereplay/proto/src/trace.proto)
SurfaceInterceptor uses a protocol buffer object to store each
trace. This allows for the produced trace to be either played back
into SurfaceFlinger or manually inspected.
To enable the interceptor: service call SurfaceFlinger 1020 i32 1
To disable the interceptor: service call SurfaceFlinger 1020 i32 0
Each trace file will be saved to /data/SurfaceTrace.dat
For SurfaceInterceptor to work SELinux must be set to permissive.
Change-Id: I5adff9dcd19456d86cfd5b1f51096dff9990e086
diff --git a/services/surfaceflinger/tests/Android.mk b/services/surfaceflinger/tests/Android.mk
index 979062e..e5dffe5 100644
--- a/services/surfaceflinger/tests/Android.mk
+++ b/services/surfaceflinger/tests/Android.mk
@@ -3,21 +3,29 @@
include $(CLEAR_VARS)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_CFLAGS := -std=c++14
+
LOCAL_MODULE := SurfaceFlinger_test
LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := \
Transaction_test.cpp \
+ SurfaceInterceptor_test.cpp
LOCAL_SHARED_LIBRARIES := \
- libEGL \
- libGLESv2 \
- libbinder \
- libcutils \
- libgui \
- libui \
- libutils \
+ libEGL \
+ libGLESv2 \
+ libbinder \
+ libcutils \
+ libgui \
+ libprotobuf-cpp-full \
+ libui \
+ libutils \
+
+LOCAL_STATIC_LIBRARIES := libtrace_proto
+
+LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
# Build the binary to $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
# to integrate with auto-test framework.