-
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.Mode.LEGACYmode. Consider using guava'sMoreExecutors.directExecutor()orPausedExecutorServiceorInlineExecutorService.UseMatrixCursorinstead.UseMatrixCursorinstead.UseGnssStatus.Builderinstead where possible.AsyncTaskis deprecated in the Android SDK.AsyncTaskLoaderis deprecated in the Android SDK.useInputDeviceBuilder.AsyncTaskis deprecated in the Android SDK.AsyncTaskLoaderis deprecated in the Android SDK.run on Android APIs >= S, which allows the real Android mime type data to be usedAsyncTaskis deprecated in the Android SDK.AsyncTaskLoaderis deprecated in the Android SDK.UseRangingResultBuilderinstead.UseRangingResultBuilderinstead.
-
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 MethodsMethodDescriptionThe config change should be calculated internally by the activity controller based on the previous configuration, use
ActivityController.configurationChange(Configuration, DisplayMetrics)instead.Use the appropriate builder inorg.robolectric.Robolectricinstead.This method will be removed in Robolectric 3.6.
obsolete do not useTheSchedulerAPIs are designed for LEGACY Looper mode. Prefer to migrate tests to PAUSED Looper mode to avoid the need for this API.TheSchedulerAPIs are designed for LEGACY Looper mode. Prefer to migrate tests to PAUSED Looper mode to avoid the need for this API.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.useorg.robolectric.Robolectric#getBackgroundThreadScheduler()UseShadowAlertDialog.getLatestAlertDialog()instead.UseShadowDialog.getLatestDialog()instead.UseShadowPopupMenu.getLatestPopupMenu()instead.use PackageManager.queryBroadcastReceivers insteaduse PackageManager.queryBroadcastReceivers insteadThis is only for LEGACY Looper mode. Use PAUSED Looper mode instead.Do not depend on this method to override services as it will be removed in a future update. The preferred method is use the shadow of the corresponding service.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.useShadowChoreographer.getNextVsyncTimeNanos()insteadUse 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 insteadUseorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor instead.Useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor instead.Useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor instead.This method does not work withContentResolver.acquireContentProviderClient(android.net.Uri). Instead, useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor.Useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor instead.This method does not work withContentResolver.acquireContentProviderClient(android.net.Uri). Instead, useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor.This method does not work withContentResolver.acquireContentProviderClient(android.net.Uri). Instead, useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor.This method does not work withContentResolver.acquireContentProviderClient(android.net.Uri). Instead, useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor.This method affects all calls, and does not work withContentResolver.acquireContentProviderClient(android.net.Uri). Instead, useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor.This method affects all calls, and does not work withContentResolver.acquireContentProviderClient(android.net.Uri). Instead, useorg.robolectric.Robolectric#setupContentProvider(Class, String)to install a test-specific ContentProvider that can return any Cursor.UseShadowCrossProfileApps.peekNextStartedActivity()instead.This behavior is deprecated and will be removed in Robolectric 4.13.This behavior is deprecated and will be removed in Robolectric 4.13.This behavior is deprecated and will be removed in Robolectric 3.7.This method is deprecated and will be removed in Robolectric 4.13.useContextCompat.getDrawable(context, resourceId)useShadowFingerprintManager.setDefaultFingerprints(int)instead.Please add calls by adding a Call usingInCallService.InCallServiceBinder.Please remove calls by invokingCall.disconnect().useInputDeviceBuilder.useInputDeviceBuilder.useInputDeviceBuilder.useInputDeviceBuilder.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.useMotionEvent.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.Use{@link SensorEventBuilder#newBuilder()}instead.Use{@link SensorEventBuilder#newBuilder()}instead.Use{@link SensorEventBuilder#newBuilder()}instead.Don't call this method directly; instead, useSystem.nanoTime().API deprecated since Q, for testing, use setDefaultDialerPackage insteadAvoid using.Avoid using.for resetAllSimCountryIsosuse resetAllSimStates()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(int, String, int)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