summaryrefslogtreecommitdiffstats
path: root/tests/VoiceInteraction
diff options
context:
space:
mode:
authorBarnaby James <bjames@google.com>2014-08-06 14:15:37 -0700
committerBarnaby James <bjames@google.com>2014-08-06 14:16:04 -0700
commitcb188253572f0b07325c2c6e2c2d7ec7e3d2c7c6 (patch)
treee6d69992040376c5725494053e24a2e6b5b569eb /tests/VoiceInteraction
parent485ccdefc54e53d511659f2574fba9c657dd5c75 (diff)
downloadframeworks_base-cb188253572f0b07325c2c6e2c2d7ec7e3d2c7c6.zip
frameworks_base-cb188253572f0b07325c2c6e2c2d7ec7e3d2c7c6.tar.gz
frameworks_base-cb188253572f0b07325c2c6e2c2d7ec7e3d2c7c6.tar.bz2
Fix VoiceInteractionService.isActiveService.
Small fix + added to the test application. Change-Id: I05ad84c32064fc98d3bb90eff921702af9855a66
Diffstat (limited to 'tests/VoiceInteraction')
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java
index d64eefa..783c78e 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java
@@ -18,7 +18,9 @@ package com.android.test.voiceinteraction;
import android.app.Activity;
import android.app.VoiceInteractor;
+import android.content.ComponentName;
import android.os.Bundle;
+import android.service.voice.VoiceInteractionService;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
@@ -42,6 +44,13 @@ public class TestInteractionActivity extends Activity implements View.OnClickLis
return;
}
+ if (!VoiceInteractionService.isActiveService(this,
+ new ComponentName(this, MainInteractionService.class))) {
+ Log.w(TAG, "Not current voice interactor!");
+ finish();
+ return;
+ }
+
setContentView(R.layout.test_interaction);
mAbortButton = (Button)findViewById(R.id.abort);
mAbortButton.setOnClickListener(this);