diff options
| author | Amith Yamasani <yamasani@google.com> | 2016-01-17 15:36:19 -0800 |
|---|---|---|
| committer | Amith Yamasani <yamasani@google.com> | 2016-01-23 21:25:50 -0800 |
| commit | 0af6fa7015cd9da08bf52c1efb13641d30fd6bd7 (patch) | |
| tree | e73062130b029fc260b14728c77a99e37b02d93b /core/java/android/app/ApplicationThreadNative.java | |
| parent | b9dd234a6c30921a04d16dbd73826eb919537111 (diff) | |
Voice Interaction from within an Activity
This allows an app to show a voice search button
and invoke a voice interaction session for use
within the activity. Once the activity exits, the
session is stopped.
Test application has a new activity that
demonstrates it with the test voice interaction
service.
This initial version is functional enough for
an integration test, with some more tests
and improvements to come later.
Bug: 22791070
Change-Id: Ib1e5bc8cae1fde40570c999b9cf4bb29efe4916d
Diffstat (limited to 'core/java/android/app/ApplicationThreadNative.java')
| -rw-r--r-- | core/java/android/app/ApplicationThreadNative.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index 5951c8d9c958..9be7f23d3a63 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -425,6 +425,16 @@ public abstract class ApplicationThreadNative extends Binder return true; } + case SCHEDULE_LOCAL_VOICE_INTERACTION_STARTED_TRANSACTION: + { + data.enforceInterface(IApplicationThread.descriptor); + IBinder token = data.readStrongBinder(); + IVoiceInteractor voiceInteractor = IVoiceInteractor.Stub.asInterface( + data.readStrongBinder()); + scheduleLocalVoiceInteractionStarted(token, voiceInteractor); + return true; + } + case PROFILER_CONTROL_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); @@ -1101,6 +1111,17 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } + public final void scheduleLocalVoiceInteractionStarted(IBinder token, + IVoiceInteractor voiceInteractor) throws RemoteException { + Parcel data = Parcel.obtain(); + data.writeInterfaceToken(IApplicationThread.descriptor); + data.writeStrongBinder(token); + data.writeStrongBinder(voiceInteractor != null ? voiceInteractor.asBinder() : null); + mRemote.transact(SCHEDULE_LOCAL_VOICE_INTERACTION_STARTED_TRANSACTION, data, null, + IBinder.FLAG_ONEWAY); + data.recycle(); + } + public void updateTimeZone() throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); |
