Language

ControlsProviderService.PerformControlAction Method

Definition

The user has interacted with a Control.

[Android.Runtime.Register("performControlAction", "(Ljava/lang/String;Landroid/service/controls/actions/ControlAction;Ljava/util/function/Consumer;)V", "GetPerformControlAction_Ljava_lang_String_Landroid_service_controls_actions_ControlAction_Ljava_util_function_Consumer_Handler", ApiSince=30)]
public abstract void PerformControlAction(string controlId, Android.Service.Controls.Actions.ControlAction action, Java.Util.Functions.IConsumer consumer);
[<Android.Runtime.Register("performControlAction", "(Ljava/lang/String;Landroid/service/controls/actions/ControlAction;Ljava/util/function/Consumer;)V", "GetPerformControlAction_Ljava_lang_String_Landroid_service_controls_actions_ControlAction_Ljava_util_function_Consumer_Handler", ApiSince=30)>]
abstract member PerformControlAction : string * Android.Service.Controls.Actions.ControlAction * Java.Util.Functions.IConsumer -> unit

Parameters

controlId
String

The identifier of the control selected by the user.

action
ControlAction

The requested interaction, represented by a control action.

consumer
IConsumer

The callback that accepts a Java integer containing a control-action response code. Use it to report receipt or a required challenge. Publish changes to the displayed control through its state publisher, not this callback.

Attributes

Remarks

The user has interacted with a Control. The action is dictated by the type of ControlAction that was sent. A response can be sent via Consumer#accept, with the Integer argument being one of the provided ControlAction response results. The Integer should indicate whether the action was received successfully, or if additional prompts should be presented to the user. Any visual control updates should be sent via the Publisher.

By default, all invocations of this method will require the device be unlocked. This can be modified per Control by Control.StatefulBuilder#setAuthRequired.

Java documentation for android.service.controls.ControlsProviderService.performControlAction(java.lang.String, android.service.controls.actions.ControlAction, java.util.function.Consumer<java.lang.Integer>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to