RemoteGesturesClient

@DoNotMock(value = "Use canonical fakes instead.")
public interface RemoteGesturesClient extends HasApiKey


A client for interacting with the Gestures API. This interface provides methods to register and unregister listeners for gesture events that occur on specified producer devices.

Summary

Public methods

abstract Task<Void>
@RequiresApi(value = 36)
registerGestureProducer(
    @NonNull GestureProducerParams params,
    @NonNull Executor executor,
    @NonNull GestureProducer producer
)

Registers an external GestureProducer to inject GestureEvent objects into Google Play services.

abstract Task<Void>

Unregisters a previously registered GestureProducer.

Inherited methods

From com.google.android.gms.common.api.HasApiKey
abstract ApiKey<O>

Public methods

registerGestureProducer

@RequiresApi(value = 36)
abstract Task<Void> registerGestureProducer(
    @NonNull GestureProducerParams params,
    @NonNull Executor executor,
    @NonNull GestureProducer producer
)

Registers an external GestureProducer to inject GestureEvent objects into Google Play services.

Hardware manufacturers and external gesture producers can use this API to provide custom gesture events. The app providing the producer must be a companion app, and the caller must have a valid android.companion.CompanionDeviceManager association with the device. This association is verified via the provided GestureProducerParams.

Parameters
@NonNull GestureProducerParams params

Configuration parameters containing the android.companion.DeviceId.

@NonNull Executor executor

The Executor on which callbacks to the GestureProducer are invoked.

@NonNull GestureProducer producer

The GestureProducer implementation to register.

Returns
Task<Void>

A Task that completes when the registration is successful.

unregisterGestureProducer

@RequiresApi(value = 36)
abstract Task<Void> unregisterGestureProducer(@NonNull GestureProducer producer)

Unregisters a previously registered GestureProducer.

Parameters
@NonNull GestureProducer producer

The GestureProducer to unregister.

Returns
Task<Void>

A Task that completes when the GestureProducer is successfully unregistered.