public class KeyphraseEnrollmentInfo extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_MANAGE_VOICE_KEYPHRASES
Activity Action: Show activity for managing the keyphrases for hotword detection.
|
static String |
EXTRA_VOICE_KEYPHRASE_ACTION
Intent extra: The intent extra for the specific manage action that needs to be performed.
|
static String |
EXTRA_VOICE_KEYPHRASE_HINT_TEXT
Intent extra: The hint text to be shown on the voice keyphrase management UI.
|
static String |
EXTRA_VOICE_KEYPHRASE_LOCALE
Intent extra: The voice locale to use while managing the keyphrase.
|
Constructor and Description |
---|
KeyphraseEnrollmentInfo(PackageManager pm) |
Modifier and Type | Method and Description |
---|---|
KeyphraseMetadata |
getKeyphraseMetadata(String keyphrase,
Locale locale)
Gets the
KeyphraseMetadata for the given keyphrase and locale, null if any metadata
isn't available for the given combination. |
Intent |
getManageKeyphraseIntent(int action,
String keyphrase,
Locale locale)
Returns an intent to launch an activity that manages the given keyphrase
for the locale.
|
String |
getParseError() |
KeyphraseMetadata[] |
listKeyphraseMetadata() |
String |
toString()
Returns a string representation of the object.
|
public static final String ACTION_MANAGE_VOICE_KEYPHRASES
public static final String EXTRA_VOICE_KEYPHRASE_ACTION
AlwaysOnHotwordDetector.MANAGE_ACTION_ENROLL
,
AlwaysOnHotwordDetector.MANAGE_ACTION_RE_ENROLL
or AlwaysOnHotwordDetector.MANAGE_ACTION_UN_ENROLL
.public static final String EXTRA_VOICE_KEYPHRASE_HINT_TEXT
public static final String EXTRA_VOICE_KEYPHRASE_LOCALE
public KeyphraseEnrollmentInfo(PackageManager pm)
public String getParseError()
public KeyphraseMetadata[] listKeyphraseMetadata()
public Intent getManageKeyphraseIntent(int action, String keyphrase, Locale locale)
action
- The enrollment related action that this intent is supposed to perform.
This can be one of AlwaysOnHotwordDetector.MANAGE_ACTION_ENROLL
,
AlwaysOnHotwordDetector.MANAGE_ACTION_RE_ENROLL
or AlwaysOnHotwordDetector.MANAGE_ACTION_UN_ENROLL
keyphrase
- The keyphrase that the user needs to be enrolled to.locale
- The locale for which the enrollment needs to be performed.Intent
to manage the keyphrase. This can be null if managing the
given keyphrase/locale combination isn't possible.public KeyphraseMetadata getKeyphraseMetadata(String keyphrase, Locale locale)
KeyphraseMetadata
for the given keyphrase and locale, null if any metadata
isn't available for the given combination.keyphrase
- The keyphrase that the user needs to be enrolled to.locale
- The locale for which the enrollment needs to be performed.
This is a Java locale, for example "en_US".public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())