| syntax = "proto2"; |
| package psyche; |
| option optimize_for = LITE_RUNTIME; |
| |
| import "binder.proto"; |
| |
| message RegisterServiceRequest { |
| // Service name. |
| required string name = 1; |
| // Binder proxy for communicating with the service. |
| required protobinder.StrongBinder binder = 2; |
| } |
| |
| message RegisterServiceResponse { |
| enum Error { |
| INVALID_NAME = 1; |
| ALREADY_REGISTERED = 2; |
| } |
| } |
| |
| message RequestServiceRequest { |
| // Service name. |
| required string name = 1; |
| // Binder proxy implementing PsycheClient that will receive the service. |
| required protobinder.StrongBinder client_binder = 2; |
| } |
| |
| // Interface implemented by the psyched daemon. |
| service Psyched { |
| // Synchronously register an already-running service with psyched. |
| rpc RegisterService (RegisterServiceRequest) |
| returns (RegisterServiceResponse); |
| |
| // Asynchronously request a handle to a service. If the service is known but |
| // not yet running, it will be started. |
| rpc RequestService (RequestServiceRequest) returns (protobinder.NoResponse); |
| } |
| |
| message ReceiveServiceRequest { |
| // Service name. |
| required string name = 1; |
| // Binder proxy for communicating with the service. Empty if the service is |
| // unavailable. |
| optional protobinder.StrongBinder binder = 2; |
| } |
| |
| // Interface implemented by clients that communicate with psyched. |
| service PsycheClient { |
| // Invoked with the response to an earlier Psyched.RequestService call or when |
| // a service has been restarted and clients must begin using a new binder to |
| // communicate with it. |
| rpc ReceiveService (ReceiveServiceRequest) returns (protobinder.NoResponse); |
| } |