-
Deprecated ClassesClassDescriptionNative Fragments have been deprecated in Android P. Android encourages developers to use androidx fragments, to test these use FragmentScenario.only works when used in conjunction with the deprecated
LooperMode.LEGACYmode. Consider using guava'sMoreExecutors#directExecutor()orPausedExecutorServiceorInlineExecutorService.UseMatrixCursorinstead.UseMatrixCursorinstead.UseGnssStatus.Builderinstead where possible.
-
Deprecated FieldsFieldDescriptionPlease use {#getApplication} instead. Accessing this field directly is inherently incompatible with
LazyApplicationand Robolectric makes no guarantees if a test *modifies* this field during execution.UseRuntimeEnvironment.getApplication()instead. Note that unlike the alternative, this field is inherently incompatible withLazyApplication. This field may be removed in a later releaseUseShadowTelecomManager.CallRecord.extrasinstead.
-
Deprecated MethodsMethodDescriptionUse the appropriate builder in
org.robolectric.Robolectricinstead. This method will be removed in Robolectric 3.6.Do not use.Do not use.UseActivityManager.getLockTaskModeState()instead.Prefer using overload withShadowActivityManager.ApplicationExitInfoBuilderdo not usePrefer to useShadowAlarmManager.setAutoSchedule(boolean)in combination with incrementing time to actually run alarms and test their side-effects.use PowerManager APIs insteaduse ShadowPowerManager.clearWakeLocksPlease useContext.getSystemService(Context.APPWIDGET_SERVICE)intstead.useorg.robolectric.Robolectric#getBackgroundThreadScheduler()UseBluetoothAdapter.getDefaultAdapter()()} instead.useorg.robolectric.Robolectric#getForegroundThreadScheduler()UseshadowOf({@link ApplicationProvider#getApplicationContext()})instead.UseShadowAlertDialog.getLatestAlertDialog()instead.UseShadowDialog.getLatestDialog()instead.UseShadowPopupMenu.getLatestPopupMenu()instead.use ShadowPowerManager.getLatestWakeLockuse PackageManager.queryBroadcastReceivers insteaduse PackageManager.queryBroadcastReceivers insteadDo not depend on this method to override services as it will be removed in a future update. The preferered method is use the shadow of the corresponding service.Avoid use.Avoid use.use ShadowBitmap#getCreatedFromResId() instead.Use any of the BitmapFactory.decode methods with real image data.Use any of the BitmapFactory.decode methods with real image data.Use any of the BitmapFactory.decode methods with real image data.Use any of the BitmapFactory.decode methods with real image data.use real BluetoothLeAdvertiser insteadUse theLooperMode.Mode.PAUSEDlooper andShadowChoreographer.getFrameDelay()to configure the frame delay.Use theLooperMode.Mode.PAUSEDlooper andShadowChoreographer.setFrameDelay(Duration)to configure the frame delay.Use theLooperMode.Mode.PAUSEDlooper instead.Use theLooperMode.Mode.PAUSEDlooper andShadowChoreographer.setPaused(boolean)andShadowChoreographer.setFrameDelay(Duration)to configure the vsync event behavior.implementation detail - use public Android APIs insteadimplementation detail - use public Android APIs insteadimplementation detail - use public Android APIs insteadimplementation detail - use public Android APIs insteadimplementation detail - use public Android APIs insteadimplementation detail - use public Android APIs insteadimplementation detail - use public Android APIs insteadThis method does not work withContentResolver.acquireContentProviderClient(android.net.Uri)This method does not work withContentResolver.acquireContentProviderClient(android.net.Uri)This method does not work withContentResolver.acquireContentProviderClient(android.net.Uri)This method does not work withContentResolver.acquireContentProviderClient(android.net.Uri)This method affects all calls, and does not work withContentResolver.acquireContentProviderClient(android.net.Uri)This method affects all calls, and does not work withContentResolver.acquireContentProviderClient(android.net.Uri)UseShadowCrossProfileApps.peekNextStartedActivity()instead.This behavior is deprecated and will be removed in Robolectric 3.7.This behavior is deprecated and will be removed in Robolectric 3.7.This behavior is deprecated and will be removed in Robolectric 3.7.This behavior is deprecated and will be removed in Robolectric 3.7.This behavior is deprecated and will be removed in Robolectric 3.7.This method is deprecated and will be removed in Robolectric 3.7.This method is deprecated and will be removed in Robolectric 3.7.This method is deprecated and will be removed in Robolectric 3.7.useContextCompat.getDrawable(context, resourceId)useShadowFingerprintManager.setDefaultFingerprints(int)instead.Use aHandlerinstance to post to a looper.Use aHandlerinstance to post to a looper.Do not test listeners, instead useShadowLocationManager.simulateLocation(Location)and test the results of those listeners being invoked.Do not test listeners, instead useShadowLocationManager.simulateLocation(Location)and test the results of those listeners being invoked.Do not test pending intents, instead useShadowLocationManager.simulateLocation(Location)and test the results of those pending intent being invoked.Do not test pending intents, instead useShadowLocationManager.simulateLocation(Location)and test the results of those pending intent being invoked.Do not test listeners, instead useShadowLocationManager.simulateLocation(Location)and test the results of those listeners being invoked.UseShadowLocationManager.simulateGnssAntennaInfo(List)instead.UseShadowLocationManager.simulateGnssStatus(GnssStatus)instead.UseShadowLocationManager.simulateLocation(Location)to update the last location for a provider.UseshadowOf({@link Looper#getMainLooper()})instead.Use aHandlerinstance to post to a looper.Use aHandlerinstance to post to a looper.use addExtensionMimeTypeMappinguseMotionEvent.obtain()orandroidx.test.core.view.MotionEventBuilderto create a MotionEvent with desired data.useMotionEvent.obtain()orMotionEventBuilderto create a MotionEvent with desired datauseMotionEvent.obtain()orandroidx.test.core.view.MotionEventBuilder#setPointerAction(int, int)to create a MotionEvent with desired data.UseShadowPackageManager.installPackage(PackageInfo)instead.useShadowPackageManager.addIntentFilterForComponent(android.content.ComponentName, android.content.IntentFilter, java.util.Map<android.content.ComponentName, java.util.List<android.content.IntentFilter>>)instead and if the component doesn't exist add it using any ofShadowPackageManager.installPackage(android.content.pm.PackageInfo),ShadowPackageManager.addOrUpdateActivity(android.content.pm.ActivityInfo),ShadowPackageManager.addActivityIfNotPresent(android.content.ComponentName)or their counterparts for other types of components.see the note onShadowPackageManager.addResolveInfoForIntent(Intent, ResolveInfo).see the note onShadowPackageManager.addResolveInfoForIntent(Intent, ResolveInfo).It is recommended to switch to androidx's AsyncTaskLoader, which provides an overridable getExecutor method.this method only exists to accommodate legacy tests with preexisting issues. Silently discarding exceptions is not recommended, and can lead to deadlocks.preferShadowPendingIntent.isActivity()which was added toPendingIntentin API 31 (Android S).preferShadowPendingIntent.isBroadcast()which was added toPendingIntentin API 31 (Android S).preferShadowPendingIntent.isForegroundService()which was added toPendingIntentin API 31 (Android S).preferShadowPendingIntent.isService()which was added toPendingIntentin API 31 (Android S).PreferShadowPowerManager.turnScreenOn(boolean)instead.UseShadowPowerManager.turnScreenOn(boolean)instead.use ScanResult() insteaduse ScanResult() insteadUseShadowSensor.newInstance(int)to construct yourSensorand add to theSensorManagerusingShadowSensorManager.addSensor(Sensor)instead. This method will be removed at some point allowing us to use more of the realSensorManagercode.Don't call this method directly; instead, useSystem.nanoTime().API deprecated since Q, for testing, use setDefaultDialerPackage insteadAvoid using.Avoid using.TelephonyManager.getNetworkType()was replaced withTelephonyManager.getDataNetworkType()in Android N, and has been deprecated in Android R. Useinstead.preferShadowUsbDeviceConnection.getOutgoingDataStream(), which allows callers to know how much data has been read and when theUsbDeviceConnectioncloses.use either addUser() or addProfile()useShadowUserManager.setUserSwitchability(int)insteadUseShadowUserManager.addUser(int, String, int)to create a demo user instead of changing default user flags.UseShadowUserManager.addUser(int, String, int)to create a guest user instead of changing default user flags.UseShadowUserManager.addUser(int, String, int)to create a linked user instead of changing default user flags.UseShadowUserManager.addUser(int, String, int)to create a primary user instead of changing default user flags.useShadowUserManager#addUser()insteadUseShadowUserManager.addUser(int, String, int)to create a system user instead of changing default user flags.When possible, please use the real Android framework APIUserManager#setUserRestriction().- Please use Espresso for View interactions.Please use Espresso for view interactions- Please useandroidx.test.espresso.util.HumanReadables#describe(View)- Please useandroidx.test.espresso.util.HumanReadables#describe(View)- Please useandroidx.test.espresso.util.HumanReadables#describe(View)- Please useandroidx.test.espresso.util.HumanReadables#describe(View)Do not depend on this method as it will be removed in a future update. The preferred method is to populate a fake web history to use for going back.This is no longer set on T+ due to MEP as a single eUICC can have more than one ICCID tied to it. It is instead set viaUiccPortInfo.UseUiccCardInfoBuilder.setPhysicalSlotIndex(int)for Android T+ instead.
-
Deprecated ConstructorsConstructorDescription