Add SensorServiceProto for protobuf dumpsys of sensorservice. Primarily used by incident service to capture an incident report proto. Also add a gensrc rule to generate cpp headers of frameworks proto to be used by native services like sensorservice. Added "static" qualifier to a few generated fields in the header to avoid linker conflict. Command to invoke (any of the following after lunch and env setup): $ adb shell dumpsys sensorservice --proto $ adb shell incident 3053 $ incident_report 3053 Bug: 146086105 Test: Execute the above commands and compare the output against dumpsys sensorservice Change-Id: I282ff37bd3e845464d0693d69fc0d82943cc9855
incident_helper
It is an executable used to help parsing text format data to protobuf.
How to build, deploy, unit test
For the first time, build the test and create an empty directly on device:
root$ make -j incident_helper_test && adb shell mkdir /data/nativetest64/incident_helper_test
Run the test on a device
root$ mmm -j frameworks/base/cmds/incident_helper && \
adb push $OUT/data/nativetest64/incident_helper_test/* /data/nativetest64/incident_helper_test/ && \
adb shell /data/nativetest64/incident_helper_test/incident_helper_test 2>/dev/null
How to adapt proto changes
If add a new proto file, add it in Android.bp under frameworks/base/ and make incident helper
root$ make -j48 incident_helper