Package org.robolectric.shadows
Class ShadowVoiceInteractionSession
java.lang.Object
org.robolectric.shadows.ShadowVoiceInteractionSession
@Implements(value=android.service.voice.VoiceInteractionSession.class,
            minSdk=21)
public class ShadowVoiceInteractionSession
extends Object
Shadow implementation of 
VoiceInteractionSession.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcreate()Simulates the creation of theVoiceInteractionSession, as if it was being created by the framework.com.google.common.collect.ImmutableList<Intent>Returns the list ofIntentinstances passed intoVoiceInteractionSession.startAssistantActivity(Intent)in invocation order.Returns the lastIntentpassed intoVoiceInteractionSession.startAssistantActivity(Intent)ornullif there wasn't any.Returns the lastIntentpassed intoVoiceInteractionSession.startVoiceActivity(Intent)ornullif there wasn't any.com.google.common.collect.ImmutableList<Intent>Returns the list ofIntentinstances passed intoVoiceInteractionSession.startVoiceActivity(Intent)in invocation order.booleanReturns whether theVoiceInteractionSessionis in the process of being destroyed and finishing.booleanReturns whether the UI is set to be enabled throughVoiceInteractionSession.setUiEnabled(boolean).booleanReturns whether the UI window fromVoiceInteractionSessionis currently showing.booleanReturns whether the window fromVoiceInteractionSessionis currently visible.sendCommandRequest(VoiceInteractor.CommandRequest commandRequest, String packageName, int uid) Simulates the creation of theVoiceInteractionSession.CommandRequestrelated to the providedVoiceInteractor.CommandRequest, as if it was being created by the framework.voidSets aRuntimeExceptionthat should be thrown whenVoiceInteractionSession.startAssistantActivity(Intent)is invoked.voidsetStartVoiceActivityException(RuntimeException exception) Sets aRuntimeExceptionthat should be thrown whenVoiceInteractionSession.startVoiceActivity(Intent)is invoked.
- 
Constructor Details- 
ShadowVoiceInteractionSessionpublic ShadowVoiceInteractionSession()
 
- 
- 
Method Details- 
createpublic void create()Simulates the creation of theVoiceInteractionSession, as if it was being created by the framework.This method must be called before state changing methods of VoiceInteractionSession.
- 
getLastAssistantActivityIntentReturns the lastIntentpassed intoVoiceInteractionSession.startAssistantActivity(Intent)ornullif there wasn't any.
- 
getAssistantActivityIntentsReturns the list ofIntentinstances passed intoVoiceInteractionSession.startAssistantActivity(Intent)in invocation order.
- 
getLastVoiceActivityIntentReturns the lastIntentpassed intoVoiceInteractionSession.startVoiceActivity(Intent)ornullif there wasn't any.
- 
getVoiceActivityIntentsReturns the list ofIntentinstances passed intoVoiceInteractionSession.startVoiceActivity(Intent)in invocation order.
- 
isWindowVisiblepublic boolean isWindowVisible()Returns whether the window fromVoiceInteractionSessionis currently visible. Although window is visible this method does not check whether UI content of window is also showed.
- 
isWindowShowingpublic boolean isWindowShowing()Returns whether the UI window fromVoiceInteractionSessionis currently showing.
- 
isUiEnabledpublic boolean isUiEnabled()Returns whether the UI is set to be enabled throughVoiceInteractionSession.setUiEnabled(boolean).
- 
isFinishingpublic boolean isFinishing()Returns whether theVoiceInteractionSessionis in the process of being destroyed and finishing.
- 
setStartVoiceActivityExceptionSets aRuntimeExceptionthat should be thrown whenVoiceInteractionSession.startVoiceActivity(Intent)is invoked.- See Also:
- 
- Instrumentation.checkStartActivityResult for possible runtime exceptions that can be thrown.
 
 
- 
setStartAssistantActivityExceptionSets aRuntimeExceptionthat should be thrown whenVoiceInteractionSession.startAssistantActivity(Intent)is invoked.- See Also:
- 
- Instrumentation.checkStartActivityResult for possible runtime exceptions that can be thrown.
 
 
- 
sendCommandRequestpublic VoiceInteractionSession.CommandRequest sendCommandRequest(@Nonnull VoiceInteractor.CommandRequest commandRequest, @Nonnull String packageName, int uid) Simulates the creation of theVoiceInteractionSession.CommandRequestrelated to the providedVoiceInteractor.CommandRequest, as if it was being created by the framework. The method callsVoiceInteractionSession.onRequestCommand(CommandRequest)with newly createdVoiceInteractionSession.CommandRequest.- Parameters:
- commandRequest- : Command request sent by a third-party application.
- packageName- : Package name of the application that initiated the request.
- uid- : User ID of the application that initiated the request.
- Returns:
- newly created VoiceInteractionSession.CommandRequest
 
 
-