diff options
Diffstat (limited to 'tests')
3 files changed, 24 insertions, 1 deletions
diff --git a/tests/VoiceInteraction/res/layout/test_interaction.xml b/tests/VoiceInteraction/res/layout/test_interaction.xml index d1a7ad5..277117e 100644 --- a/tests/VoiceInteraction/res/layout/test_interaction.xml +++ b/tests/VoiceInteraction/res/layout/test_interaction.xml @@ -39,6 +39,19 @@ android:layout_marginTop="16dp" android:orientation="horizontal"> + <Button android:id="@+id/airplane" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/launchAirplane" + /> + + </LinearLayout> + + <LinearLayout android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:orientation="horizontal"> + <Button android:id="@+id/complete" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/tests/VoiceInteraction/res/values/strings.xml b/tests/VoiceInteraction/res/values/strings.xml index 29ffe21..c665c23 100644 --- a/tests/VoiceInteraction/res/values/strings.xml +++ b/tests/VoiceInteraction/res/values/strings.xml @@ -21,6 +21,7 @@ <string name="tree">Tree</string> <string name="text">Text</string> <string name="asyncStructure">(Async structure goes here)</string> + <string name="launchAirplane">Launch airplane mode</string> <string name="confirm">Confirm</string> <string name="abort">Abort</string> <string name="complete">Complete</string> diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java index e10d89f..ada0e21 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java @@ -21,6 +21,7 @@ import android.app.VoiceInteractor; import android.content.ComponentName; import android.content.Intent; import android.os.Bundle; +import android.provider.Settings; import android.service.voice.VoiceInteractionService; import android.util.Log; import android.view.View; @@ -39,6 +40,7 @@ public class TestInteractionActivity extends Activity implements View.OnClickLis VoiceInteractor mInteractor; VoiceInteractor.Request mCurrentRequest = null; TextView mLog; + Button mAirplaneButton; Button mAbortButton; Button mCompleteButton; Button mCommandButton; @@ -65,6 +67,8 @@ public class TestInteractionActivity extends Activity implements View.OnClickLis setContentView(R.layout.test_interaction); mLog = (TextView)findViewById(R.id.log); + mAirplaneButton = (Button)findViewById(R.id.airplane); + mAirplaneButton.setOnClickListener(this); mAbortButton = (Button)findViewById(R.id.abort); mAbortButton.setOnClickListener(this); mCompleteButton = (Button)findViewById(R.id.complete); @@ -122,7 +126,12 @@ public class TestInteractionActivity extends Activity implements View.OnClickLis @Override public void onClick(View v) { - if (v == mAbortButton) { + if (v == mAirplaneButton) { + Intent intent = new Intent(Settings.ACTION_VOICE_CONTROL_AIRPLANE_MODE); + intent.addCategory(Intent.CATEGORY_VOICE); + intent.putExtra(Settings.EXTRA_AIRPLANE_MODE_ENABLED, true); + startActivity(intent); + } else if (v == mAbortButton) { VoiceInteractor.AbortVoiceRequest req = new TestAbortVoice(); mInteractor.submitRequest(req, REQUEST_ABORT); } else if (v == mCompleteButton) { |