diff options
author | Nicholas Ambur <nambur@google.com> | 2020-01-14 20:28:37 -0800 |
---|---|---|
committer | Nicholas Ambur <nambur@google.com> | 2020-01-22 16:40:13 -0800 |
commit | ef84fc48433d47ea9c91dcb3273ae3d74ca6d32a (patch) | |
tree | 7ae618ac7d63eb705ca913274d800c38cbc98b58 /tests/VoiceEnrollment/src | |
parent | 4ec0be1fafd70ff43f5c579c73627b147168b194 (diff) |
add KeyphraseModelManager
Exposes a set of @SystemApi's allowing the active VoiceInteractionService
to enroll voice models.
Bug: 147159435
Test: manual tested enrollment and unenrollment via bundled
hotwordenrollment application and test app.
Change-Id: I94ef3550df236486401a0a6f9de9d874b9bf9b46
Diffstat (limited to 'tests/VoiceEnrollment/src')
-rw-r--r-- | tests/VoiceEnrollment/src/com/android/test/voiceenrollment/TestEnrollmentActivity.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/VoiceEnrollment/src/com/android/test/voiceenrollment/TestEnrollmentActivity.java b/tests/VoiceEnrollment/src/com/android/test/voiceenrollment/TestEnrollmentActivity.java index 54c944f9588e..b357ad076c11 100644 --- a/tests/VoiceEnrollment/src/com/android/test/voiceenrollment/TestEnrollmentActivity.java +++ b/tests/VoiceEnrollment/src/com/android/test/voiceenrollment/TestEnrollmentActivity.java @@ -16,9 +16,6 @@ package com.android.test.voiceenrollment; -import java.util.Random; -import java.util.UUID; - import android.app.Activity; import android.hardware.soundtrigger.SoundTrigger; import android.hardware.soundtrigger.SoundTrigger.Keyphrase; @@ -29,6 +26,13 @@ import android.util.Log; import android.view.View; import android.widget.Toast; +import java.util.Locale; +import java.util.Random; +import java.util.UUID; + +/** + * TODO: must be transitioned to a service. + */ public class TestEnrollmentActivity extends Activity { private static final String TAG = "TestEnrollmentActivity"; private static final boolean DBG = false; @@ -56,7 +60,8 @@ public class TestEnrollmentActivity extends Activity { * Performs a fresh enrollment. */ public void onEnrollButtonClicked(View v) { - Keyphrase kp = new Keyphrase(KEYPHRASE_ID, RECOGNITION_MODES, BCP47_LOCALE, TEXT, + Keyphrase kp = new Keyphrase(KEYPHRASE_ID, RECOGNITION_MODES, + Locale.forLanguageTag(BCP47_LOCALE), TEXT, new int[] { UserManager.get(this).getUserHandle() /* current user */}); UUID modelUuid = UUID.randomUUID(); // Generate a fake model to push. |