diff options
author | Dianne Hackborn <hackbod@google.com> | 2015-04-04 14:52:14 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2015-04-04 17:36:05 -0700 |
commit | d59a5d59df920d743723521a2afed9de1da3373b (patch) | |
tree | 2fa60c308b330a8203d00f1e99811e54c6f486a9 /tests/VoiceInteraction | |
parent | cef55cde1cf1b9b15583d6b4c439dfea7bac7c26 (diff) | |
download | frameworks_base-d59a5d59df920d743723521a2afed9de1da3373b.zip frameworks_base-d59a5d59df920d743723521a2afed9de1da3373b.tar.gz frameworks_base-d59a5d59df920d743723521a2afed9de1da3373b.tar.bz2 |
Various fixes and improvements...
Issue #19912529: VI: VoiceInteractor callback ClassCastException
Fix to use correct argument.
Issue #19912636: VI: Documentation for VoiceInteractionSession.onBackPressed
Added documentation.
Issue #19912703: VI: VoiceInteractionSession NPE on Abort Request
Maybe fix this -- don't crash if there is no active session.
Issue #19953731: VI: Add value index to...
...android.app.VoiceInteractor.PickOptionRequest.Option
There is now an optional index integer that can be associated with
every Option object.
Issue #19912635: VI: Behavior of startActivity when in voice...
...interaction is unexpected
We now forcibly finish the current voice interaction task whenever
another activity takes focus from it.
Issue #20066569: Add API to request heap dumps
New ActivityManager API to set the pss limit to generate heap
dumps.
Also added app ops for assist receiving structure and screenshot
data, so that we can track when it does these things.
Change-Id: I688d4ff8f0bd0b8b9e3390a32375b4bb7875c1a1
Diffstat (limited to 'tests/VoiceInteraction')
4 files changed, 50 insertions, 18 deletions
diff --git a/tests/VoiceInteraction/res/layout/test_interaction.xml b/tests/VoiceInteraction/res/layout/test_interaction.xml index 8c8151d..6209bd0 100644 --- a/tests/VoiceInteraction/res/layout/test_interaction.xml +++ b/tests/VoiceInteraction/res/layout/test_interaction.xml @@ -34,32 +34,49 @@ android:textAppearance="?android:attr/textAppearanceMedium" /> - <Button android:id="@+id/complete" - android:layout_width="wrap_content" + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:text="@string/completeVoice" - /> + android:orientation="horizontal"> + + <Button android:id="@+id/complete" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/completeVoice" + /> + + <Button android:id="@+id/abort" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/abortVoice" + /> + + <Button android:id="@+id/pick" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/pickVoice" + /> + + </LinearLayout> - <Button android:id="@+id/pick" - android:layout_width="wrap_content" + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:text="@string/pickVoice" + android:layout_marginBottom="16dp" + android:orientation="horizontal"> + + <Button android:id="@+id/cancel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/cancelVoice" /> - <Button android:id="@+id/abort" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:text="@string/abortVoice" + <Button android:id="@+id/jump" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/jumpOut" /> - <Button android:id="@+id/cancel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:text="@string/cancelVoice" - /> + </LinearLayout> </LinearLayout> diff --git a/tests/VoiceInteraction/res/values/strings.xml b/tests/VoiceInteraction/res/values/strings.xml index 942c931..6289929 100644 --- a/tests/VoiceInteraction/res/values/strings.xml +++ b/tests/VoiceInteraction/res/values/strings.xml @@ -25,5 +25,6 @@ <string name="completeVoice">Complete Voice</string> <string name="pickVoice">Pick Voice</string> <string name="cancelVoice">Cancel</string> + <string name="jumpOut">Jump out</string> </resources> diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java index ec727c4..3c5c201 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java @@ -16,6 +16,7 @@ package com.android.test.voiceinteraction; +import android.app.ActivityManager; import android.app.AssistContent; import android.app.AssistStructure; import android.app.VoiceInteractor; @@ -69,6 +70,8 @@ public class MainInteractionSession extends VoiceInteractionSession @Override public void onCreate(Bundle args, int startFlags) { super.onCreate(args); + ActivityManager am = getContext().getSystemService(ActivityManager.class); + am.setWatchHeapLimit(40*1024*1024); } @Override diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java index e195c30..9d24c59 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java @@ -19,6 +19,7 @@ package com.android.test.voiceinteraction; import android.app.Activity; import android.app.VoiceInteractor; import android.content.ComponentName; +import android.content.Intent; import android.os.Bundle; import android.service.voice.VoiceInteractionService; import android.util.Log; @@ -37,6 +38,7 @@ public class TestInteractionActivity extends Activity implements View.OnClickLis Button mAbortButton; Button mCompleteButton; Button mPickButton; + Button mJumpOutButton; Button mCancelButton; @Override @@ -64,6 +66,8 @@ public class TestInteractionActivity extends Activity implements View.OnClickLis mCompleteButton.setOnClickListener(this); mPickButton = (Button)findViewById(R.id.pick); mPickButton.setOnClickListener(this); + mJumpOutButton = (Button)findViewById(R.id.jump); + mJumpOutButton.setOnClickListener(this); mCancelButton = (Button)findViewById(R.id.cancel); mCancelButton.setOnClickListener(this); @@ -165,6 +169,13 @@ public class TestInteractionActivity extends Activity implements View.OnClickLis } }; mInteractor.submitRequest(req); + } else if (v == mJumpOutButton) { + Log.i(TAG, "Jump out"); + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + intent.setComponent(new ComponentName(this, VoiceInteractionMain.class)); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); } else if (v == mCancelButton && mCurrentRequest != null) { Log.i(TAG, "Cancel request"); mCurrentRequest.cancel(); |