This project is to simulate 3rd party library/daemon use KaiOS AIDL interface.
Please refer generic/classic/ServerTest.cpp
for service sample code.
(or generic/inherit/InheritServerTest.cpp
for inherit service class)
ServerTest
acts as a BnConnectivity and also expose it as a service to system with name KaiOSServerTest
IheritServerTest
acts as a inherit class so you may worry less about build break during aidl code merge process.
Please refer generic/Main.cpp
Client mode for client sample code.
This sample code accesses Kai system api IConnectivity
- Unmark one of following build flag in Android.bp to enable test daemon. REAL_SERVER_TEST will only activate client mode and try to reach DUT's server. CLASSIC_TEST need to implement both client/server and test the interactive between them. INHERIT_TEST is simular with CLASSIC_TEST, but test inherit abilities with aidl share library "binder_b2g_stub".
// Choose the test case you need.
// "-DREAL_SERVER_TEST",
// "-DCLASSIC_TEST",
// "-DINHERIT_TEST",
- build test binary
./build.sh kaios_aidl_testing
- Push this daemon into device directly.
adb root;adb remount;
adb push out/target/product/<ProjectName>/system/bin/kaios_aidl_testing /system/bin/.
- Run the daemon and start the server/client test you need.
kaios_aidl_testing accept one argument to indicate client or server mode.
- adb shell kaios_aidl_testing server
- adb shell kaios_aidl_testing client
- You shall able to see the interactive between server & client, Log will dump in android log, you may monitor by :
adb logcat |grep -E "KaiOS_AIDL_"
- Rewrite test tool to adapt your own module. Try to check the term under "generic" folder
REWRITE_BY_YOURSELF
Then you shall find the part which you may replace by your module. Go through step 1 - 4, you have your own test daemon now! Please check "connectivity" or "wifi" folder for rewrite sample.