diff options
| author | 2021-04-21 22:02:01 +0000 | |
|---|---|---|
| committer | 2021-04-21 22:02:01 +0000 | |
| commit | c9a99af53a5293c60e2f5dedb57a95c860fd67c5 (patch) | |
| tree | 6dc693afee27d35a818b41a01182340ce397b12e | |
| parent | cd1a5490ec994f4eb3ab305c5554d372d02dab4a (diff) | |
| parent | 50fc90652126bd6840ff8b133a1c1bee67b9fe54 (diff) | |
Merge "Create a callback method to invoke when the hotword detector is restarted." into sc-dev
| -rw-r--r-- | core/api/system-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/service/voice/AlwaysOnHotwordDetector.java | 9 | ||||
| -rw-r--r-- | core/java/android/service/voice/HotwordDetector.java | 8 |
3 files changed, 19 insertions, 0 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index eadf8125da87..8cf008a4b322 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -10495,6 +10495,7 @@ package android.service.voice { ctor public AlwaysOnHotwordDetector.Callback(); method public abstract void onAvailabilityChanged(int); method public void onHotwordDetectionServiceInitialized(int); + method public void onHotwordDetectionServiceRestarted(); method public void onRejected(@Nullable android.service.voice.HotwordRejectedResult); } @@ -10571,6 +10572,7 @@ package android.service.voice { method public void onDetected(@NonNull android.service.voice.AlwaysOnHotwordDetector.EventPayload); method public void onError(); method public void onHotwordDetectionServiceInitialized(int); + method public void onHotwordDetectionServiceRestarted(); method public void onRecognitionPaused(); method public void onRecognitionResumed(); method public void onRejected(@Nullable android.service.voice.HotwordRejectedResult); diff --git a/core/java/android/service/voice/AlwaysOnHotwordDetector.java b/core/java/android/service/voice/AlwaysOnHotwordDetector.java index a3e00fb8fdc0..3c53e8f305ae 100644 --- a/core/java/android/service/voice/AlwaysOnHotwordDetector.java +++ b/core/java/android/service/voice/AlwaysOnHotwordDetector.java @@ -535,6 +535,15 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { */ public void onHotwordDetectionServiceInitialized(@InitializationStatus int status) { } + + /** + * Called with the {@link HotwordDetectionService} is restarted. + * + * Clients are expected to call {@link HotwordDetector#updateState} to share the state with + * the newly created service. + */ + public void onHotwordDetectionServiceRestarted() { + } } /** diff --git a/core/java/android/service/voice/HotwordDetector.java b/core/java/android/service/voice/HotwordDetector.java index ab7d9cd5ae5c..2fb4dbc835ed 100644 --- a/core/java/android/service/voice/HotwordDetector.java +++ b/core/java/android/service/voice/HotwordDetector.java @@ -169,5 +169,13 @@ public interface HotwordDetector { * @param status Info about initialization state of {@link HotwordDetectionService}. */ void onHotwordDetectionServiceInitialized(@InitializationStatus int status); + + /** + * Called with the {@link HotwordDetectionService} is restarted. + * + * Clients are expected to call {@link HotwordDetector#updateState} to share the state with + * the newly created service. + */ + void onHotwordDetectionServiceRestarted(); } } |