Package org.robolectric.shadows
Class ShadowInstrumentation
java.lang.Object
org.robolectric.shadows.ShadowInstrumentation
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReflector interface forInstrumentation's internals. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbindService(Intent intent, int flags, Executor executor, ServiceConnection serviceConnection) protected booleanbindService(Intent intent, ServiceConnection serviceConnection, int flags) protected voidexecStartActivities(Context who, IBinder contextThread, IBinder token, Activity target, Intent[] intents, Bundle options) protected Instrumentation.ActivityResultexecStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options) protected Instrumentation.ActivityResultexecStartActivity(Context who, IBinder contextThread, IBinder token, Activity resultWho, Intent intent, int requestCode, Bundle options, UserHandle user) Behaves as {@link #execStartActivity(Context, IBinder, IBinder, Activity, Intent, int, Bundle).protected Instrumentation.ActivityResultexecStartActivity(Context who, IBinder contextThread, IBinder token, Fragment target, Intent intent, int requestCode, Bundle options) protected Instrumentation.ActivityResultexecStartActivity(Context who, IBinder contextThread, IBinder token, String target, Intent intent, int requestCode, Bundle options) protected Instrumentation.ActivityResultexecStartActivity(Context who, IBinder contextThread, IBinder token, String resultWho, Intent intent, int requestCode, Bundle options, UserHandle user) Behaves as {@link #execStartActivity(Context, IBinder, IBinder, String, Intent, int, Bundle).protected List<ServiceConnection>static Instrumentationprotected UiAutomationprotected UiAutomationgetUiAutomation(int flags) protected List<ServiceConnection>static voidrunOnMainSyncNoIdle(Runnable runnable) Executes a runnable depending on the LooperMode.protected voidsetInTouchMode(boolean inTouchMode) protected voidsetUnbindServiceCallsOnServiceDisconnected(boolean flag) protected ActivitystartActivitySync(Intent intent, Bundle options) protected ComponentNamestartService(Intent intent) protected voidunbindService(ServiceConnection serviceConnection)
-
Constructor Details
-
ShadowInstrumentation
public ShadowInstrumentation()
-
-
Method Details
-
startActivitySync
-
execStartActivities
-
execStartActivity
@Implementation protected Instrumentation.ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options) -
execStartActivity
@Implementation(maxSdk=22) protected Instrumentation.ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Fragment target, Intent intent, int requestCode, Bundle options) -
execStartActivity
@Implementation(minSdk=23) protected Instrumentation.ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, String target, Intent intent, int requestCode, Bundle options) -
execStartActivity
@Implementation(maxSdk=25) protected Instrumentation.ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity resultWho, Intent intent, int requestCode, Bundle options, UserHandle user) Behaves as {@link #execStartActivity(Context, IBinder, IBinder, Activity, Intent, int, Bundle).Currently ignores the user.
-
execStartActivity
@Implementation(minSdk=26) protected Instrumentation.ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, String resultWho, Intent intent, int requestCode, Bundle options, UserHandle user) Behaves as {@link #execStartActivity(Context, IBinder, IBinder, String, Intent, int, Bundle).Currently ignores the user.
-
setInTouchMode
-
getUiAutomation
-
getUiAutomation
-
startService
-
bindService
protected boolean bindService(Intent intent, int flags, Executor executor, ServiceConnection serviceConnection) -
bindService
-
setUnbindServiceCallsOnServiceDisconnected
protected void setUnbindServiceCallsOnServiceDisconnected(boolean flag) -
unbindService
-
getBoundServiceConnections
-
getUnboundServiceConnections
-
getUnbindableActions
-
getInstrumentation
-
runOnMainSyncNoIdle
Executes a runnable depending on the LooperMode.For INSTRUMENTATION_TEST mode, will post the runnable to the instrumentation thread and block the caller's thread until that runnable is executed.
For other modes, simply executes the runnable.
- Parameters:
runnable- a runnable to be executed
-