diff options
author | Matt Garnes <matt@cyngn.com> | 2015-09-04 18:02:20 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-28 13:30:32 -0700 |
commit | b09f7797429af5c0034d1a6c52c2a47a35b0e428 (patch) | |
tree | 90d7b719101a9df1d88da2801ccf3144f20b997b /core/java/android/content | |
parent | 66ed04e967adb4bb5545ecf06ce692c6e5b790ea (diff) | |
download | frameworks_base-b09f7797429af5c0034d1a6c52c2a47a35b0e428.zip frameworks_base-b09f7797429af5c0034d1a6c52c2a47a35b0e428.tar.gz frameworks_base-b09f7797429af5c0034d1a6c52c2a47a35b0e428.tar.bz2 |
Add broadcast and query API for AudioSource.HOTWORD.
- When the AudioSource.HOTWORD input becomes active or is released, send
a Broadcast with the package name and the new state of the audio input
to any applications that hold CAPTURE_AUDIO_OUTPUT.
- Store the package name of the application that controls the hOTWORD
input or set it to null if the input is not in use.
- Add a new method to AudioService to retrieve the package name of the
application that currently controls the HOTWORD input.
Change-Id: I2f11888f3711d23b6287a4de7b81d361734a8f3b
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/Intent.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 404564b..c63fe1c 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -2678,6 +2678,45 @@ public class Intent implements Parcelable, Cloneable { "android.intent.action.GET_RESTRICTION_ENTRIES"; /** + * <p>Broadcast Action: The state of the HOTWORD audio input has changed.:</p> + * <ul> + * <li><em>state</em> - A String value indicating the state of the input. + * {@link #EXTRA_HOTWORD_INPUT_STATE}. The value will be one of: + * {@link android.media.AudioRecord#RECORDSTATE_RECORDING} or + * {@link android.media.AudioRecord#RECORDSTATE_STOPPED}. + * </li> + * <li><em>package</em> - A String value indicating the package name of the application + * that currently holds the HOTWORD input. + * {@link #EXTRA_CURRENT_PACKAGE_NAME} + * </li> + * </ul> + * + * <p class="note">This is a protected intent that can only be sent + * by the system. It can only be received by packages that hold + * {@link android.Manifest.permission#CAPTURE_AUDIO_HOTWORD}. + * + * @hide + */ + //@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_HOTWORD_INPUT_CHANGED + = "com.cyanogenmod.intent.action.HOTWORD_INPUT_CHANGED"; + + /** + * @hide + * Activity to challenge the user for a PIN that was configured when setting up + * restrictions. Restrictions include blocking of apps and preventing certain user operations, + * controlled by {@link android.os.UserManager#setUserRestrictions(Bundle). + * Launch the activity using + * {@link android.app.Activity#startActivityForResult(Intent, int)} and check if the + * result is {@link android.app.Activity#RESULT_OK} for a successful response to the + * challenge.<p/> + * Before launching this activity, make sure that there is a PIN in effect, by calling + * {@link android.os.UserManager#hasRestrictionsChallenge()}. + */ + public static final String ACTION_RESTRICTIONS_CHALLENGE = + "android.intent.action.RESTRICTIONS_CHALLENGE"; + + /** * Sent the first time a user is starting, to allow system apps to * perform one time initialization. (This will not be seen by third * party applications because a newly initialized user does not have any @@ -3881,6 +3920,15 @@ public class Intent implements Parcelable, Cloneable { */ public static final String EXTRA_THEME_PACKAGE_NAME = "android.intent.extra.PACKAGE_NAME"; + /** + * Extra for {@link #ACTION_HOTWORD_INPUT_CHANGED} that provides the state of + * the input when the broadcast action was sent. + * @hide + */ + public static final String EXTRA_HOTWORD_INPUT_STATE = + "com.cyanogenmod.intent.extra.HOTWORD_INPUT_STATE"; + + // --------------------------------------------------------------------- // --------------------------------------------------------------------- // Intent flags (see mFlags variable). |