summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt6
-rw-r--r--core/java/android/service/voice/AlwaysOnHotwordDetector.java41
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java2
3 files changed, 44 insertions, 5 deletions
diff --git a/api/current.txt b/api/current.txt
index 79ae3d6df718..fb8a8a9e1676 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -27422,9 +27422,9 @@ package android.service.textservice {
package android.service.voice {
public class AlwaysOnHotwordDetector {
- method public android.content.Intent createIntentToEnroll();
- method public android.content.Intent createIntentToReEnroll();
- method public android.content.Intent createIntentToUnEnroll();
+ method public android.content.Intent createEnrollIntent();
+ method public android.content.Intent createReEnrollIntent();
+ method public android.content.Intent createUnEnrollIntent();
method public int getSupportedRecognitionModes();
method public boolean startRecognition(int);
method public boolean stopRecognition();
diff --git a/core/java/android/service/voice/AlwaysOnHotwordDetector.java b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
index 519bc282a8fa..4de5f41e308d 100644
--- a/core/java/android/service/voice/AlwaysOnHotwordDetector.java
+++ b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
@@ -450,7 +450,7 @@ public class AlwaysOnHotwordDetector {
* This intent must be invoked using {@link Activity#startActivityForResult(Intent, int)}.
* Starting re-enrollment is only valid if the keyphrase is un-enrolled,
* i.e. {@link #STATE_KEYPHRASE_UNENROLLED},
- * otherwise {@link #createIntentToReEnroll()} should be preferred.
+ * otherwise {@link #createReEnrollIntent()} should be preferred.
*
* @return An {@link Intent} to start enrollment for the given keyphrase.
* @throws UnsupportedOperationException if managing they keyphrase isn't supported.
@@ -460,6 +460,19 @@ public class AlwaysOnHotwordDetector {
* This may happen if another detector has been instantiated or the
* {@link VoiceInteractionService} hosting this detector has been shut down.
*/
+ public Intent createEnrollIntent() {
+ if (DBG) Slog.d(TAG, "createEnrollIntent");
+ synchronized (mLock) {
+ return getManageIntentLocked(MANAGE_ACTION_ENROLL);
+ }
+ }
+
+ /**
+ * FIXME: Remove once the prebuilts are updated.
+ *
+ * @hide
+ */
+ @Deprecated
public Intent createIntentToEnroll() {
if (DBG) Slog.d(TAG, "createIntentToEnroll");
synchronized (mLock) {
@@ -481,6 +494,19 @@ public class AlwaysOnHotwordDetector {
* This may happen if another detector has been instantiated or the
* {@link VoiceInteractionService} hosting this detector has been shut down.
*/
+ public Intent createUnEnrollIntent() {
+ if (DBG) Slog.d(TAG, "createUnEnrollIntent");
+ synchronized (mLock) {
+ return getManageIntentLocked(MANAGE_ACTION_UN_ENROLL);
+ }
+ }
+
+ /**
+ * FIXME: Remove once the prebuilts are updated.
+ *
+ * @hide
+ */
+ @Deprecated
public Intent createIntentToUnEnroll() {
if (DBG) Slog.d(TAG, "createIntentToUnEnroll");
synchronized (mLock) {
@@ -502,6 +528,19 @@ public class AlwaysOnHotwordDetector {
* This may happen if another detector has been instantiated or the
* {@link VoiceInteractionService} hosting this detector has been shut down.
*/
+ public Intent createReEnrollIntent() {
+ if (DBG) Slog.d(TAG, "createReEnrollIntent");
+ synchronized (mLock) {
+ return getManageIntentLocked(MANAGE_ACTION_RE_ENROLL);
+ }
+ }
+
+ /**
+ * FIXME: Remove once the prebuilts are updated.
+ *
+ * @hide
+ */
+ @Deprecated
public Intent createIntentToReEnroll() {
if (DBG) Slog.d(TAG, "createIntentToReEnroll");
synchronized (mLock) {
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java
index 1f014615dc66..46391149b262 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java
@@ -92,7 +92,7 @@ public class MainInteractionService extends VoiceInteractionService {
break;
case AlwaysOnHotwordDetector.STATE_KEYPHRASE_UNENROLLED:
Log.i(TAG, "STATE_KEYPHRASE_UNENROLLED");
- Intent enroll = mHotwordDetector.createIntentToEnroll();
+ Intent enroll = mHotwordDetector.createEnrollIntent();
Log.i(TAG, "Need to enroll with " + enroll);
break;
case AlwaysOnHotwordDetector.STATE_KEYPHRASE_ENROLLED: