In checkIncidentPermissions(), the intention of code is to bail out when the caller do not have appropriate permission. Logically, DEST_LOCAL and DEST_EXPLICIT should be checked separately. In the current code, we would fall-through to DEST_EXPLICIT case, but because permitted DEST_LOCAL callers (AID_SHELL and AID_ROOT) are also permitted DEST_EXPLICIT callers, we will still get the Status:ok(). Test: build Change-Id: I0f6121cb1aba7724306b99469f5ef97b4358ac7d
incidentd
How to build, deploy, unit test
For the first time, build the test and create an empty directly on device:
root$ make -j incidentd_test && adb shell mkdir /data/nativetest/incidentd_test
Run the test on a device manually
root$ mmm -j frameworks/base/cmds/incidentd && \
adb push $OUT/data/nativetest/incidentd_test/* /data/nativetest/ && \
adb shell /data/nativetest/incidentd_test 2>/dev/null
Run the test via AndroidTest.xml
root$ atest incidentd_test
Use clang-format to style the file
clang-format -style=file -i