diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-06-08 12:28:42 -0700 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2015-06-09 00:31:12 +0000 |
commit | b835dd7641c60cd5d2b372331ffc19f7165244bd (patch) | |
tree | 39d1237596a807247d3f07a3d4ac945b4e6de357 /services/voiceinteraction/java | |
parent | 53b3bb072bcebd6b7d89a6b06139f458e9240ae9 (diff) | |
download | frameworks_base-b835dd7641c60cd5d2b372331ffc19f7165244bd.zip frameworks_base-b835dd7641c60cd5d2b372331ffc19f7165244bd.tar.gz frameworks_base-b835dd7641c60cd5d2b372331ffc19f7165244bd.tar.bz2 |
Close assist when launching intents from notification shade
Bug: 21035363
Change-Id: I51a6dbe5f0d93aaf81a38d1f1afacaaeaf7732e2
Diffstat (limited to 'services/voiceinteraction/java')
2 files changed, 25 insertions, 4 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java index 8834497..4cdf254 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java @@ -49,6 +49,7 @@ import android.service.voice.VoiceInteractionServiceInfo; import android.service.voice.VoiceInteractionSession; import android.speech.RecognitionService; import android.text.TextUtils; +import android.util.Log; import android.util.Slog; import com.android.internal.app.IVoiceInteractionManagerService; @@ -475,11 +476,9 @@ public class VoiceInteractionManagerService extends SystemService { Slog.w(TAG, "hideSessionFromSession without running voice interaction service"); return false; } - final int callingPid = Binder.getCallingPid(); - final int callingUid = Binder.getCallingUid(); final long caller = Binder.clearCallingIdentity(); try { - return mImpl.hideSessionLocked(callingPid, callingUid); + return mImpl.hideSessionLocked(); } finally { Binder.restoreCallingIdentity(caller); } @@ -744,6 +743,28 @@ public class VoiceInteractionManagerService extends SystemService { } @Override + public void hideCurrentSession() throws RemoteException { + enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); + synchronized (this) { + if (mImpl == null) { + return; + } + final long caller = Binder.clearCallingIdentity(); + try { + if (mImpl.mActiveSession != null && mImpl.mActiveSession.mSession != null) { + try { + mImpl.mActiveSession.mSession.closeSystemDialogs(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call closeSystemDialogs", e); + } + } + } finally { + Binder.restoreCallingIdentity(caller); + } + } + } + + @Override public void launchVoiceAssistFromKeyguard() { enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); synchronized (this) { diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java index d8569bc..acd484d 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java @@ -144,7 +144,7 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne return mActiveSession.showLocked(args, flags, showCallback); } - public boolean hideSessionLocked(int callingPid, int callingUid) { + public boolean hideSessionLocked() { if (mActiveSession != null) { return mActiveSession.hideLocked(); } |