Documentation
¶
Overview ¶
Register a Go service with the ServiceManager and call it back.
Demonstrates implementing binder.TransactionReceiver — the server-side binder interface — and registering it via AddService. When running in a restricted SELinux context (e.g. shell), AddService will be denied; in that case the example falls back to an in-process self-test that exercises the same OnTransaction code path.
Build:
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o build/server_service ./examples/server_service/ adb push build/server_service /data/local/tmp/ && adb shell /data/local/tmp/server_service
Click to show internal directories.
Click to hide internal directories.