Loading core/java/android/service/voice/VoiceInteractionService.java +1 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,7 @@ public class VoiceInteractionService extends Service { /** * Called during service de-initialization to tell you when the system is shutting the * service down. * At this point this service may no longer be the active {@link VoiceInteractionService}. */ public void onShutdown() { } Loading services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java +24 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,30 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } } synchronized void stopAllRecognitions() { if (moduleProperties == null || mModule == null) { return; } if (mCurrentSoundModelHandle == INVALID_SOUND_MODEL_HANDLE) { return; } int status = mModule.stopRecognition(mCurrentSoundModelHandle); if (status != SoundTrigger.STATUS_OK) { Slog.w(TAG, "stopRecognition call failed with " + status); } status = mModule.unloadSoundModel(mCurrentSoundModelHandle); if (status != SoundTrigger.STATUS_OK) { Slog.w(TAG, "unloadSoundModel call failed with " + status); } mCurrentSoundModelHandle = INVALID_SOUND_MODEL_HANDLE; mCurrentSoundModelUuid = null; mActiveListeners.clear(); } //---- SoundTrigger.StatusListener methods @Override public void onRecognition(RecognitionEvent event) { Loading services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +1 −3 Original line number Diff line number Diff line Loading @@ -49,9 +49,6 @@ import com.android.server.UiThread; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.List; import java.util.UUID; /** * SystemService that publishes an IVoiceInteractionManagerService. Loading Loading @@ -151,6 +148,7 @@ public class VoiceInteractionManagerService extends SystemService { } if (force || mImpl == null || mImpl.mUser != mCurUser || !mImpl.mComponent.equals(serviceComponent)) { mSoundTriggerHelper.stopAllRecognitions(); if (mImpl != null) { mImpl.shutdownLocked(); } Loading Loading
core/java/android/service/voice/VoiceInteractionService.java +1 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,7 @@ public class VoiceInteractionService extends Service { /** * Called during service de-initialization to tell you when the system is shutting the * service down. * At this point this service may no longer be the active {@link VoiceInteractionService}. */ public void onShutdown() { } Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java +24 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,30 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } } synchronized void stopAllRecognitions() { if (moduleProperties == null || mModule == null) { return; } if (mCurrentSoundModelHandle == INVALID_SOUND_MODEL_HANDLE) { return; } int status = mModule.stopRecognition(mCurrentSoundModelHandle); if (status != SoundTrigger.STATUS_OK) { Slog.w(TAG, "stopRecognition call failed with " + status); } status = mModule.unloadSoundModel(mCurrentSoundModelHandle); if (status != SoundTrigger.STATUS_OK) { Slog.w(TAG, "unloadSoundModel call failed with " + status); } mCurrentSoundModelHandle = INVALID_SOUND_MODEL_HANDLE; mCurrentSoundModelUuid = null; mActiveListeners.clear(); } //---- SoundTrigger.StatusListener methods @Override public void onRecognition(RecognitionEvent event) { Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +1 −3 Original line number Diff line number Diff line Loading @@ -49,9 +49,6 @@ import com.android.server.UiThread; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.List; import java.util.UUID; /** * SystemService that publishes an IVoiceInteractionManagerService. Loading Loading @@ -151,6 +148,7 @@ public class VoiceInteractionManagerService extends SystemService { } if (force || mImpl == null || mImpl.mUser != mCurUser || !mImpl.mComponent.equals(serviceComponent)) { mSoundTriggerHelper.stopAllRecognitions(); if (mImpl != null) { mImpl.shutdownLocked(); } Loading