summaryrefslogtreecommitdiffstats
path: root/tests/VoiceInteraction
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-05-27 18:05:52 -0700
committerDianne Hackborn <hackbod@google.com>2015-05-28 11:44:58 -0700
commit09d57fe9b357495b7bc62be39a8befa00d9d7ffb (patch)
tree1d71edec334401bb5b978f64267d7d8b496582cb /tests/VoiceInteraction
parentda1b398173a94e94c61a0d186c7dc0ef2a7bd060 (diff)
downloadframeworks_base-09d57fe9b357495b7bc62be39a8befa00d9d7ffb.zip
frameworks_base-09d57fe9b357495b7bc62be39a8befa00d9d7ffb.tar.gz
frameworks_base-09d57fe9b357495b7bc62be39a8befa00d9d7ffb.tar.bz2
Add new API to set URI on AssistContent.
Also rework how we transfer AssistContent and AssistStructure to the assistant, so they are delivered as completely separate objects rather than the kludgy bundling them in the assist data thing. Change-Id: Ib40cc3b152bafeb358fd3adec564a7dda3a0dd1d
Diffstat (limited to 'tests/VoiceInteraction')
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java38
1 files changed, 10 insertions, 28 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
index 3c5c201..70a6336 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
@@ -119,11 +119,16 @@ public class MainInteractionSession extends VoiceInteractionSession
}
@Override
- public void onHandleAssist(Bundle assistBundle) {
- if (assistBundle != null) {
- parseAssistData(assistBundle);
- } else {
- Log.i(TAG, "onHandleAssist: NO ASSIST BUNDLE");
+ public void onHandleAssist(Bundle data, AssistStructure structure, AssistContent content) {
+ mAssistStructure = structure;
+ if (mAssistStructure != null) {
+ if (mAssistVisualizer != null) {
+ mAssistVisualizer.setAssistStructure(mAssistStructure);
+ }
+ }
+ if (content != null) {
+ Log.i(TAG, "Assist intent: " + content.getIntent());
+ Log.i(TAG, "Assist clipdata: " + content.getClipData());
}
}
@@ -139,29 +144,6 @@ public class MainInteractionSession extends VoiceInteractionSession
}
}
- void parseAssistData(Bundle assistBundle) {
- if (assistBundle != null) {
- Bundle assistContext = assistBundle.getBundle(Intent.EXTRA_ASSIST_CONTEXT);
- if (assistContext != null) {
- mAssistStructure = AssistStructure.getAssistStructure(assistContext);
- if (mAssistStructure != null) {
- if (mAssistVisualizer != null) {
- mAssistVisualizer.setAssistStructure(mAssistStructure);
- }
- }
- AssistContent content = AssistContent.getAssistContent(assistContext);
- if (content != null) {
- Log.i(TAG, "Assist intent: " + content.getIntent());
- Log.i(TAG, "Assist clipdata: " + content.getClipData());
- }
- return;
- }
- }
- if (mAssistVisualizer != null) {
- mAssistVisualizer.clearAssistData();
- }
- }
-
void updateState() {
if (mState == STATE_IDLE) {
mTopContent.setVisibility(View.VISIBLE);