mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Introduce new endpoint lifecycle interfaces for ContextHub v4
Test: build Flag: N/A Bug: 361830233 Merged-In: Iaf187213998807407a8dde38d2a6916ab44a4716 Change-Id: Iaf187213998807407a8dde38d2a6916ab44a4716
This commit is contained in:
committed by
Brian Duddie
parent
9563436f27
commit
c377627143
@@ -34,6 +34,8 @@
|
||||
package android.hardware.contexthub;
|
||||
@VintfStability
|
||||
interface IEndpointCallback {
|
||||
void onEndpointStarted(in android.hardware.contexthub.EndpointInfo[] endpointInfos);
|
||||
void onEndpointStopped(in android.hardware.contexthub.EndpointId[] endpointIds, android.hardware.contexthub.Reason reason);
|
||||
void onMessageReceived(int sessionId, in android.hardware.contexthub.Message msg);
|
||||
void onMessageDeliveryStatusReceived(int sessionId, in android.hardware.contexthub.MessageDeliveryStatus msgStatus);
|
||||
void onEndpointSessionOpenRequest(int sessionId, in android.hardware.contexthub.EndpointId destination, in android.hardware.contexthub.EndpointId initiator, in @nullable String serviceDescriptor);
|
||||
|
||||
@@ -41,5 +41,6 @@ enum Reason {
|
||||
CLOSE_ENDPOINT_SESSION_REQUESTED,
|
||||
ENDPOINT_INVALID,
|
||||
ENDPOINT_GONE,
|
||||
ENDPOINT_CRASHED,
|
||||
HUB_RESET,
|
||||
}
|
||||
|
||||
@@ -25,6 +25,34 @@ import android.hardware.contexthub.Service;
|
||||
|
||||
@VintfStability
|
||||
interface IEndpointCallback {
|
||||
/**
|
||||
* Lifecycle event notification for endpoint starting from remote side. There is no need to
|
||||
* report already started endpoint prior to the registration of an EndpointLifecycleCallbacks
|
||||
* object. The EndpointInfo reported here should be consistent with values from getEndpoints().
|
||||
*
|
||||
* Endpoints added by registerEndpoint should not be included. registerEndpoint() should not
|
||||
* cause this call.
|
||||
*
|
||||
* @param endpointInfos An array of EndpointInfo representing endpoints that just started.
|
||||
*/
|
||||
void onEndpointStarted(in EndpointInfo[] endpointInfos);
|
||||
|
||||
/**
|
||||
* Lifecycle event notification for endpoint stopping from remote side. There is no need to
|
||||
* report already stopped endpoint prior to the registration of an EndpointLifecycleCallbacks
|
||||
* object. The EndpointId reported here should represent a previously started Endpoint.
|
||||
*
|
||||
* When a hub crashes or restart, events should be batched into be a single call (containing all
|
||||
* the EndpointId that were impacted).
|
||||
*
|
||||
* Endpoints added by registerEndpoint should not be included. unregisterEndpoint() should not
|
||||
* cause this call.
|
||||
*
|
||||
* @param endpointIds An array of EndpointId representing endpoints that just stopped.
|
||||
* @param reason The reason for why the endpoints stopped.
|
||||
*/
|
||||
void onEndpointStopped(in EndpointId[] endpointIds, Reason reason);
|
||||
|
||||
/**
|
||||
* Invoked when an endpoint sends message to another endpoint (on host) on the (currently open)
|
||||
* session.
|
||||
|
||||
@@ -54,6 +54,11 @@ enum Reason {
|
||||
*/
|
||||
ENDPOINT_GONE,
|
||||
|
||||
/**
|
||||
* Endpoint crashed.
|
||||
*/
|
||||
ENDPOINT_CRASHED,
|
||||
|
||||
/**
|
||||
* Hub was reset or is resetting.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user