Loading core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -10565,6 +10565,7 @@ package android.service.voice { method public void onDetect(@NonNull android.service.voice.AlwaysOnHotwordDetector.EventPayload, long, @NonNull android.service.voice.HotwordDetectionService.Callback); method public void onDetect(@NonNull android.service.voice.HotwordDetectionService.Callback); method public void onDetect(@NonNull android.os.ParcelFileDescriptor, @NonNull android.media.AudioFormat, @Nullable android.os.PersistableBundle, @NonNull android.service.voice.HotwordDetectionService.Callback); method public void onStopDetection(); method public void onUpdateState(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, long, @Nullable java.util.function.IntConsumer); field public static final int INITIALIZATION_STATUS_SUCCESS = 0; // 0x0 field public static final int INITIALIZATION_STATUS_UNKNOWN = 100; // 0x64 core/java/android/service/voice/HotwordDetectionService.java +14 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,11 @@ public abstract class HotwordDetectionService extends Service { mContentCaptureManager = new ContentCaptureManager( HotwordDetectionService.this, manager, options); } @Override public void stopDetection() { HotwordDetectionService.this.onStopDetection(); } }; @Override Loading Loading @@ -348,6 +353,15 @@ public abstract class HotwordDetectionService extends Service { onUpdateState(options, sharedMemory, UPDATE_TIMEOUT_MILLIS, intConsumer); } /** * Called when the {@link VoiceInteractionService} * {@link HotwordDetector#stopRecognition() requests} that hotword recognition be stopped. * <p> * Any open {@link android.media.AudioRecord} should be closed here. */ public void onStopDetection() { } /** * Callback for returning the detection result. * Loading core/java/android/service/voice/IHotwordDetectionService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -53,4 +53,6 @@ oneway interface IHotwordDetectionService { void updateContentCaptureManager( in IContentCaptureManager contentCaptureManager, in ContentCaptureOptions options); void stopDetection(); } services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java +2 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,8 @@ final class HotwordDetectionConnection { Slog.d(TAG, "stopListening"); } mRemoteHotwordDetectionService.run(service -> service.stopDetection()); synchronized (mLock) { if (mCurrentAudioSink != null) { Slog.i(TAG, "Closing audio stream to hotword detector: stopping requested"); Loading Loading
core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -10565,6 +10565,7 @@ package android.service.voice { method public void onDetect(@NonNull android.service.voice.AlwaysOnHotwordDetector.EventPayload, long, @NonNull android.service.voice.HotwordDetectionService.Callback); method public void onDetect(@NonNull android.service.voice.HotwordDetectionService.Callback); method public void onDetect(@NonNull android.os.ParcelFileDescriptor, @NonNull android.media.AudioFormat, @Nullable android.os.PersistableBundle, @NonNull android.service.voice.HotwordDetectionService.Callback); method public void onStopDetection(); method public void onUpdateState(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, long, @Nullable java.util.function.IntConsumer); field public static final int INITIALIZATION_STATUS_SUCCESS = 0; // 0x0 field public static final int INITIALIZATION_STATUS_UNKNOWN = 100; // 0x64
core/java/android/service/voice/HotwordDetectionService.java +14 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,11 @@ public abstract class HotwordDetectionService extends Service { mContentCaptureManager = new ContentCaptureManager( HotwordDetectionService.this, manager, options); } @Override public void stopDetection() { HotwordDetectionService.this.onStopDetection(); } }; @Override Loading Loading @@ -348,6 +353,15 @@ public abstract class HotwordDetectionService extends Service { onUpdateState(options, sharedMemory, UPDATE_TIMEOUT_MILLIS, intConsumer); } /** * Called when the {@link VoiceInteractionService} * {@link HotwordDetector#stopRecognition() requests} that hotword recognition be stopped. * <p> * Any open {@link android.media.AudioRecord} should be closed here. */ public void onStopDetection() { } /** * Callback for returning the detection result. * Loading
core/java/android/service/voice/IHotwordDetectionService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -53,4 +53,6 @@ oneway interface IHotwordDetectionService { void updateContentCaptureManager( in IContentCaptureManager contentCaptureManager, in ContentCaptureOptions options); void stopDetection(); }
services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java +2 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,8 @@ final class HotwordDetectionConnection { Slog.d(TAG, "stopListening"); } mRemoteHotwordDetectionService.run(service -> service.stopDetection()); synchronized (mLock) { if (mCurrentAudioSink != null) { Slog.i(TAG, "Closing audio stream to hotword detector: stopping requested"); Loading