1================================================================================================== 2aidl_lazy_test 3================================================================================================== 4This test can be run in one of two ways: 5 6-------------------------------------------- 7Without arguments: aidl_lazy_test 8-------------------------------------------- 9This will run tests on the test service (described below), the goal being to test the dynamic 10service infrastructure. 11 12-------------------------------------------- 13With a service: aidl_lazy_test serviceName... 14-------------------------------------------- 15This will run tests on the input service, verifying whether it successfully displays lazy behavior. 16If the service has multiple interfaces, each can be entered as a separate argument to be tested 17simultaneously. 18Infrastructure tests that rely on specific features of the dedicated test service will be skipped. 19 20================================================================================================== 21aidl_lazy_test_server 22================================================================================================== 23aidl_lazy_test_server is a simple test service. 24 25Because it represents the bare minimum requirements for implementing a service, it also serves as 26an example of how to add a new service. The required files are as follows: 27 28============================================ 29In this directory 30============================================ 31-------------------------------------------- 32server.cpp 33-------------------------------------------- 34The implementation of the server. The only required function is main(), wherein the service must be 35instantiated and added (either to servicemanager as a standard service or to LazyServiceRegistrar 36to be a dynamic service). The server then joins the thread pool. 37 38-------------------------------------------- 39aidl_lazy_test_server.rc 40-------------------------------------------- 41This file is read by init, which later starts the service. The interface, oneshot, and disabled 42lines are only required for dynamic services. 43 44-------------------------------------------- 45LazyTestService.h/.cpp 46-------------------------------------------- 47The implementation of the service's functionality. 48 49-------------------------------------------- 50ILazyTestService.aidl 51-------------------------------------------- 52The AIDL interface for the service, this will generate code that clients can use to interact with 53the service via IPC. 54 55-------------------------------------------- 56Android.bp 57-------------------------------------------- 58An aidl_interface entry will need to be added for the .aidl file. 59 60A cc_binary entry will need to be added for the service with: 61name 62srcs - The source file(s) 63init_rc - The .rc file 64shared_libs - Any shared libraries the source file depends on 65static_libs - The AIDL interface 66 67============================================ 68In system/sepolicy 69============================================ 70-------------------------------------------- 71private/aidl_lazy_test_server.te 72-------------------------------------------- 73Only two lines are required in this file. 74 75-------------------------------------------- 76public/aidl_lazy_test_server.te 77-------------------------------------------- 78The first two lines establish types for aidl_lazy_test_server and aidl_lazy_test_server_exec. 79binder_use and binder_call allow for basic use of this service. 80add_service allows the service to be registered. Note that an additional service type is required 81as the second argument to this function. 82 83-------------------------------------------- 84private/compat/<number>/<number>.ignore.cil 85-------------------------------------------- 86aidl_lazy_test_server and aidl_lazy_test_server_exec, and aidl_lazy_test_service need to be added 87to the new objects list. 88 89-------------------------------------------- 90private/file_contexts 91-------------------------------------------- 92A line is required to map aidl_lazy_test_server to aidl_lazy_test_server_exec. 93 94-------------------------------------------- 95private/service_contexts 96-------------------------------------------- 97Each interface for the service must be mapped to aidl_lazy_test_service here. 98 99-------------------------------------------- 100public/service.te 101-------------------------------------------- 102A line is required to define aidl_lazy_test_service. 103