Loading core/java/android/service/voice/VoiceInteractionService.java +3 −3 Original line number Diff line number Diff line Loading @@ -348,7 +348,7 @@ public class VoiceInteractionService extends Service { */ public final void setVoiceState(int state) { try { mSystemService.setVoiceState(state); mSystemService.setVoiceState(mInterface, state); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -359,7 +359,7 @@ public class VoiceInteractionService extends Service { */ public final void setTranscription(@NonNull String transcription) { try { mSystemService.setTranscription(transcription); mSystemService.setTranscription(mInterface, transcription); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -372,7 +372,7 @@ public class VoiceInteractionService extends Service { */ public final void clearTranscription(boolean immediate) { try { mSystemService.clearTranscription(immediate); mSystemService.clearTranscription(mInterface, immediate); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -155,15 +155,15 @@ interface IVoiceInteractionManagerService { /** * Sets the transcribed voice to the given string. */ void setTranscription(String transcription); void setTranscription(IVoiceInteractionService service, String transcription); /** * Indicates that the transcription session is finished. */ void clearTranscription(boolean immediate); void clearTranscription(IVoiceInteractionService service, boolean immediate); /** * Sets the voice state indication based upon the given value. */ void setVoiceState(int state); void setVoiceState(IVoiceInteractionService service, int state); } services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +23 −28 Original line number Diff line number Diff line Loading @@ -613,11 +613,8 @@ public class VoiceInteractionManagerService extends SystemService { @Override public void showSession(IVoiceInteractionService service, Bundle args, int flags) { synchronized (this) { if (mImpl == null || mImpl.mService == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); final long caller = Binder.clearCallingIdentity(); try { mImpl.showSessionLocked(args, flags, null, null); Loading Loading @@ -896,11 +893,7 @@ public class VoiceInteractionManagerService extends SystemService { public boolean isEnrolledForKeyphrase(IVoiceInteractionService service, int keyphraseId, String bcp47Locale) { synchronized (this) { if (mImpl == null || mImpl.mService == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); } if (bcp47Locale == null) { Loading @@ -922,11 +915,7 @@ public class VoiceInteractionManagerService extends SystemService { public ModuleProperties getDspModuleProperties(IVoiceInteractionService service) { // Allow the call if this is the current voice interaction service. synchronized (this) { if (mImpl == null || mImpl.mService == null || service == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); final long caller = Binder.clearCallingIdentity(); try { Loading @@ -943,11 +932,7 @@ public class VoiceInteractionManagerService extends SystemService { RecognitionConfig recognitionConfig) { // Allow the call if this is the current voice interaction service. synchronized (this) { if (mImpl == null || mImpl.mService == null || service == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); if (callback == null || recognitionConfig == null || bcp47Locale == null) { throw new IllegalArgumentException("Illegal argument(s) in startRecognition"); Loading Loading @@ -983,11 +968,7 @@ public class VoiceInteractionManagerService extends SystemService { IRecognitionStatusCallback callback) { // Allow the call if this is the current voice interaction service. synchronized (this) { if (mImpl == null || mImpl.mService == null || service == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); } final long caller = Binder.clearCallingIdentity(); Loading Loading @@ -1212,8 +1193,10 @@ public class VoiceInteractionManagerService extends SystemService { } @Override public void setTranscription(String transcription) { public void setTranscription(IVoiceInteractionService service, String transcription) { synchronized (this) { enforceIsCurrentVoiceInteractionService(service); final int size = mVoiceInteractionSessionListeners.beginBroadcast(); for (int i = 0; i < size; ++i) { final IVoiceInteractionSessionListener listener = Loading @@ -1229,8 +1212,10 @@ public class VoiceInteractionManagerService extends SystemService { } @Override public void clearTranscription(boolean immediate) { public void clearTranscription(IVoiceInteractionService service, boolean immediate) { synchronized (this) { enforceIsCurrentVoiceInteractionService(service); final int size = mVoiceInteractionSessionListeners.beginBroadcast(); for (int i = 0; i < size; ++i) { final IVoiceInteractionSessionListener listener = Loading @@ -1246,8 +1231,10 @@ public class VoiceInteractionManagerService extends SystemService { } @Override public void setVoiceState(int state) { public void setVoiceState(IVoiceInteractionService service, int state) { synchronized (this) { enforceIsCurrentVoiceInteractionService(service); final int size = mVoiceInteractionSessionListeners.beginBroadcast(); for (int i = 0; i < size; ++i) { final IVoiceInteractionSessionListener listener = Loading @@ -1269,6 +1256,14 @@ public class VoiceInteractionManagerService extends SystemService { } } private void enforceIsCurrentVoiceInteractionService(IVoiceInteractionService service) { if (mImpl == null || mImpl.mService == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException("Caller is not the current voice interaction service"); } } private void setImplLocked(VoiceInteractionManagerServiceImpl impl) { mImpl = impl; mAtmInternal.notifyActiveVoiceInteractionServiceChanged( Loading Loading
core/java/android/service/voice/VoiceInteractionService.java +3 −3 Original line number Diff line number Diff line Loading @@ -348,7 +348,7 @@ public class VoiceInteractionService extends Service { */ public final void setVoiceState(int state) { try { mSystemService.setVoiceState(state); mSystemService.setVoiceState(mInterface, state); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -359,7 +359,7 @@ public class VoiceInteractionService extends Service { */ public final void setTranscription(@NonNull String transcription) { try { mSystemService.setTranscription(transcription); mSystemService.setTranscription(mInterface, transcription); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -372,7 +372,7 @@ public class VoiceInteractionService extends Service { */ public final void clearTranscription(boolean immediate) { try { mSystemService.clearTranscription(immediate); mSystemService.clearTranscription(mInterface, immediate); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -155,15 +155,15 @@ interface IVoiceInteractionManagerService { /** * Sets the transcribed voice to the given string. */ void setTranscription(String transcription); void setTranscription(IVoiceInteractionService service, String transcription); /** * Indicates that the transcription session is finished. */ void clearTranscription(boolean immediate); void clearTranscription(IVoiceInteractionService service, boolean immediate); /** * Sets the voice state indication based upon the given value. */ void setVoiceState(int state); void setVoiceState(IVoiceInteractionService service, int state); }
services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +23 −28 Original line number Diff line number Diff line Loading @@ -613,11 +613,8 @@ public class VoiceInteractionManagerService extends SystemService { @Override public void showSession(IVoiceInteractionService service, Bundle args, int flags) { synchronized (this) { if (mImpl == null || mImpl.mService == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); final long caller = Binder.clearCallingIdentity(); try { mImpl.showSessionLocked(args, flags, null, null); Loading Loading @@ -896,11 +893,7 @@ public class VoiceInteractionManagerService extends SystemService { public boolean isEnrolledForKeyphrase(IVoiceInteractionService service, int keyphraseId, String bcp47Locale) { synchronized (this) { if (mImpl == null || mImpl.mService == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); } if (bcp47Locale == null) { Loading @@ -922,11 +915,7 @@ public class VoiceInteractionManagerService extends SystemService { public ModuleProperties getDspModuleProperties(IVoiceInteractionService service) { // Allow the call if this is the current voice interaction service. synchronized (this) { if (mImpl == null || mImpl.mService == null || service == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); final long caller = Binder.clearCallingIdentity(); try { Loading @@ -943,11 +932,7 @@ public class VoiceInteractionManagerService extends SystemService { RecognitionConfig recognitionConfig) { // Allow the call if this is the current voice interaction service. synchronized (this) { if (mImpl == null || mImpl.mService == null || service == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); if (callback == null || recognitionConfig == null || bcp47Locale == null) { throw new IllegalArgumentException("Illegal argument(s) in startRecognition"); Loading Loading @@ -983,11 +968,7 @@ public class VoiceInteractionManagerService extends SystemService { IRecognitionStatusCallback callback) { // Allow the call if this is the current voice interaction service. synchronized (this) { if (mImpl == null || mImpl.mService == null || service == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException( "Caller is not the current voice interaction service"); } enforceIsCurrentVoiceInteractionService(service); } final long caller = Binder.clearCallingIdentity(); Loading Loading @@ -1212,8 +1193,10 @@ public class VoiceInteractionManagerService extends SystemService { } @Override public void setTranscription(String transcription) { public void setTranscription(IVoiceInteractionService service, String transcription) { synchronized (this) { enforceIsCurrentVoiceInteractionService(service); final int size = mVoiceInteractionSessionListeners.beginBroadcast(); for (int i = 0; i < size; ++i) { final IVoiceInteractionSessionListener listener = Loading @@ -1229,8 +1212,10 @@ public class VoiceInteractionManagerService extends SystemService { } @Override public void clearTranscription(boolean immediate) { public void clearTranscription(IVoiceInteractionService service, boolean immediate) { synchronized (this) { enforceIsCurrentVoiceInteractionService(service); final int size = mVoiceInteractionSessionListeners.beginBroadcast(); for (int i = 0; i < size; ++i) { final IVoiceInteractionSessionListener listener = Loading @@ -1246,8 +1231,10 @@ public class VoiceInteractionManagerService extends SystemService { } @Override public void setVoiceState(int state) { public void setVoiceState(IVoiceInteractionService service, int state) { synchronized (this) { enforceIsCurrentVoiceInteractionService(service); final int size = mVoiceInteractionSessionListeners.beginBroadcast(); for (int i = 0; i < size; ++i) { final IVoiceInteractionSessionListener listener = Loading @@ -1269,6 +1256,14 @@ public class VoiceInteractionManagerService extends SystemService { } } private void enforceIsCurrentVoiceInteractionService(IVoiceInteractionService service) { if (mImpl == null || mImpl.mService == null || service.asBinder() != mImpl.mService.asBinder()) { throw new SecurityException("Caller is not the current voice interaction service"); } } private void setImplLocked(VoiceInteractionManagerServiceImpl impl) { mImpl = impl; mAtmInternal.notifyActiveVoiceInteractionServiceChanged( Loading