diff options
author | Dharmesh Mokani <mokani@google.com> | 2014-09-05 17:18:26 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-05 17:18:26 +0000 |
commit | 140616a89c0ecadd22758e42fbca99c74773db84 (patch) | |
tree | 084ee2892d4689ae54b206924c670b969cf8e584 | |
parent | 6de978d01777a41c4b3e02ef2077224e8eec3057 (diff) | |
parent | 1ba5f6a2d1eeeea39894c977b8313ab21d9feed2 (diff) |
am 6feba6b6: am 0b230ea6: am efd4ea01: Merge "Address API review comment:AlwaysOnHotwordDetector" into lmp-dev
* commit '6feba6b61ecddcb93a2b33a2ea52daad6cf70bd5':
Address API review comment:AlwaysOnHotwordDetector
-rw-r--r-- | api/current.txt | 6 | ||||
-rw-r--r-- | core/java/android/service/voice/AlwaysOnHotwordDetector.java | 41 | ||||
-rw-r--r-- | tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java | 2 |
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: |