ModelDownloadListener
interface ModelDownloadListener
| android.speech.ModelDownloadListener |
Listener for model download events. It makes RecognitionService let callers know about the progress of model download for a single recognition request.
Summary
| Public methods | |
|---|---|
| abstract Unit |
A network or scheduling error occurred. |
| abstract Unit |
onProgress(completedPercent: Int)Called by |
| abstract Unit |
Called when |
| abstract Unit |
This method is called: RecognitionService has started and completed the download.
Once this method is called, the model can be safely used to satisfy recognition requests. |
Public methods
onError
abstract fun onError(error: Int): Unit
A network or scheduling error occurred.
onProgress
abstract fun onProgress(completedPercent: Int): Unit
Called by RecognitionService only if the download has started after the request.
The number of calls to this method varies depending of the RecognitionService implementation. If the download finished quickly enough, onSuccess() may be called directly. In other cases, this method may be called any number of times during the download.
| Parameters | |
|---|---|
completedPercent |
Int: the percentage of download that is completed |
onScheduled
abstract fun onScheduled(): Unit
Called when RecognitionService scheduled the download, but won't satisfy it immediately. There will be no further updates on this listener.
onSuccess
abstract fun onSuccess(): Unit
This method is called:
RecognitionService has started and completed the download.
Once this method is called, the model can be safely used to satisfy recognition requests.