summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-06-02 10:52:59 -0700
committerDianne Hackborn <hackbod@google.com>2015-06-02 16:56:41 -0700
commit69c6adc96eecfde74ceb83cf9177428dc08b6067 (patch)
tree1c9fb3e63573cf0133ad3680d3cc8a048b0874c0 /tests
parent133b107d28649ef5a984be0acc06f53e49853b22 (diff)
downloadframeworks_base-69c6adc96eecfde74ceb83cf9177428dc08b6067.zip
frameworks_base-69c6adc96eecfde74ceb83cf9177428dc08b6067.tar.gz
frameworks_base-69c6adc96eecfde74ceb83cf9177428dc08b6067.tar.bz2
More API changes.
Start moving Assist* stuff to android.app.assist. Clean up some more of the VoiceInteractionSession APIs. Clearly document that finish() is not the same as hide(), always call hide() instead, and fix the finish() path to also always do a hide to make sure everything is cleaned up correctly. Change-Id: I962d4069fcb34fe89547a95d395ae1b9fa3b4148
Diffstat (limited to 'tests')
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
index f66a9ce..dae1ac3 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
@@ -17,9 +17,9 @@
package com.android.test.voiceinteraction;
import android.app.ActivityManager;
+import android.app.VoiceInteractor;
import android.app.AssistContent;
import android.app.AssistStructure;
-import android.app.VoiceInteractor;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
@@ -71,7 +71,7 @@ public class MainInteractionSession extends VoiceInteractionSession
public void onCreate(Bundle args, int startFlags) {
super.onCreate(args, startFlags);
ActivityManager am = getContext().getSystemService(ActivityManager.class);
- am.setWatchHeapLimit(40*1024*1024);
+ am.setWatchHeapLimit(40 * 1024 * 1024);
}
@Override
@@ -118,6 +118,30 @@ public class MainInteractionSession extends VoiceInteractionSession
return mContentView;
}
+ public void onHandleAssist(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();
+ }
+ }
+
+ /*
@Override
public void onHandleAssist(Bundle data, AssistStructure structure, AssistContent content) {
mAssistStructure = structure;
@@ -131,6 +155,7 @@ public class MainInteractionSession extends VoiceInteractionSession
Log.i(TAG, "Assist clipdata: " + content.getClipData());
}
}
+ */
@Override
public void onHandleScreenshot(Bitmap screenshot) {