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

Commit 27eac1d5 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add ability to get a screenshot for assist.

New flag you pass in to startSession() to say you want it,
new callback on VoiceInteractionSession to receive it.

Change-Id: I61fdcfdee41a60d46036a2ef16681a9b4181115a
parent 7438f814
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -263,6 +263,7 @@ LOCAL_SRC_FILES += \
	core/java/android/speech/tts/ITextToSpeechService.aidl \
	core/java/com/android/internal/app/IAppOpsCallback.aidl \
	core/java/com/android/internal/app/IAppOpsService.aidl \
	core/java/com/android/internal/app/IAssistScreenshotReceiver.aidl \
	core/java/com/android/internal/app/IBatteryStats.aidl \
	core/java/com/android/internal/app/IProcessStats.aidl \
	core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl \
+2 −0
Original line number Diff line number Diff line
@@ -27886,6 +27886,7 @@ package android.service.voice {
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.voice.VoiceInteractionService";
    field public static final java.lang.String SERVICE_META_DATA = "android.voice_interaction";
    field public static final int START_WITH_ASSIST = 1; // 0x1
    field public static final int START_WITH_SCREENSHOT = 2; // 0x2
  }
  public abstract class VoiceInteractionSession implements android.view.KeyEvent.Callback {
@@ -27909,6 +27910,7 @@ package android.service.voice {
    method public void onDestroy();
    method public boolean[] onGetSupportedCommands(android.service.voice.VoiceInteractionSession.Caller, java.lang.String[]);
    method public void onHandleAssist(android.os.Bundle);
    method public void onHandleScreenshot(android.graphics.Bitmap);
    method public void onHide();
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
+2 −0
Original line number Diff line number Diff line
@@ -29770,6 +29770,7 @@ package android.service.voice {
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.voice.VoiceInteractionService";
    field public static final java.lang.String SERVICE_META_DATA = "android.voice_interaction";
    field public static final int START_WITH_ASSIST = 1; // 0x1
    field public static final int START_WITH_SCREENSHOT = 2; // 0x2
  }
  public abstract class VoiceInteractionSession implements android.view.KeyEvent.Callback {
@@ -29793,6 +29794,7 @@ package android.service.voice {
    method public void onDestroy();
    method public boolean[] onGetSupportedCommands(android.service.voice.VoiceInteractionSession.Caller, java.lang.String[]);
    method public void onHandleAssist(android.os.Bundle);
    method public void onHandleScreenshot(android.graphics.Bitmap);
    method public void onHide();
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.service.voice;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;

/**
@@ -26,6 +27,7 @@ oneway interface IVoiceInteractionSession {
    void show(in Bundle sessionArgs, int flags);
    void hide();
    void handleAssist(in Bundle assistData);
    void handleScreenshot(in Bitmap screenshot);
    void taskStarted(in Intent intent, int taskId);
    void taskFinished(in Intent intent, int taskId);
    void closeSystemDialogs();
+7 −1
Original line number Diff line number Diff line
@@ -71,11 +71,17 @@ public class VoiceInteractionService extends Service {
    public static final String SERVICE_META_DATA = "android.voice_interaction";

    /**
     * Flag for use with {@link #showSession: request that the session be started with
     * Flag for use with {@link #showSession}: request that the session be started with
     * assist data from the currently focused activity.
     */
    public static final int START_WITH_ASSIST = 1<<0;

    /**
     * Flag for use with {@link #showSession}: request that the session be started with
     * a screen shot of the currently focused activity.
     */
    public static final int START_WITH_SCREENSHOT = 1<<1;

    IVoiceInteractionService mInterface = new IVoiceInteractionService.Stub() {
        @Override public void ready() {
            mHandler.sendEmptyMessage(MSG_READY);
Loading