From 0db30899f0d44e4fbaddffb79cc3415db6efb657 Mon Sep 17 00:00:00 2001 From: Sandeep Siddhartha Date: Mon, 4 Aug 2014 10:42:09 -0700 Subject: [PATCH] Use @IntDef for manage actions Change-Id: I12473fb82bf865af36aaf681a1b12a19e9f218fc --- .../service/voice/AlwaysOnHotwordDetector.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/java/android/service/voice/AlwaysOnHotwordDetector.java b/core/java/android/service/voice/AlwaysOnHotwordDetector.java index b9fce8515692f..b0ff947ecbc24 100644 --- a/core/java/android/service/voice/AlwaysOnHotwordDetector.java +++ b/core/java/android/service/voice/AlwaysOnHotwordDetector.java @@ -82,6 +82,15 @@ public class AlwaysOnHotwordDetector { private static final int STATE_NOT_READY = 0; // Keyphrase management actions. Used in getManageIntent() ----// + /** @hide */ + @Retention(RetentionPolicy.SOURCE) + @IntDef(value = { + MANAGE_ACTION_ENROLL, + MANAGE_ACTION_RE_ENROLL, + MANAGE_ACTION_UN_ENROLL + }) + public @interface ManageActions {} + /** Indicates that we need to enroll. */ public static final int MANAGE_ACTION_ENROLL = 0; /** Indicates that we need to re-enroll. */ @@ -360,7 +369,7 @@ 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 getManageIntent(int action) { + public Intent getManageIntent(@ManageActions int action) { if (DBG) Slog.d(TAG, "getManageIntent(" + action + ")"); synchronized (mLock) { return getManageIntentLocked(action);