Loading api/current.txt +7 −0 Original line number Original line Diff line number Diff line Loading @@ -5146,6 +5146,11 @@ package android.app { method public void onCommandResult(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 { public static class VoiceInteractor.ConfirmationRequest extends android.app.VoiceInteractor.Request { ctor public VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle); ctor public VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle); method public void onConfirmationResult(boolean, android.os.Bundle); method public void onConfirmationResult(boolean, android.os.Bundle); Loading Loading @@ -26510,6 +26515,7 @@ package android.service.voice { method public abstract void onCancel(android.service.voice.VoiceInteractionSession.Request); method public abstract void onCancel(android.service.voice.VoiceInteractionSession.Request); method public void onCloseSystemDialogs(); 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 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 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 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 void onCreate(android.os.Bundle); Loading Loading @@ -26545,6 +26551,7 @@ package android.service.voice { method public void sendAbortVoiceResult(android.os.Bundle); method public void sendAbortVoiceResult(android.os.Bundle); method public void sendCancelResult(); method public void sendCancelResult(); method public void sendCommandResult(boolean, android.os.Bundle); method public void sendCommandResult(boolean, android.os.Bundle); method public void sendCompleteVoiceResult(android.os.Bundle); method public void sendConfirmResult(boolean, android.os.Bundle); method public void sendConfirmResult(boolean, android.os.Bundle); } } core/java/android/app/VoiceInteractor.java +50 −3 Original line number Original line Diff line number Diff line Loading @@ -81,6 +81,16 @@ public class VoiceInteractor { request.clear(); request.clear(); } } break; break; case MSG_COMPLETE_VOICE_RESULT: request = pullRequest((IVoiceInteractorRequest)args.arg1, true); if (DEBUG) Log.d(TAG, "onCompleteVoice: req=" + ((IVoiceInteractorRequest)args.arg1).asBinder() + "/" + request + " result=" + args.arg1); if (request != null) { ((CompleteVoiceRequest)request).onCompleteResult((Bundle) args.arg2); request.clear(); } break; case MSG_ABORT_VOICE_RESULT: case MSG_ABORT_VOICE_RESULT: request = pullRequest((IVoiceInteractorRequest)args.arg1, true); request = pullRequest((IVoiceInteractorRequest)args.arg1, true); if (DEBUG) Log.d(TAG, "onAbortVoice: req=" if (DEBUG) Log.d(TAG, "onAbortVoice: req=" Loading Loading @@ -124,6 +134,12 @@ public class VoiceInteractor { MSG_CONFIRMATION_RESULT, confirmed ? 1 : 0, request, result)); MSG_CONFIRMATION_RESULT, confirmed ? 1 : 0, request, result)); } } @Override public void deliverCompleteVoiceResult(IVoiceInteractorRequest request, Bundle result) { mHandlerCaller.sendMessage(mHandlerCaller.obtainMessageOO( MSG_COMPLETE_VOICE_RESULT, request, result)); } @Override @Override public void deliverAbortVoiceResult(IVoiceInteractorRequest request, Bundle result) { public void deliverAbortVoiceResult(IVoiceInteractorRequest request, Bundle result) { mHandlerCaller.sendMessage(mHandlerCaller.obtainMessageOO( mHandlerCaller.sendMessage(mHandlerCaller.obtainMessageOO( Loading @@ -147,9 +163,10 @@ public class VoiceInteractor { final ArrayMap<IBinder, Request> mActiveRequests = new ArrayMap<IBinder, Request>(); final ArrayMap<IBinder, Request> mActiveRequests = new ArrayMap<IBinder, Request>(); static final int MSG_CONFIRMATION_RESULT = 1; static final int MSG_CONFIRMATION_RESULT = 1; static final int MSG_ABORT_VOICE_RESULT = 2; static final int MSG_COMPLETE_VOICE_RESULT = 2; static final int MSG_COMMAND_RESULT = 3; static final int MSG_ABORT_VOICE_RESULT = 3; static final int MSG_CANCEL_RESULT = 4; static final int MSG_COMMAND_RESULT = 4; static final int MSG_CANCEL_RESULT = 5; public static abstract class Request { public static abstract class Request { IVoiceInteractorRequest mRequestInterface; IVoiceInteractorRequest mRequestInterface; Loading Loading @@ -228,6 +245,36 @@ public class VoiceInteractor { } } } } public static class CompleteVoiceRequest extends Request { final CharSequence mMessage; final Bundle mExtras; /** * Reports that the current interaction was successfully completed with voice, so the * application can report the final status to the user. When the response comes back, the * voice system has handled the request and is ready to switch; at that point the * application can start a new non-voice activity or finish. Be sure when starting the new * activity to use {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK * Intent.FLAG_ACTIVITY_NEW_TASK} to keep the new activity out of the current voice * interaction task. * * @param message Optional message to tell user about the completion status of the task. * @param extras Additional optional information. */ public CompleteVoiceRequest(CharSequence message, Bundle extras) { mMessage = message; mExtras = extras; } public void onCompleteResult(Bundle result) { } IVoiceInteractorRequest submit(IVoiceInteractor interactor, String packageName, IVoiceInteractorCallback callback) throws RemoteException { return interactor.startCompleteVoice(packageName, callback, mMessage, mExtras); } } public static class AbortVoiceRequest extends Request { public static class AbortVoiceRequest extends Request { final CharSequence mMessage; final CharSequence mMessage; final Bundle mExtras; final Bundle mExtras; Loading core/java/android/service/voice/VoiceInteractionSession.java +53 −4 Original line number Original line Diff line number Diff line Loading @@ -107,6 +107,16 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { return request.mInterface; return request.mInterface; } } @Override public IVoiceInteractorRequest startCompleteVoice(String callingPackage, IVoiceInteractorCallback callback, CharSequence message, Bundle extras) { Request request = newRequest(callback); mHandlerCaller.sendMessage(mHandlerCaller.obtainMessageOOOO(MSG_START_COMPLETE_VOICE, new Caller(callingPackage, Binder.getCallingUid()), request, message, extras)); return request.mInterface; } @Override @Override public IVoiceInteractorRequest startAbortVoice(String callingPackage, public IVoiceInteractorRequest startAbortVoice(String callingPackage, IVoiceInteractorCallback callback, CharSequence message, Bundle extras) { IVoiceInteractorCallback callback, CharSequence message, Bundle extras) { Loading Loading @@ -208,6 +218,16 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { } } } } public void sendCompleteVoiceResult(Bundle result) { try { if (DEBUG) Log.d(TAG, "sendCompleteVoiceResult: req=" + mInterface + " result=" + result); finishRequest(); mCallback.deliverCompleteVoiceResult(mInterface, result); } catch (RemoteException e) { } } public void sendAbortVoiceResult(Bundle result) { public void sendAbortVoiceResult(Bundle result) { try { try { if (DEBUG) Log.d(TAG, "sendConfirmResult: req=" + mInterface if (DEBUG) Log.d(TAG, "sendConfirmResult: req=" + mInterface Loading Loading @@ -249,10 +269,11 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { } } static final int MSG_START_CONFIRMATION = 1; static final int MSG_START_CONFIRMATION = 1; static final int MSG_START_ABORT_VOICE = 2; static final int MSG_START_COMPLETE_VOICE = 2; static final int MSG_START_COMMAND = 3; static final int MSG_START_ABORT_VOICE = 3; static final int MSG_SUPPORTS_COMMANDS = 4; static final int MSG_START_COMMAND = 4; static final int MSG_CANCEL = 5; static final int MSG_SUPPORTS_COMMANDS = 5; static final int MSG_CANCEL = 6; static final int MSG_TASK_STARTED = 100; static final int MSG_TASK_STARTED = 100; static final int MSG_TASK_FINISHED = 101; static final int MSG_TASK_FINISHED = 101; Loading @@ -271,6 +292,13 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { onConfirm((Caller)args.arg1, (Request)args.arg2, (CharSequence)args.arg3, onConfirm((Caller)args.arg1, (Request)args.arg2, (CharSequence)args.arg3, (Bundle)args.arg4); (Bundle)args.arg4); break; break; case MSG_START_COMPLETE_VOICE: args = (SomeArgs)msg.obj; if (DEBUG) Log.d(TAG, "onCompleteVoice: req=" + ((Request) args.arg2).mInterface + " message=" + args.arg3 + " extras=" + args.arg4); onCompleteVoice((Caller) args.arg1, (Request) args.arg2, (CharSequence) args.arg3, (Bundle) args.arg4); break; case MSG_START_ABORT_VOICE: case MSG_START_ABORT_VOICE: args = (SomeArgs)msg.obj; args = (SomeArgs)msg.obj; if (DEBUG) Log.d(TAG, "onAbortVoice: req=" + ((Request) args.arg2).mInterface if (DEBUG) Log.d(TAG, "onAbortVoice: req=" + ((Request) args.arg2).mInterface Loading Loading @@ -700,6 +728,27 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { public abstract void onConfirm(Caller caller, Request request, CharSequence prompt, public abstract void onConfirm(Caller caller, Request request, CharSequence prompt, Bundle extras); Bundle extras); /** * Request to complete the voice interaction session because the voice activity successfully * completed its interaction using voice. Corresponds to * {@link android.app.VoiceInteractor.CompleteVoiceRequest * VoiceInteractor.CompleteVoiceRequest}. The default implementation just sends an empty * confirmation back to allow the activity to exit. * * @param caller Who is making the request. * @param request The active request. * @param message The message informing the user of the problem, as per * {@link android.app.VoiceInteractor.CompleteVoiceRequest * VoiceInteractor.CompleteVoiceRequest}. * @param extras Any additional information, as per * {@link android.app.VoiceInteractor.CompleteVoiceRequest * VoiceInteractor.CompleteVoiceRequest}. */ public void onCompleteVoice(Caller caller, Request request, CharSequence message, Bundle extras) { request.sendCompleteVoiceResult(null); } /** /** * Request to abort the voice interaction session because the voice activity can not * Request to abort the voice interaction session because the voice activity can not * complete its interaction using voice. Corresponds to * complete its interaction using voice. Corresponds to Loading core/java/com/android/internal/app/IVoiceInteractor.aidl +2 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,8 @@ import com.android.internal.app.IVoiceInteractorRequest; interface IVoiceInteractor { interface IVoiceInteractor { IVoiceInteractorRequest startConfirmation(String callingPackage, IVoiceInteractorRequest startConfirmation(String callingPackage, IVoiceInteractorCallback callback, CharSequence prompt, in Bundle extras); IVoiceInteractorCallback callback, CharSequence prompt, in Bundle extras); IVoiceInteractorRequest startCompleteVoice(String callingPackage, IVoiceInteractorCallback callback, CharSequence message, in Bundle extras); IVoiceInteractorRequest startAbortVoice(String callingPackage, IVoiceInteractorRequest startAbortVoice(String callingPackage, IVoiceInteractorCallback callback, CharSequence message, in Bundle extras); IVoiceInteractorCallback callback, CharSequence message, in Bundle extras); IVoiceInteractorRequest startCommand(String callingPackage, IVoiceInteractorRequest startCommand(String callingPackage, Loading core/java/com/android/internal/app/IVoiceInteractorCallback.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.internal.app.IVoiceInteractorRequest; oneway interface IVoiceInteractorCallback { oneway interface IVoiceInteractorCallback { void deliverConfirmationResult(IVoiceInteractorRequest request, boolean confirmed, void deliverConfirmationResult(IVoiceInteractorRequest request, boolean confirmed, in Bundle result); in Bundle result); void deliverCompleteVoiceResult(IVoiceInteractorRequest request, in Bundle result); void deliverAbortVoiceResult(IVoiceInteractorRequest request, in Bundle result); void deliverAbortVoiceResult(IVoiceInteractorRequest request, in Bundle result); void deliverCommandResult(IVoiceInteractorRequest request, boolean complete, in Bundle result); void deliverCommandResult(IVoiceInteractorRequest request, boolean complete, in Bundle result); void deliverCancel(IVoiceInteractorRequest request); void deliverCancel(IVoiceInteractorRequest request); Loading Loading
api/current.txt +7 −0 Original line number Original line Diff line number Diff line Loading @@ -5146,6 +5146,11 @@ package android.app { method public void onCommandResult(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 { public static class VoiceInteractor.ConfirmationRequest extends android.app.VoiceInteractor.Request { ctor public VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle); ctor public VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle); method public void onConfirmationResult(boolean, android.os.Bundle); method public void onConfirmationResult(boolean, android.os.Bundle); Loading Loading @@ -26510,6 +26515,7 @@ package android.service.voice { method public abstract void onCancel(android.service.voice.VoiceInteractionSession.Request); method public abstract void onCancel(android.service.voice.VoiceInteractionSession.Request); method public void onCloseSystemDialogs(); 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 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 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 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 void onCreate(android.os.Bundle); Loading Loading @@ -26545,6 +26551,7 @@ package android.service.voice { method public void sendAbortVoiceResult(android.os.Bundle); method public void sendAbortVoiceResult(android.os.Bundle); method public void sendCancelResult(); method public void sendCancelResult(); method public void sendCommandResult(boolean, android.os.Bundle); method public void sendCommandResult(boolean, android.os.Bundle); method public void sendCompleteVoiceResult(android.os.Bundle); method public void sendConfirmResult(boolean, android.os.Bundle); method public void sendConfirmResult(boolean, android.os.Bundle); } }
core/java/android/app/VoiceInteractor.java +50 −3 Original line number Original line Diff line number Diff line Loading @@ -81,6 +81,16 @@ public class VoiceInteractor { request.clear(); request.clear(); } } break; break; case MSG_COMPLETE_VOICE_RESULT: request = pullRequest((IVoiceInteractorRequest)args.arg1, true); if (DEBUG) Log.d(TAG, "onCompleteVoice: req=" + ((IVoiceInteractorRequest)args.arg1).asBinder() + "/" + request + " result=" + args.arg1); if (request != null) { ((CompleteVoiceRequest)request).onCompleteResult((Bundle) args.arg2); request.clear(); } break; case MSG_ABORT_VOICE_RESULT: case MSG_ABORT_VOICE_RESULT: request = pullRequest((IVoiceInteractorRequest)args.arg1, true); request = pullRequest((IVoiceInteractorRequest)args.arg1, true); if (DEBUG) Log.d(TAG, "onAbortVoice: req=" if (DEBUG) Log.d(TAG, "onAbortVoice: req=" Loading Loading @@ -124,6 +134,12 @@ public class VoiceInteractor { MSG_CONFIRMATION_RESULT, confirmed ? 1 : 0, request, result)); MSG_CONFIRMATION_RESULT, confirmed ? 1 : 0, request, result)); } } @Override public void deliverCompleteVoiceResult(IVoiceInteractorRequest request, Bundle result) { mHandlerCaller.sendMessage(mHandlerCaller.obtainMessageOO( MSG_COMPLETE_VOICE_RESULT, request, result)); } @Override @Override public void deliverAbortVoiceResult(IVoiceInteractorRequest request, Bundle result) { public void deliverAbortVoiceResult(IVoiceInteractorRequest request, Bundle result) { mHandlerCaller.sendMessage(mHandlerCaller.obtainMessageOO( mHandlerCaller.sendMessage(mHandlerCaller.obtainMessageOO( Loading @@ -147,9 +163,10 @@ public class VoiceInteractor { final ArrayMap<IBinder, Request> mActiveRequests = new ArrayMap<IBinder, Request>(); final ArrayMap<IBinder, Request> mActiveRequests = new ArrayMap<IBinder, Request>(); static final int MSG_CONFIRMATION_RESULT = 1; static final int MSG_CONFIRMATION_RESULT = 1; static final int MSG_ABORT_VOICE_RESULT = 2; static final int MSG_COMPLETE_VOICE_RESULT = 2; static final int MSG_COMMAND_RESULT = 3; static final int MSG_ABORT_VOICE_RESULT = 3; static final int MSG_CANCEL_RESULT = 4; static final int MSG_COMMAND_RESULT = 4; static final int MSG_CANCEL_RESULT = 5; public static abstract class Request { public static abstract class Request { IVoiceInteractorRequest mRequestInterface; IVoiceInteractorRequest mRequestInterface; Loading Loading @@ -228,6 +245,36 @@ public class VoiceInteractor { } } } } public static class CompleteVoiceRequest extends Request { final CharSequence mMessage; final Bundle mExtras; /** * Reports that the current interaction was successfully completed with voice, so the * application can report the final status to the user. When the response comes back, the * voice system has handled the request and is ready to switch; at that point the * application can start a new non-voice activity or finish. Be sure when starting the new * activity to use {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK * Intent.FLAG_ACTIVITY_NEW_TASK} to keep the new activity out of the current voice * interaction task. * * @param message Optional message to tell user about the completion status of the task. * @param extras Additional optional information. */ public CompleteVoiceRequest(CharSequence message, Bundle extras) { mMessage = message; mExtras = extras; } public void onCompleteResult(Bundle result) { } IVoiceInteractorRequest submit(IVoiceInteractor interactor, String packageName, IVoiceInteractorCallback callback) throws RemoteException { return interactor.startCompleteVoice(packageName, callback, mMessage, mExtras); } } public static class AbortVoiceRequest extends Request { public static class AbortVoiceRequest extends Request { final CharSequence mMessage; final CharSequence mMessage; final Bundle mExtras; final Bundle mExtras; Loading
core/java/android/service/voice/VoiceInteractionSession.java +53 −4 Original line number Original line Diff line number Diff line Loading @@ -107,6 +107,16 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { return request.mInterface; return request.mInterface; } } @Override public IVoiceInteractorRequest startCompleteVoice(String callingPackage, IVoiceInteractorCallback callback, CharSequence message, Bundle extras) { Request request = newRequest(callback); mHandlerCaller.sendMessage(mHandlerCaller.obtainMessageOOOO(MSG_START_COMPLETE_VOICE, new Caller(callingPackage, Binder.getCallingUid()), request, message, extras)); return request.mInterface; } @Override @Override public IVoiceInteractorRequest startAbortVoice(String callingPackage, public IVoiceInteractorRequest startAbortVoice(String callingPackage, IVoiceInteractorCallback callback, CharSequence message, Bundle extras) { IVoiceInteractorCallback callback, CharSequence message, Bundle extras) { Loading Loading @@ -208,6 +218,16 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { } } } } public void sendCompleteVoiceResult(Bundle result) { try { if (DEBUG) Log.d(TAG, "sendCompleteVoiceResult: req=" + mInterface + " result=" + result); finishRequest(); mCallback.deliverCompleteVoiceResult(mInterface, result); } catch (RemoteException e) { } } public void sendAbortVoiceResult(Bundle result) { public void sendAbortVoiceResult(Bundle result) { try { try { if (DEBUG) Log.d(TAG, "sendConfirmResult: req=" + mInterface if (DEBUG) Log.d(TAG, "sendConfirmResult: req=" + mInterface Loading Loading @@ -249,10 +269,11 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { } } static final int MSG_START_CONFIRMATION = 1; static final int MSG_START_CONFIRMATION = 1; static final int MSG_START_ABORT_VOICE = 2; static final int MSG_START_COMPLETE_VOICE = 2; static final int MSG_START_COMMAND = 3; static final int MSG_START_ABORT_VOICE = 3; static final int MSG_SUPPORTS_COMMANDS = 4; static final int MSG_START_COMMAND = 4; static final int MSG_CANCEL = 5; static final int MSG_SUPPORTS_COMMANDS = 5; static final int MSG_CANCEL = 6; static final int MSG_TASK_STARTED = 100; static final int MSG_TASK_STARTED = 100; static final int MSG_TASK_FINISHED = 101; static final int MSG_TASK_FINISHED = 101; Loading @@ -271,6 +292,13 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { onConfirm((Caller)args.arg1, (Request)args.arg2, (CharSequence)args.arg3, onConfirm((Caller)args.arg1, (Request)args.arg2, (CharSequence)args.arg3, (Bundle)args.arg4); (Bundle)args.arg4); break; break; case MSG_START_COMPLETE_VOICE: args = (SomeArgs)msg.obj; if (DEBUG) Log.d(TAG, "onCompleteVoice: req=" + ((Request) args.arg2).mInterface + " message=" + args.arg3 + " extras=" + args.arg4); onCompleteVoice((Caller) args.arg1, (Request) args.arg2, (CharSequence) args.arg3, (Bundle) args.arg4); break; case MSG_START_ABORT_VOICE: case MSG_START_ABORT_VOICE: args = (SomeArgs)msg.obj; args = (SomeArgs)msg.obj; if (DEBUG) Log.d(TAG, "onAbortVoice: req=" + ((Request) args.arg2).mInterface if (DEBUG) Log.d(TAG, "onAbortVoice: req=" + ((Request) args.arg2).mInterface Loading Loading @@ -700,6 +728,27 @@ public abstract class VoiceInteractionSession implements KeyEvent.Callback { public abstract void onConfirm(Caller caller, Request request, CharSequence prompt, public abstract void onConfirm(Caller caller, Request request, CharSequence prompt, Bundle extras); Bundle extras); /** * Request to complete the voice interaction session because the voice activity successfully * completed its interaction using voice. Corresponds to * {@link android.app.VoiceInteractor.CompleteVoiceRequest * VoiceInteractor.CompleteVoiceRequest}. The default implementation just sends an empty * confirmation back to allow the activity to exit. * * @param caller Who is making the request. * @param request The active request. * @param message The message informing the user of the problem, as per * {@link android.app.VoiceInteractor.CompleteVoiceRequest * VoiceInteractor.CompleteVoiceRequest}. * @param extras Any additional information, as per * {@link android.app.VoiceInteractor.CompleteVoiceRequest * VoiceInteractor.CompleteVoiceRequest}. */ public void onCompleteVoice(Caller caller, Request request, CharSequence message, Bundle extras) { request.sendCompleteVoiceResult(null); } /** /** * Request to abort the voice interaction session because the voice activity can not * Request to abort the voice interaction session because the voice activity can not * complete its interaction using voice. Corresponds to * complete its interaction using voice. Corresponds to Loading
core/java/com/android/internal/app/IVoiceInteractor.aidl +2 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,8 @@ import com.android.internal.app.IVoiceInteractorRequest; interface IVoiceInteractor { interface IVoiceInteractor { IVoiceInteractorRequest startConfirmation(String callingPackage, IVoiceInteractorRequest startConfirmation(String callingPackage, IVoiceInteractorCallback callback, CharSequence prompt, in Bundle extras); IVoiceInteractorCallback callback, CharSequence prompt, in Bundle extras); IVoiceInteractorRequest startCompleteVoice(String callingPackage, IVoiceInteractorCallback callback, CharSequence message, in Bundle extras); IVoiceInteractorRequest startAbortVoice(String callingPackage, IVoiceInteractorRequest startAbortVoice(String callingPackage, IVoiceInteractorCallback callback, CharSequence message, in Bundle extras); IVoiceInteractorCallback callback, CharSequence message, in Bundle extras); IVoiceInteractorRequest startCommand(String callingPackage, IVoiceInteractorRequest startCommand(String callingPackage, Loading
core/java/com/android/internal/app/IVoiceInteractorCallback.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.internal.app.IVoiceInteractorRequest; oneway interface IVoiceInteractorCallback { oneway interface IVoiceInteractorCallback { void deliverConfirmationResult(IVoiceInteractorRequest request, boolean confirmed, void deliverConfirmationResult(IVoiceInteractorRequest request, boolean confirmed, in Bundle result); in Bundle result); void deliverCompleteVoiceResult(IVoiceInteractorRequest request, in Bundle result); void deliverAbortVoiceResult(IVoiceInteractorRequest request, in Bundle result); void deliverAbortVoiceResult(IVoiceInteractorRequest request, in Bundle result); void deliverCommandResult(IVoiceInteractorRequest request, boolean complete, in Bundle result); void deliverCommandResult(IVoiceInteractorRequest request, boolean complete, in Bundle result); void deliverCancel(IVoiceInteractorRequest request); void deliverCancel(IVoiceInteractorRequest request); Loading