Is it possible to use C++ Binder API to communicate between two non-privileged processes?
All examples I found (e.g. https://github.com/mcr/Android-HelloWorldService) rely on registering service via ServiceManager->addService()
which throws following error when executing on a non-rooted phone:
E/ServiceManager﹕ add_service('my.test.service',0x48) uid=2000 - PERMISSION DENIED
Inside the AOSP (Android Open Source Project) in the file frameworks/native/cmds/servicemanager/service_manager.c you can find the following method:
and a bit above:
and further down:
Conclusion: the system binary in /system/bin/servicemanager doesn't allow it. (for security reasons) Possible solutions: