28e980b59c8e309d248b361829ed34408632720f |
|
20-Dec-2016 |
Jorge Lucangeli Obes <jorgelo@google.com> |
Add a sample service for testing init. I find myself using something like this every time I add functionality to init. I cannot possibly be the only one doing this. On the other hand, if this hasn't been added for so long, maybe there's a reason for that. The advantage of using a test service versus modifying an existing service is that the test service doesn't *require* any permissions or privileges, so you can add and/or remove whatever you need to test without breaking the service. I found it useful to have the service check its own /proc/<pid>/status from command-line arguments, so that's what the service does. This CL also adds a .clang-format file for init. Bug: None Test: Service runs and exits successfully. Change-Id: I3e7841a7283158e10c0bf55e0103c03902afb1f0
/system/core/init/test_service/test_service.cpp
|