summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-07-27 18:11:14 -0700
committerDianne Hackborn <hackbod@google.com>2015-07-28 12:52:11 -0700
commit57dd737443a174379eb638450e4888500d8e4a23 (patch)
treeac0750125c23a5e1e932e93407b421b5c397775a /tests
parente827c2525a6b76c130d2b877fbcdcf62b0ce42eb (diff)
downloadframeworks_base-57dd737443a174379eb638450e4888500d8e4a23.zip
frameworks_base-57dd737443a174379eb638450e4888500d8e4a23.tar.gz
frameworks_base-57dd737443a174379eb638450e4888500d8e4a23.tar.bz2
Work on issue #21516866: Implement voice interaction in ResolverActivity
The main change here is to not allow the dialog to go in to its "focus on the last app the user selected" when running in voice interaction mode, instead just always giving a simple list. This also fixes some problems with cleaning up active commands when an activity finishes and not forcing the current session to go away when the screen is turned off. Also added some debug help, having activity print the state of the voice interactor. Change-Id: Ifebee9c74d78398a730a280bb4970f47789dadf5
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++) {