diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-07-20 15:51:40 -0700 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2015-07-21 12:35:16 -0700 |
commit | 19695d97118d74aa7f54ba09b178e65378825cc0 (patch) | |
tree | 6afac03712cde70978fce033815a3e64be8f805d /services/voiceinteraction/java | |
parent | e446dcee8f5c24121adbfb7600453e0de1826497 (diff) | |
download | frameworks_base-19695d97118d74aa7f54ba09b178e65378825cc0.zip frameworks_base-19695d97118d74aa7f54ba09b178e65378825cc0.tar.gz frameworks_base-19695d97118d74aa7f54ba09b178e65378825cc0.tar.bz2 |
Add callback to voice interaction session for lockscreen shown
Bug: 22402726
Change-Id: Iaf83e2f2b0389d74b6ecf480aa91a34443803f7b
Diffstat (limited to 'services/voiceinteraction/java')
-rw-r--r-- | services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java index b57c413..a8874d0 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java @@ -894,6 +894,28 @@ public class VoiceInteractionManagerService extends SystemService { } @Override + public void onLockscreenShown() { + 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.onLockscreenShown(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call onLockscreenShown", e); + } + } + } finally { + Binder.restoreCallingIdentity(caller); + } + } + } + + @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (mContext.checkCallingOrSelfPermission(Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) { |