summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
index c0a67c1..6e3694b 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
@@ -72,6 +72,7 @@ public class MainInteractionSession extends VoiceInteractionSession
VoiceInteractor.PickOptionRequest.Option[] mPendingOptions;
CharSequence mPendingPrompt;
Request mPendingRequest;
+ int mCurrentTask = -1;
MainInteractionSession(Context context) {
super(context);
@@ -314,6 +315,27 @@ public class MainInteractionSession extends VoiceInteractionSession
}
@Override
+ public void onTaskStarted(Intent intent, int taskId) {
+ super.onTaskStarted(intent, taskId);
+ mCurrentTask = taskId;
+ }
+
+ @Override
+ public void onTaskFinished(Intent intent, int taskId) {
+ super.onTaskFinished(intent, taskId);
+ if (mCurrentTask == taskId) {
+ mCurrentTask = -1;
+ }
+ }
+
+ @Override
+ public void onLockscreenShown() {
+ if (mCurrentTask < 0) {
+ hide();
+ }
+ }
+
+ @Override
public boolean[] onGetSupportedCommands(String[] commands) {
boolean[] res = new boolean[commands.length];
for (int i=0; i<commands.length; i++) {