Package org.robolectric.shadows
Class ShadowSpeechRecognizerProxy
java.lang.Object
org.robolectric.shadows.ShadowSpeechRecognizer
org.robolectric.shadows.ShadowSpeechRecognizerProxy
@Implements(className="android.speech.SpeechRecognizerProxy",
isInAndroidSdk=false,
minSdk=35)
public class ShadowSpeechRecognizerProxy
extends ShadowSpeechRecognizer
Robolectric shadow for SpeechRecognizerProxy.
Prior to Android V, SpeechRecognizer contained all functionality within one class. The ShadowSpeechRecognizer
shadow would work correctly to shadow both static and instance functions
of the class. With Android V, the instance of SpeechRecognizer
returned from SpeechRecognizer.createSpeechRecognizer(Context)
is an instance of SpeechRecognizerProxy
which delegates all calls to SpeechRecognizerImpl
.
This shadow (for the proxy subclass) works in coordination with ShadowSpeechRecognizerImpl
to ensure that the functionality of ShadowSpeechRecognizer
still works in tests prior to Android V and on Android V+.
Customizations for this implementation:
- Does not intercept any public API since all calls will be placed to
SpeechRecognizerImpl
- Instead of returning its own state, returns the state of the delegate (ShadowSpeechRecognizerImpl)
- No change in direct accessor since it is not required
-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowSpeechRecognizer
ShadowSpeechRecognizer.ShadowSpeechRecognizerDirectAccessors, ShadowSpeechRecognizer.ShadowSpeechRecognizerState
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetState()
The proxy and its shadow do not store their own state and this shadow does not intercept any of the relevant functions on its shadowed class.Methods inherited from class org.robolectric.shadows.ShadowSpeechRecognizer
checkRecognitionSupport, createOnDeviceSpeechRecognizer, createSpeechRecognizer, destroy, getDirectAccessors, getLastRecognizerIntent, getLatestModelDownloadIntent, getLatestSpeechRecognizer, handleChangeListener, isDestroyed, isOnDeviceRecognitionAvailable, reset, setIsOnDeviceRecognitionAvailable, startListening, triggerModelDownload, triggerOnEndOfSpeech, triggerOnError, triggerOnPartialResults, triggerOnReadyForSpeech, triggerOnResults, triggerOnRmsChanged, triggerSupportError, triggerSupportResult
-
Field Details
-
CLASS_NAME
- See Also:
-
-
Constructor Details
-
ShadowSpeechRecognizerProxy
public ShadowSpeechRecognizerProxy()
-
-
Method Details
-
getState
The proxy and its shadow do not store their own state and this shadow does not intercept any of the relevant functions on its shadowed class. Rather, the delegate within the proxy has the correct state and intercepts such calls.- Overrides:
getState
in classShadowSpeechRecognizer
-