Android APIs
public static abstract class

AlwaysOnHotwordDetector.Callback

extends Object
java.lang.Object
   ↳ android.service.voice.AlwaysOnHotwordDetector.Callback

Class Overview

Callbacks for always-on hotword detection.

Summary

Public Constructors
AlwaysOnHotwordDetector.Callback()
Public Methods
abstract void onAvailabilityChanged(int status)
Called when the hotword availability changes.
abstract void onDetected(AlwaysOnHotwordDetector.EventPayload eventPayload)
Called when the keyphrase is spoken.
abstract void onError()
Called when the detection fails due to an error.
abstract void onRecognitionPaused()
Called when the recognition is paused temporarily for some reason.
abstract void onRecognitionResumed()
Called when the recognition is resumed after it was temporarily paused.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AlwaysOnHotwordDetector.Callback ()

Added in API level 21

Public Methods

public abstract void onAvailabilityChanged (int status)

Added in API level 21

Called when the hotword availability changes. This indicates a change in the availability of recognition for the given keyphrase. It's called at least once with the initial availability.

Availability implies whether the hardware on this system is capable of listening for the given keyphrase or not.

public abstract void onDetected (AlwaysOnHotwordDetector.EventPayload eventPayload)

Added in API level 21

Called when the keyphrase is spoken. This implicitly stops listening for the keyphrase once it's detected. Clients should start a recognition again once they are done handling this detection.

Parameters
eventPayload Payload data for the detection event. This may contain the trigger audio, if requested when calling startRecognition(int).

public abstract void onError ()

Added in API level 21

Called when the detection fails due to an error.

public abstract void onRecognitionPaused ()

Added in API level 21

Called when the recognition is paused temporarily for some reason. This is an informational callback, and the clients shouldn't be doing anything here except showing an indication on their UI if they have to.

public abstract void onRecognitionResumed ()

Added in API level 21

Called when the recognition is resumed after it was temporarily paused. This is an informational callback, and the clients shouldn't be doing anything here except showing an indication on their UI if they have to.