Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76a65d5f authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Hide the interaction part of VoiceInteractionService." into lmp-dev

parents a7118c9b d7c0395d
Loading
Loading
Loading
Loading
+0 −78
Original line number Diff line number Diff line
@@ -3430,7 +3430,6 @@ package android.app {
    method public int getTaskId();
    method public final java.lang.CharSequence getTitle();
    method public final int getTitleColor();
    method public android.app.VoiceInteractor getVoiceInteractor();
    method public final int getVolumeControlStream();
    method public android.view.Window getWindow();
    method public android.view.WindowManager getWindowManager();
@@ -3442,7 +3441,6 @@ package android.app {
    method public boolean isFinishing();
    method public boolean isImmersive();
    method public boolean isTaskRoot();
    method public boolean isVoiceInteraction();
    method public final deprecated android.database.Cursor managedQuery(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    method public boolean moveTaskToBack(boolean);
    method public boolean navigateUpTo(android.content.Intent);
@@ -5267,41 +5265,6 @@ package android.app {
    field public static final int MODE_NIGHT_YES = 2; // 0x2
  }
  public class VoiceInteractor {
    method public boolean submitRequest(android.app.VoiceInteractor.Request);
    method public boolean[] supportsCommands(java.lang.String[]);
  }
  public static class VoiceInteractor.AbortVoiceRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.AbortVoiceRequest(java.lang.CharSequence, android.os.Bundle);
    method public void onAbortResult(android.os.Bundle);
  }
  public static class VoiceInteractor.CommandRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.CommandRequest(java.lang.String, android.os.Bundle);
    method public void onCommandResult(android.os.Bundle);
  }
  public static class VoiceInteractor.CompleteVoiceRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.CompleteVoiceRequest(java.lang.CharSequence, android.os.Bundle);
    method public void onCompleteResult(android.os.Bundle);
  }
  public static class VoiceInteractor.ConfirmationRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle);
    method public void onConfirmationResult(boolean, android.os.Bundle);
  }
  public static abstract class VoiceInteractor.Request {
    ctor public VoiceInteractor.Request();
    method public void cancel();
    method public android.app.Activity getActivity();
    method public android.content.Context getContext();
    method public void onAttached(android.app.Activity);
    method public void onCancel();
    method public void onDetached();
  }
  public final class WallpaperInfo implements android.os.Parcelable {
    ctor public WallpaperInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
@@ -7827,7 +7790,6 @@ package android.content {
    field public static final java.lang.String CATEGORY_TAB = "android.intent.category.TAB";
    field public static final java.lang.String CATEGORY_TEST = "android.intent.category.TEST";
    field public static final java.lang.String CATEGORY_UNIT_TEST = "android.intent.category.UNIT_TEST";
    field public static final java.lang.String CATEGORY_VOICE = "android.intent.category.VOICE";
    field public static final android.os.Parcelable.Creator CREATOR;
    field public static final java.lang.String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT";
    field public static final java.lang.String EXTRA_ALLOW_MULTIPLE = "android.intent.extra.ALLOW_MULTIPLE";
@@ -25330,14 +25292,12 @@ package android.provider {
    field public static final java.lang.String ACTION_SYNC_SETTINGS = "android.settings.SYNC_SETTINGS";
    field public static final java.lang.String ACTION_USAGE_ACCESS_SETTINGS = "android.settings.USAGE_ACCESS_SETTINGS";
    field public static final java.lang.String ACTION_USER_DICTIONARY_SETTINGS = "android.settings.USER_DICTIONARY_SETTINGS";
    field public static final java.lang.String ACTION_VOICE_CONTROL_AIRPLANE_MODE = "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
    field public static final java.lang.String ACTION_VOICE_INPUT_SETTINGS = "android.settings.VOICE_INPUT_SETTINGS";
    field public static final java.lang.String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_SETTINGS";
    field public static final java.lang.String ACTION_WIFI_SETTINGS = "android.settings.WIFI_SETTINGS";
    field public static final java.lang.String ACTION_WIRELESS_SETTINGS = "android.settings.WIRELESS_SETTINGS";
    field public static final java.lang.String AUTHORITY = "settings";
    field public static final java.lang.String EXTRA_ACCOUNT_TYPES = "account_types";
    field public static final java.lang.String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
    field public static final java.lang.String EXTRA_AUTHORITIES = "authorities";
    field public static final java.lang.String EXTRA_INPUT_METHOD_ID = "input_method_id";
  }
@@ -27235,52 +27195,14 @@ package android.service.voice {
    ctor public VoiceInteractionSession(android.content.Context);
    ctor public VoiceInteractionSession(android.content.Context, android.os.Handler);
    method public void finish();
    method public android.view.LayoutInflater getLayoutInflater();
    method public android.app.Dialog getWindow();
    method public void hideWindow();
    method public void onAbortVoice(android.service.voice.VoiceInteractionSession.Caller, android.service.voice.VoiceInteractionSession.Request, java.lang.CharSequence, android.os.Bundle);
    method public void onBackPressed();
    method public abstract void onCancel(android.service.voice.VoiceInteractionSession.Request);
    method public void onCloseSystemDialogs();
    method public abstract void onCommand(android.service.voice.VoiceInteractionSession.Caller, android.service.voice.VoiceInteractionSession.Request, java.lang.String, android.os.Bundle);
    method public void onCompleteVoice(android.service.voice.VoiceInteractionSession.Caller, android.service.voice.VoiceInteractionSession.Request, java.lang.CharSequence, android.os.Bundle);
    method public void onComputeInsets(android.service.voice.VoiceInteractionSession.Insets);
    method public abstract void onConfirm(android.service.voice.VoiceInteractionSession.Caller, android.service.voice.VoiceInteractionSession.Request, java.lang.CharSequence, android.os.Bundle);
    method public void onCreate(android.os.Bundle);
    method public android.view.View onCreateContentView();
    method public void onDestroy();
    method public boolean[] onGetSupportedCommands(android.service.voice.VoiceInteractionSession.Caller, java.lang.String[]);
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method public void onTaskFinished(android.content.Intent, int);
    method public void onTaskStarted(android.content.Intent, int);
    method public void setContentView(android.view.View);
    method public void setTheme(int);
    method public void showWindow();
    method public void startVoiceActivity(android.content.Intent);
  }
  public static class VoiceInteractionSession.Caller {
  }
  public static final class VoiceInteractionSession.Insets {
    ctor public VoiceInteractionSession.Insets();
    field public static final int TOUCHABLE_INSETS_CONTENT = 1; // 0x1
    field public static final int TOUCHABLE_INSETS_FRAME = 0; // 0x0
    field public static final int TOUCHABLE_INSETS_REGION = 3; // 0x3
    field public final android.graphics.Rect contentInsets;
    field public int touchableInsets;
    field public final android.graphics.Region touchableRegion;
  }
  public static class VoiceInteractionSession.Request {
    method public void sendAbortVoiceResult(android.os.Bundle);
    method public void sendCancelResult();
    method public void sendCommandResult(boolean, android.os.Bundle);
    method public void sendCompleteVoiceResult(android.os.Bundle);
    method public void sendConfirmResult(boolean, android.os.Bundle);
  }
  public abstract class VoiceInteractionSessionService extends android.app.Service {
+4 −0
Original line number Diff line number Diff line
@@ -1236,18 +1236,22 @@ public class Activity extends ContextThemeWrapper
    }

    /**
     * @hide
     * Check whether this activity is running as part of a voice interaction with the user.
     * If true, it should perform its interaction with the user through the
     * {@link VoiceInteractor} returned by {@link #getVoiceInteractor}.
     */
    @SystemApi
    public boolean isVoiceInteraction() {
        return mVoiceInteractor != null;
    }

    /**
     * @hide
     * Retrieve the active {@link VoiceInteractor} that the user is going through to
     * interact with this activity.
     */
    @SystemApi
    public VoiceInteractor getVoiceInteractor() {
        return mVoiceInteractor;
    }
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app;

import android.annotation.SystemApi;
import android.content.Context;
import android.os.Bundle;
import android.os.IBinder;
@@ -33,6 +34,7 @@ import com.android.internal.os.SomeArgs;
import java.util.ArrayList;

/**
 * @hide
 * Interface for an {@link Activity} to interact with the user through voice.  Use
 * {@link android.app.Activity#getVoiceInteractor() Activity.getVoiceInteractor}
 * to retrieve the interface, if the activity is currently involved in a voice interaction.
@@ -54,6 +56,7 @@ import java.util.ArrayList;
 * request, rather than holding on to the activity instance yourself, either explicitly
 * or implicitly through a non-static inner class.
 */
@SystemApi
public class VoiceInteractor {
    static final String TAG = "VoiceInteractor";
    static final boolean DEBUG = true;
+2 −0
Original line number Diff line number Diff line
@@ -2833,12 +2833,14 @@ public class Intent implements Parcelable, Cloneable {
    @SdkConstant(SdkConstantType.INTENT_CATEGORY)
    public static final String CATEGORY_BROWSABLE = "android.intent.category.BROWSABLE";
    /**
     * @hide
     * Categories for activities that can participate in voice interaction.
     * An activity that supports this category must be prepared to run with
     * no UI shown at all (though in some case it may have a UI shown), and
     * rely on {@link android.app.VoiceInteractor} to interact with the user.
     */
    @SdkConstant(SdkConstantType.INTENT_CATEGORY)
    @SystemApi
    public static final String CATEGORY_VOICE = "android.intent.category.VOICE";
    /**
     * Set if the activity should be considered as an alternative action to
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.provider;

import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.app.SearchManager;
import android.app.WallpaperManager;
import android.content.ComponentName;
@@ -131,6 +132,7 @@ public final class Settings {
            "android.settings.AIRPLANE_MODE_SETTINGS";

    /**
     * @hide
     * Activity Action: Modify Airplane mode settings using the users voice.
     * <p>
     * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
@@ -152,6 +154,7 @@ public final class Settings {
     * Output: Nothing.
     */
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    @SystemApi
    public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
            "android.settings.VOICE_CONTROL_AIRPLANE_MODE";

@@ -975,11 +978,13 @@ public final class Settings {
    public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";

    /**
     * @hide
     * Activity Extra: Enable or disable Airplane Mode.
     * <p>
     * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
     * intent as a boolean.
     */
    @SystemApi
    public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";

    private static final String JID_RESOURCE_PREFIX = "android";
Loading