From 4e88bcd39918197c78b148afe40a08b6adcace1e Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 1 Jul 2015 13:41:03 -0700 Subject: Fix issue #20672970: Notifications are not dismissed on hot word detection Add new VoiceInteractionSession.closeSystemDialogs() API that closes everything except the session itself. Change-Id: If45f1e120d8ca095b6c8055b6485acb5e710820e --- .../android/service/voice/VoiceInteractionSession.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/java/android/service') diff --git a/core/java/android/service/voice/VoiceInteractionSession.java b/core/java/android/service/voice/VoiceInteractionSession.java index 7eb936a..a7e0e08 100644 --- a/core/java/android/service/voice/VoiceInteractionSession.java +++ b/core/java/android/service/voice/VoiceInteractionSession.java @@ -1001,6 +1001,21 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall } /** + * Request that all system dialogs (and status bar shade etc) be closed, allowing + * access to the session's UI. This will not cause the lock screen to be + * dismissed. + */ + public void closeSystemDialogs() { + if (mToken == null) { + throw new IllegalStateException("Can't call before onCreate()"); + } + try { + mSystemService.closeSystemDialogs(mToken); + } catch (RemoteException e) { + } + } + + /** * Convenience for inflating views. */ public LayoutInflater getLayoutInflater() { -- cgit v1.1