summaryrefslogtreecommitdiffstats
path: root/core/java/android/service
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2015-07-20 15:51:40 -0700
committerJorim Jaggi <jjaggi@google.com>2015-07-21 12:35:16 -0700
commit19695d97118d74aa7f54ba09b178e65378825cc0 (patch)
tree6afac03712cde70978fce033815a3e64be8f805d /core/java/android/service
parente446dcee8f5c24121adbfb7600453e0de1826497 (diff)
downloadframeworks_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 'core/java/android/service')
-rw-r--r--core/java/android/service/voice/IVoiceInteractionSession.aidl1
-rw-r--r--core/java/android/service/voice/VoiceInteractionSession.java17
2 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/service/voice/IVoiceInteractionSession.aidl b/core/java/android/service/voice/IVoiceInteractionSession.aidl
index 8fe84e1..dbc28f7 100644
--- a/core/java/android/service/voice/IVoiceInteractionSession.aidl
+++ b/core/java/android/service/voice/IVoiceInteractionSession.aidl
@@ -35,5 +35,6 @@ oneway interface IVoiceInteractionSession {
void taskStarted(in Intent intent, int taskId);
void taskFinished(in Intent intent, int taskId);
void closeSystemDialogs();
+ void onLockscreenShown();
void destroy();
}
diff --git a/core/java/android/service/voice/VoiceInteractionSession.java b/core/java/android/service/voice/VoiceInteractionSession.java
index a3ccbd3..485afd4 100644
--- a/core/java/android/service/voice/VoiceInteractionSession.java
+++ b/core/java/android/service/voice/VoiceInteractionSession.java
@@ -265,6 +265,11 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
}
@Override
+ public void onLockscreenShown() {
+ mHandlerCaller.sendMessage(mHandlerCaller.obtainMessage(MSG_ON_LOCKSCREEN_SHOWN));
+ }
+
+ @Override
public void destroy() {
mHandlerCaller.sendMessage(mHandlerCaller.obtainMessage(MSG_DESTROY));
}
@@ -652,6 +657,7 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
static final int MSG_HANDLE_SCREENSHOT = 105;
static final int MSG_SHOW = 106;
static final int MSG_HIDE = 107;
+ static final int MSG_ON_LOCKSCREEN_SHOWN = 108;
class MyCallbacks implements HandlerCaller.Callback, SoftInputWindow.Callback {
@Override
@@ -730,6 +736,10 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
if (DEBUG) Log.d(TAG, "doHide");
doHide();
break;
+ case MSG_ON_LOCKSCREEN_SHOWN:
+ if (DEBUG) Log.d(TAG, "onLockscreenShown");
+ onLockscreenShown();
+ break;
}
if (args != null) {
args.recycle();
@@ -1266,6 +1276,13 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
hide();
}
+ /**
+ * Called when the lockscreen was shown.
+ */
+ public void onLockscreenShown() {
+ hide();
+ }
+
@Override
public void onConfigurationChanged(Configuration newConfig) {
}