summaryrefslogtreecommitdiffstats
path: root/services/voiceinteraction
diff options
context:
space:
mode:
authorJames Cook <jamescook@google.com>2015-05-22 15:52:29 -0700
committerJames Cook <jamescook@google.com>2015-05-22 16:16:37 -0700
commit496767c142fbf8b412237f9ffc2f9af411a3d077 (patch)
treef9a9a34704256eae7822bbf3e79b54967951bdbd /services/voiceinteraction
parent7d85ea93e951dc1dd82e7879e0399c56d116f231 (diff)
downloadframeworks_base-496767c142fbf8b412237f9ffc2f9af411a3d077.zip
frameworks_base-496767c142fbf8b412237f9ffc2f9af411a3d077.tar.gz
frameworks_base-496767c142fbf8b412237f9ffc2f9af411a3d077.tar.bz2
Cancel voice assist session on user switch
Ensure any active voice interaction session is canceled when the voice interaction service is shutdown. This ensures that the UI window is closed when a user switches accounts. Bug: 20501283 Change-Id: I9f3dae5afc4048482f6bedaed36dbae3c0823ebd
Diffstat (limited to 'services/voiceinteraction')
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
index 0a5b668..6de887b 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
@@ -248,6 +248,12 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne
}
void shutdownLocked() {
+ // If there is an active session, cancel it to allow it to clean up its window and other
+ // state.
+ if (mActiveSession != null) {
+ mActiveSession.cancel();
+ mActiveSession = null;
+ }
try {
if (mService != null) {
mService.shutdown();