diff options
Diffstat (limited to 'tests')
5 files changed, 79 insertions, 0 deletions
diff --git a/tests/VoiceEnrollment/Android.mk b/tests/VoiceEnrollment/Android.mk new file mode 100644 index 0000000..2ab3d02 --- /dev/null +++ b/tests/VoiceEnrollment/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-subdir-java-files) + +LOCAL_PACKAGE_NAME := VoiceEnrollment + +LOCAL_MODULE_TAGS := optional + +LOCAL_PRIVILEGED_MODULE := true + +include $(BUILD_PACKAGE) diff --git a/tests/VoiceEnrollment/AndroidManifest.xml b/tests/VoiceEnrollment/AndroidManifest.xml new file mode 100644 index 0000000..6321222 --- /dev/null +++ b/tests/VoiceEnrollment/AndroidManifest.xml @@ -0,0 +1,16 @@ +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.test.voiceenrollment"> + + <application + android:permission="android.permission.MANAGE_VOICE_KEYPHRASES"> + <activity android:name="TestEnrollmentActivity" android:label="Voice Enrollment Application" + android:theme="@android:style/Theme.Material.Light.Voice"> + <intent-filter> + <action android:name="com.android.intent.action.MANAGE_VOICE_KEYPHRASES" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + <meta-data android:name="android.voice_enrollment" + android:resource="@xml/enrollment_application"/> + </application> +</manifest> diff --git a/tests/VoiceEnrollment/res/xml/enrollment_application.xml b/tests/VoiceEnrollment/res/xml/enrollment_application.xml new file mode 100644 index 0000000..710a0ac --- /dev/null +++ b/tests/VoiceEnrollment/res/xml/enrollment_application.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2014, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> + +<voice-enrollment-application xmlns:android="http://schemas.android.com/apk/res/android" + android:searchKeyphraseId="101" + android:searchKeyphrase="Hello There" + android:searchKeyphraseSupportedLocales="en-US,en-GB,fr-FR,de-DE" /> diff --git a/tests/VoiceEnrollment/src/com/android/test/voiceenrollment/TestEnrollmentActivity.java b/tests/VoiceEnrollment/src/com/android/test/voiceenrollment/TestEnrollmentActivity.java new file mode 100644 index 0000000..7fbd965 --- /dev/null +++ b/tests/VoiceEnrollment/src/com/android/test/voiceenrollment/TestEnrollmentActivity.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.test.voiceenrollment; + +import android.app.Activity; + +public class TestEnrollmentActivity extends Activity { + // TODO(sansid): Add a test enrollment flow here. +} diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java index d40b05f..00c2c64 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java @@ -21,6 +21,8 @@ import android.os.Bundle; import android.service.voice.VoiceInteractionService; import android.util.Log; +import java.util.Arrays; + public class MainInteractionService extends VoiceInteractionService { static final String TAG = "MainInteractionService"; @@ -28,6 +30,9 @@ public class MainInteractionService extends VoiceInteractionService { public void onCreate() { super.onCreate(); Log.i(TAG, "Creating " + this); + Log.i(TAG, "Keyphrase enrollment error? " + getKeyphraseEnrollmentInfo().getParseError()); + Log.i(TAG, "Keyphrase enrollment meta-data: " + + Arrays.toString(getKeyphraseEnrollmentInfo().getKeyphrases())); } @Override |
