From 1f0ef2cc33e5b8fe00a869c22eabfd08cf7de504 Mon Sep 17 00:00:00 2001 From: Sandeep Siddhartha Date: Fri, 6 Sep 2013 17:21:45 -0700 Subject: Move public consts to HotwordRecognitionService - The HotwordRecognitionService is the only public component of Hotword recognition allowing others to implement hotword recognition - The client API is not available for use by all, hence the consts need to be moved to the service class. - Ideally we'd have retained the public consts in the client side API (HotwordRecognizer) Change-Id: Ibd0d1c0d0514ec4e8f7c284e22c5fa6b7ef3df26 --- .../Keyguard/src/com/android/keyguard/KeyguardHostView.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'packages') diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java index 78b842c..40a1af6 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java @@ -50,6 +50,7 @@ import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.speech.hotword.HotwordRecognitionListener; +import android.speech.hotword.HotwordRecognitionService; import android.speech.hotword.HotwordRecognizer; import android.telephony.TelephonyManager; import android.util.AttributeSet; @@ -1775,11 +1776,13 @@ public class KeyguardHostView extends KeyguardViewBase { public void onHotwordEvent(int eventType, Bundle eventBundle) { if (DEBUG) Log.d(TAG, "onHotwordEvent: " + eventType); - if (eventType == HotwordRecognizer.EVENT_TYPE_STATE_CHANGED) { - if (eventBundle != null && eventBundle.containsKey(HotwordRecognizer.PROMPT_TEXT)) { - new KeyguardMessageArea.Helper( - (View) getSecurityView(mCurrentSecuritySelection)) - .setMessage(eventBundle.getString(HotwordRecognizer.PROMPT_TEXT),true); + if (eventType == HotwordRecognitionService.EVENT_TYPE_PROMPT_CHANGED) { + if (eventBundle != null + && eventBundle.containsKey(HotwordRecognitionService.KEY_PROMPT_TEXT)) { + new KeyguardMessageArea + .Helper((View) getSecurityView(mCurrentSecuritySelection)) + .setMessage(eventBundle.getString( + HotwordRecognitionService.KEY_PROMPT_TEXT),true); } } } -- cgit v1.1