Changelog History
Page 1
-
v4.5-alpha Changes
September 30, 2020π Robolectric 4.5 Alpha 1 adds support for Android API 30 (R final) and contains many bug fixes and other enhancements.
π More detailed release notes are forthcoming.
For all changes view the comparison to 4.4.
π Use Robolectric:
testCompile "org.robolectric:robolectric:4.5-alpha-1"
-
v4.4 Changes
August 24, 2020Robolectric 4.4 is a massive release in terms of improvements to Android compatibility. The most noticeable item in the release is that the new PAUSED looper mode is now the default. You can read about the PAUSED looper in more detail here: http://robolectric.org/blog/2019/06/04/paused-looper/.
Note:
π 1. Not all changes are listed in the release notes. There were many other minor changes (such as dependency version bumps) that weren't included in this list for brevity. For all changes view the comparison to 4.3.1. π 2. Some of the pull requests in this release may contain duplicate changes from other pull requests in this release. We apologize for this messy history, it was the result of some misconfigured code sync tool. Weβve taken measures to ensure it doesnβt happen any more.
π Use Robolectric:
testCompile "org.robolectric:robolectric:4.4"
π SDK/JVM support
- β Add support for Android Q final (#5289, #5292)
- π Support running on Java 11 (#5479, #5805)
- π Support running on Java 13 (#5550, #5786, #5805, #5819)
π Deprecations
- π Deprecate LooperMode LEGACY in favor of PAUSED (#5490), and default to PAUSED looper mode (#5491)
- π Accessibility checking is now deprecated and has been moved into a separate maven artifact
org.robolectric:plugin-accessibility-deprecated
. Accessibility checking will be removed entirely from Robolectric 4.5. Please switch to Espresso for accessibility checking. (#5547) - π Deprecate ShadowContentResolver shadow API because they do not work with ContentProviderClient (#5376)
- β‘οΈ Deprecate ShadowLocationManager.getLocationUpdateListeners and ShadowLocationManager.getLocationUpdateListeners (#5150)
- π Make it an error to run on Q with an unsupported java version
β instead of just silently skipping tests (#5290) - π Deprecate Robolectric's custom cursor implementation (#5613)
- π The BouncyCastle security provider is now considered deprecated due to the incompatibility with Java 9+ (#5849, #5850). This was preventing Robolectric tests (and Robolectric itself) from making HTTPS network requests on Java 9+. Long term the plan is to switch to Conscrypt.
β Android support / Robolectric test API improvements
- π Fix bug in ShadowImageDecoder.decodeBitmap (#4966)
- Use real setting for WIFI_SCAN_ALWAYS_AVAILABLE (#4968)
- β Add a shadow for Font.Builder (#4993)
- β Add killProcess implementation to ShadowProcess (#4985)
- β Add a shadow for CallLog.Calls (#4996)
- β Add a shadow for CallScreeningService (#4997)
- β Add several shadows for camera2 classes (#4874)
- β Add option to avoid calling ShadowApplication.onServiceDisconnected in ShadowApplication.unbindService (#4979)
- β Add ability to simulate Bluetooth unavailable in ShadowBluetoothAdapter (#5002)
- π¦ Implement ShadowApplicationPackageManager.getApplicationIcon(ApplicationInfo) (#5005)
- β Add ability to simulate SecurityExceptions in bindService (#4980)
- β Add ability to simulate enabled/disabled networks in ShadowWifiManager (#4974)
- β Add ability to simulate wifi usability system APIs in ShadowWifiManager (#5168)
- β Add null check in ShadowWifiManager.addNetwork (#5014)
- β Add shadow implementation of ShadowTelephonyManager#getDataState (#5003)
- Fall back to Android's implementation of getResourcesForApplication (#4969)
- Implement ShadowTypeface.equals and ShadowTypeface.hashCode (#4992)
- β Add ability to make ShadowContentResolver.registerContentObserver throw an exception (#4988)
- Implement ShadowSubscriptionManager.getActiveSubscriptionInfoCountMax (#5010)
- β Add ability to set system dialer package in ShadowTelecomManager (#4986)
- Implement ShadowSensorManager.registerListener 5-arg overload (#5014)
- β Add ability to get last flags set in ShadowUIModeManager (#5027)
- β Add a shadow for BluetoothA2dp (#5034)
- β Add shadow implementation for BluetoothDevice.createRfcommSocketToServiceRecord (#5034)
- β Add shadow implementations for BluetoothDevice.setPin and BluetoothDevice.setPairingConfirmation (and ability to get the values set) (#5116)
- β Adding shadow implementations of BluetoothDevice.getAlias and BlueToothDevice.getAliasName and related test APIs (#5222)
- β Adds the ability to get broadcast intents sent to a specific user (#5045)
- Validate intents passed to start/stop/bindService (#5053)
- Complete rewrite of ShadowLocationManager to improve fidelity (#5035, #5062, #5152, #5587, #5666)
- β Add ability to clear broadcast intents in ShadowContextWrapper (#5066)
- π Fix package name ShadowApplicationPackageManager's Activity Chooser (#5068)
- β Add shadow implementation for MediaPlayer#setDataSource(Context, Uri) (#5064)
- β Add shadow implementation for UserManager.getUserHandle(int) (#5065)
- β Add shadow implementations for DevicePolicyManager.setSystemUpdatePolicy and DevicePolicyManager.getSystemUpdatePolicy (#5069)
- β Remove ShadowOverscroller (#5081)
- β Add ability to simulate return value of AccessibilityService.getWindows list in ShadowAccessibilityService (#5083)
- π Fix bug in ShadowParcel.writeByteArray (#5089)
- β Add shadow implementation for UserManager.getUserName (#5099)
- π Improve fidelity of ShadowTime#parse3339 (#5101)
- β Add shadow for BiometricManager (#5072)
- Propagate RemoteException from Binder#onTransact method (#4984)
- β Add shadow for android.service.notification.NotificationListenerService.Ranking (#5113)
- β Add support for VibrationEffect.Prebaked in ShadowSystemVibrator (#5119
- β Add the ability to set Tx and Rx packets/bytes for ShadowTrafficStats (#5121)
- β Add shadow implementation for Activity.getCallingPackage (and the ability to set it) (#5126)
- β Add shadows for several telephony classes (android.telecom.Call, android.telecom.InCallAdapter, android.telecom.InCallService, android.telecom.Phone) (#5107)
- π Improve fidelity of ShadowCookieManager.removeSessionCookies (#5130)
- π Improve fidelity of OpEntry.getTime() and OpEntry.getDuration() in Q (#5133)
- 0οΈβ£ Set default NetworkCapabilities for the two Robolectric created Networks (#5129)
- Set the mimetype in ShadowBitmapFactory.decodeStream() (#5128)
- β Add module support for ShadowPackageManager and ShadowApplicationPackageManager (#5136)
- β Add the ability to set the external storage directory in ShadowEnvironment (#5140)
- β Add support for the dataChanged API in ShadowBackupManager (#5137)
- β Add ShadowContentResolver.registerInputStreamSupplier (#5142)
- π Notify settings ContentResolver when settings change (#5138)
- Include size and mtime members in Os.stat variants (#5148)
- Implement ShadowInstrumentation.execStartActivity variant with UserHandle (#5096)
- β Add ability to add entries to ShadowDropBoxManager (#5160)
- π Fix ShadowSigningInfo parceling (#5163)
- β Add ability to set Build.VERSION.SECURITY_PATCH (#5173), Build.PRODUCT (#5304), Build.BRAND (#5566), and Build.HARDWARE (#5619)
- β Add support for DisplayManager BrightnessConfiguration APIs (#5170)
- β Add ability to simulate location power save modes in ShadowPowerManager (#5176)
- β Add shadow method and test API for PowerManager.isLightDeviceIdleMode (#5226)
- β Add support for Android Q usb port statuses in ShadowUsbManager (#5175)
- β Add ability to simulate sending and downloading multimedia messages in ShadowSmsManager (#5177)
- β Add ability to query the number of times a WebView was reloaded (#5182)
- β Add ability to simulate WebViewClient and WebViewClient callbacks on page loads (#5188, #5199)
- β Add shadow method for WebView.getTitle (#5200)
- β Add test APIs to check if WebViewDatabase.clearFormData was called (#5201)
- β Add ability to override autofill service component name to ShadowAutofillManager (#5181)
- β Add ability to construct AttestedKeyPair objects (#5183)
- β Add shadow method for CameraCaptureSessionImpl.capture (#5191)
- β Add shadow method and test APIs for MediaScannerConnection.scanFile (#5178)
- β Add synchronous support to ShadowMediaCodec and the ability to apply fake codecs (#5195)
- β Add shadow methods for CameraParameters metering and focus areas and test APIs (#5189)
- β Add shadow method for AudioManager.getActiveRecordingConfigurations and test APIs (#5198)
- β Add ShadowAudioRecord (#5202, #5789)
- β Add several shadow methods for SliceManager (#5227)
- β Add shadow methods for new Android Q variants of setPackagesSuspended (#5135)
- β Add shadow method and test APIs for AccessibilityManager.sendAccessibilityEvent (#5192)
- β Add ability to log time in ShadowLog (#5224)
- β Add shadow for SuspendDialogInfo system API (#5232)
- β Add shadow method for PackageManager.canonicalToCurrentPackageNames and the ShadowPackageManageraddCanonicalName test API (#5233)
- β Add better support for camera2 CaptureRequestBuilder (#5230)
- β Add shadow method for Os.sysconf and a shadow API to set sysconf values (#5247)
- β Add shadow method for PackageManager.setDistractingPackageRestrictions and shadow API to get the set value (#5248)
- β Add shadow method for Bitmap.extractAlpha(Paint, int[]) (#5240)
- β Add the ability to set the user id in ContextImpl (#5253)
- π Fix some bugs in ShadowStorageManager StorageVolume logic (#5251, #5250)
- β Add shadow method for Trace.isEnabled and shadow API to toggle the value (#5256)
- π Fix infinite loop when using CameraManager (#5269)
- β Add shadow class for MediaController (#5266, #5395)
- β Add shadow method for MediaMetadataRetriever.setDataSource and a shadow API to add bitmaps to a data source (#5279)
- β Add shadow method for MediaMetadataRetriever.getScaledFrameAtTime and the ability to set scaled frames (#5279)
- β Add shadow method for BluetoothDevice.getBluetoothClass and the ability to set the bluetooth class (#5277)
- β Add shadow methods for PendingIntent.readPendingIntentOrNullFromParcel and PendingIntent.writePendingIntentOrNullToParcel (#5283)
- π Improve fidelity of AccessibilityWindowInfo.equals (#5278)
- β Add shadow methods for DevicePolicyManager.bindDeviceAdminServiceAsUser and DevicePolicyManager.getBindDeviceAdminTargetUsers and a shadow API to set the authorized users for these methods (#5287)
- β Add shadow method for ContextImpl.getExternalCacheDirs (#5288)
- β Add shadow method for WebSettings.getDefaultUserAgent to prevent crash (#5294)
- β Add shadow method for MediaBrowserCompat.getSessionToken (#5301)
- β Add shadow method for VMRuntime.getCurrentInstructionSet and shadow API to set the current instruction set (#5318)
- β Add shadow methods for PowerManager.getCurrentThermalStatus, PowerManager.addThermalStatusListener, PowerManager.removeThermalStatusListener. Athermal, and a shadow API to set the current thermal status (#5297)
- β Add support for opening a ParcelFileDescriptor in truncate and append modes (#5322)
- β Add shadow method for UserManager.isUserUnlocked(UserHandle) and shadow API to set user unlocked status (#5323)
- π Improve fidelity of DateFormat.get*DateFormat( #5314)
- β Add shadows for ContextHubManager and ContextHubClient (#5340, #5399)
- β Add support for AudioPlaybackCallback in ShadowAudioManager (#5342)
- β‘οΈ Update many ShadowUserManager methods to support profiles and add shadow method for UserManager.isManagedProfile(int) (#5346)
- β Add shadow for RoleManager (#5357)
- β Add shadow method for AccountManager.addOnAccountsUpdatedListener and shadow API to notify the listeners (#5347)
- β Add shadow API to get AccountManager OnAccountsUpdateListeners (#5361)
- β Add shadow method TelephonyManager.requestCellInfoUpdate and a shadow API to set the cell infos for the callbacks (#5355)
- β Add shadow method for MediaCodec.getOutputFormat and the ability to set the output format (#5372)
- β Add shadow method for AudioManager.isBluetoothScoAvailableOffCall and shadow API to set the value (#5364)
- β Add more complete shadow implementation for TelecomManager.placeCall and shadow API to query information about outgoing calls (#5373)
- β Add shadow APIs for allowing and denying calls to ShadowTelecomManager (#5374)
- β Add shadow method for CrossProfileApps.startActivity and shadow APIs to peek/get/clear the started activities (#5387)
- β Add shadow API to get all available loopers (#5371)
- β Add shadow for android.media.AudioTrack (#5379)
- β Add shadow for android.media.MediaCodecList (#5390, #5699)
- β Add shadow methods for View.addOnAttachStateChangeListener and View.removeOnAttachStateChangeListener and test API to get the OnAttachStateChangeListeners (#5401)
- π¦ Throw IllegalArgumentException in PackageManager.getInstallerPackageName if package name is not installed (#5403)
- β Add shadow method for PackageManager.getUnsuspendablePackages (#5406)
- β Add static factory method ShadowSensorManager.createSensorEvent(int, int) that takes a sensor type (#5398)
- β Add shadow method for TelephonyManager.isRttSupported and a test API to set whether or not Rtt is supported (#5411)
- β Add shadow methods for NfcAdapter.enableReaderMode, NfcAdapter.disableReaderMode, and some shadow API to work with reader mode (#5405)
- β Add shadow for UserManager#isQuietModeEnabled (#5416)
- π Improve fidelity of MediaCodec.dequeueOutputBuffer (#5409, #5466)
- β Add shadow methods for AutofillManager.isAutofillSupported and AutofillManager.isEnabled and shadow API to set values returned (#5408)
- β Add shadow method for WifiRttManager.isAvailable (#5429)
- β Add shadow method for AccessibilityService.dispatchGesture and some shadow API to toggle and get the dispatched gestures (#5441)
- β Add shadow method for Adding TelephonyManager.sendDialerSpecialCode and shadow API to get the values sent (#5444)
- π Improve fidelity of Path copy constructor shadow implementation (#5444)
- β Add shadow method for AppOpsManager.java.unsafeCheckOpRawNoThrow (#5448)
- β Add shadow method for TelephonyManager.isHearingAidCompatibilitySupported and a shadow API method to set the value returned (#5450)
- β Add shadow methods for DevicePolicyManager.getAffiliationIds and DevicePolicyManager.setAffiliationIds (#5452)
- β Add shadow method for Canvas.drawRoundRect and shadow API to get information about the drawn round rects (#5451)
- β Add shadow method for UserManager.getProfileParent (#5457)
- β Add shadow method for DevicePolicyManager.isDeviceProvisioned and shadow API to set the value returned (#5461)
- β Add shadow methods for DevicePolicyManager.getPermissionPolicy and DevicePolicyManager.setPermissionPolicy in ShadowDevicePolicyManager (#5453)
- β Add a Configurer plugin that changes the behavior of the PackageManager.html.getInstallerPackageName shadow method to throw an exception (instead of returning null), which is consistent with real Android (#5465)
- β Add shadow API to optionally enforce a notification limit to NotificationManager.notify (#5467)
- π Fix triggering broadcasts from explicit intents if data on intent is specified (#5482)
- β Add shadow for android.telephony.ims.ImsMmTelManager system service and shadow API to set various pieces of state on the shadow (#5483, #5497)
- π Make ShadowTrace sections thread aware (#5494)
- π Fix permission check when matching broadcast receivers (#5495)
- π¨ Refactor ShadowWrangler to delegate to a ShadowMatcher for making SDK-level decisions (f5371b5, dda4709)
- β Add shadow for android.media.MediaActionSound and shadow API to get the play counts (#5500)
- β Add shadow method for DownloadManager#setDestinationInExternalPublicDir (#5489)
- Include StatusBarNotification post times in ShadowNotificationManager (#5519)
- β Add a more complete shadow method for TelecomManager.getDefaultOutgoingPhoneAccount and shadow API to to set (and reset) the default outgoing phone account (#5524)
- β Add shadow method for BluetoothAdapter.isLeExtendedAdvertisingSupported and shadow API to set the value returned (#5515)
- β Add shadow methods for AudioManager.registerAudioPolicy and AudioManager.unregisterAudioPolicy system APIs and shadow API to get information about the audio policies (#5538)
- β Add shadow methods for TrafficStats.setThreadStatsTag and TrafficStats.getThreadStatsTag (#5541)
- Create separate cache directory for getExternalCacheDir instead of using the external storage root directory (#5534)
- β‘οΈ Use provided executor in TelephonyManager.requestCellInfoUpdate and add shadow API to set the error details for the callback (#5543)
- β Add more complete shadow methods for UserManager.isQuietModeEnabled and UserManager.requestQuietModeEnabled and shadow API to set whether a profile is locked (#5555)
- β Add support for CameraManager.openCamera for older SDKs (21-27) (#5551)
- β Add shadow method for CameraDeviceImpl.close (which is used in CameraDevice.close) (#5552)
- β Add shadow method for ConnectivityManager.getRestrictBackgroundStatus and shadow API to set the returned value (#5556)
- β Add shadow for android.service.voice.VoiceInteractionService and shadow APIs to get set UI hints and set the active service (#5537)
- β Add shadow method for AudioManager.generateAudioSessionId that returns monotonically increasing values (#5559)
- β Add shadow methods for NotificationManager.{getNotificationDelegate,canNotifyAsPackage,setNotificationDelegate} and shadow API ShadowNotificationManager.canNotifyAsPackage (#5565, #5573)
- β Add shadow method for PackageManager.getPackagesHoldingPermissions (#5568)
- β Add shadow method for TelephonyManager.getSimLocale and shadow API to set the returned value (#5582)
- β Add shadow method ConnectivityManager.getProxyForNetwork and shadow API to set the returned value (#5570)
- β Add shadow method for TelephonyManager.getDataNetworkType and shadow API to set the retired value (#5581)
- β Add shadow method for Paint.setUnderlineText (#5585)
- β Add support for MenuItem.setActionView(int) (#5603)
- β Add support for writing and reading FileDescriptors in Parcel. Specifically this adds shadow methods for Parcel.nativeWriteFileDescriptor and Parcel.nativeReadFileDescriptor (#5588)
- β Add shadow methods for DevicePolicyManager.isDeviceProvisioningConfigApplied and DevicePolicyManager.isDeviceProvisioningConfigApplied (#5599)
- π Better support reading/writing SharedMemory objects to Parcels (#5612, #5756)
- β Add shadow method for GradientDrawable.setStroke and shadow API methods to get the information about the stroke. (#5589)
- β Add shadow API for setting default user agent in ShadowWebSettings (#5615)
- β Add shadow method for TelephonyManager.isVoiceCapable and shadow API to set the value returned (#5606)
- β Add shadow method for Android P Typeface.create static factory method (#5616)
- β Add rudimentary support for Paint#breakText (#5607)
- β Add shadow methods for Environment.isExternalStorageLegacy (both no-arg and 1-arg variants) and shadow API to set the value returned (#5617)
- β Add shadow for android.service.voice.VoiceInteractionSession and many shadow API methods to work with the type (#5595)
- β Add shadow method for TelephonyManager.getCarrierIdFromSimMccMnc and a shadow API method to set the value returned (#5618)
- β Add shadow methods for WebView.goForward and WebView.canGoForward and shadow API to get the number of invocations of goForward (#5620)
- β Add shadow method for WebView.getHitTestResult and shadow API to set the value returned (#5630)
- β Add shadow for android.content.rollback.RollbackManager system API and some shadow API methods to get rollback information (#5621)
- β Add shadow for android.media.audiofx.DynamicsProcessing and make significant improvements to ShadowAudioEffect (#5591)
- β Add support for System.logW (#5634)
- β Add ShadowCamera.removeCamera shadow API for removing cameras (#5651)
- β Add an implementation for async setCookie to RoboCookieManager (#5653)
- Support ADJUST_LOWER and ADJUST_RAISE in AudioManager.adjustStreamVolume shadow method (#5650)
- β Add shadow for android.bluetooth.le.BluetoothLeScanner and add shadow API to BluetoothAdapter to work with BluetoothLeScanner (#5659)
- β Add shadow method for TileService.startActivityAndCollapse(Intent) (#5664)
- β Add shadow API method ShadowWebView.pushEntryToHistory(String) to improve fidelity of history in a WebView (#5654)
- β Add builders for android.media.MediaCodecInfo and android.media.MediaCodecInfo.CodecCapabilities and a shadow API method ShadowMediaCodecList.addCodec (#5705)
- β‘οΈ Update DeviceConfig to populate additional display metrics (#5706)
- π Improve fidelity of Activity#requestPermissions behavior (#5707)
- β‘οΈ Update ShadowPausedAsyncTaskLoader to allow setting a custom executor (#5708)
- π Improve fidelity of password tokens in DevicePolicyManager (#5693)
- β Add shadow methods for BluetoothA2dp.getConnectedDevices and BluetoothA2dp.getDevicesMatchingConnectionStates and shadow API to set the values returned (#5681)
- β Add shadow for android.media.RingtoneManager (#5689)
- β Add shadow method for MediaCodec.native_flush (to support MediaCodec.flush) (#5698)
- β Add shadow methods for BluetoothHeadset.{startVoiceRecognition,stopVoiceRecognition,isAudioConnected} (#5660)
- β Add shadow for android.os.BugreportManager and some shadow API to query state and trigger callbacks for bug reports #5675)
- π Fix handling of null admin in DevicePolicyManager.isUninstallBlocked() (#5720)
- π¦ Implement shadow method for ApplicationPackageManager.isInstantApp (#5725)
- π Improve fidelity related to input buffer ownership in ShadowMediaCodec (#5719)
- β‘οΈ Update ShadowSensorManager to support listeners registering more than one sensor type, as well as a shadow API method to query the registration for a (listener, sensor) pair (#5735)
- β Add shadow method for ContentResolver.query(Uri uri, String[], Bundle, CancellationSignal) (#5729)
- β Add SubscriptionInfoBuilder.setMcc and fix SubscriptionInfoBuilder.setMnc for SDK < Q (#5736)
- β Add shadow method for LauncherApps.isPackageEnabled (#5691)
- β Add shadow for android.media.session.MediaSessionManager (#5741)
- β Add shadow methods for WallpaperManager.setBitmap and WallpaperManager.getWallpaperFile and a shadow API method to get the set bitmap (#5750)
- β Add shadow methods for Android N system APIs ContextHubManager.getContextHubHandles and ContextHubManager.getContextHubInfo (#5760)
- β Add shadow method for Activity.reportFullyDrawn and shadow API to check whether this method has been called
- β Add shadow methods for UsageStatsManager.registerAppUsageLimitObserver, UsageStatsManager.unRegisterAppUsageLimitObserver, and shadow API to get the observers and trigger them (#5770)
- β Add shadow methods for DevicePolicyManager.{getShort,setShort,getLong,setLong}SupportMessage (#5776)
- β Add shadow methods for WallpaperManager.isWallpaperSupported and WallpaperManager.isSetWallpaperAllowed and shadow API to set the values returned (#5765)
- β Add shadow for android.net.wifi.aware.WifiAwareManager, which includes the ability to create WiFI aware sessions (#5766)
- β Add shadow method for LauncherApps.getActivityList and test API to set the values returned (#5771)
- β Add shadow method for TileService#isLocked and shadow API to set the value returned (#5794)
- π Improve fidelity of BitmapFactory.decodeFile by attempting to use the real bitmap file width and height (#5774)
- β Add shadow methods for TextToSpeech.synthesizeToFile, TextToSpeech.isLanguageAvailable, TextToSpeech.setLanguage, and shadow APIs to configure the behavior of these methods (#5797)
- β Add shadow method for WallpaperManager.getWallpaperInfo and the ability for tests to specify the wallpaper service component (#5781)
- β‘οΈ Use loose signatures on ShadowTelephonyManager.requestCellInfoUpdate. This is to continue supporting Java 8 in Robolectric 4.4. (#5835)
- β Add shadow methods for InCallService.canAddCall, InCallService.setMuted, InCallService.setAudioRoute, InCallService.getCallAudioState, InCallService.requestBluetoothAudio, and some shadow API methods to modify the behavior of these methods (#5816)
- β Add shadow for android.media.audiofx.Visualizer (#5818, #5826)
- β Add shadow method of MediaPlayer.setDataSource(AssetFileDescriptor) (#5844)
Misc improvements
- β Simplify single-parameter tests in ParameterizedRobolectricTestRunner (#5026)
- π Allow extension point for running custom actions for unsupported SDKs (#5028)
- π Fix SandboxClassLoader classloader inheritance (#5036)
- π Fix noisy NPE in ShadowInstrumentation (#5063)
- π Create Android application specified in package metadata (#5039)
- Tolerate gaps between ZIP entries when jumping between Local File Headers (#5120)
- β Add extension points so child tests can be created (#5132)
- π Improve thread safety of many shadows (#5018, #5087, #5094, #5144, #5193, #5231, #5306, #5445, #5703, #5676, #5742)
- Stop depending on javac annotation processing internals (#5155)
- β Add a way to specify classes to not instrument based on a regex (#5264)
- π Make reading binary resource zips more performant (#5309)
- π Fix issue transitioning to RESUMED state in ActivityScenario (#5332, #5331)
- β Add a plugin mechanism to provide a custom ShadowWrangler specialization (#5268)
- π Better support AssumptionViolatedException in RobolectricTestRunner (#5359, #5704)
- π Fix Util.getJavaVersion to support double-digit values (#5381)
- π Fix duplicate call to ContentProvider.onCreate (#5393)
- β Use AAPT for R class (and other cleanup) in shadows.support.v4 tests (#5430)
- Clean up autoservice usage and dependencies (#5432)
- Mark fields and methods added to classes as synthetic (#5418)
- π¦ Stop shadowing
ApplicationPackageManager
's constructor (#5455) - β¬οΈ Upgrade to Android Gradle Plugin 3.5.3 and Gradle 5.4.1 (#5498)
- CircleCI improvements (#5498, a64beaf, #5709, #5700, #5761, #5770, #5769 )
- β Run google-java-format check on CircleCI (#5769)
- β Add expectLogMessageWithThrowable to ExpectedLogMessagesRule (#5516) and other fixes/improvements to ExpectedLogMessagesRule (#5640, #5657, #5680)
- β‘οΈ Update BouncyCastle security provider due CVE-2018-1000613 (#5572)
- π¦ Avoid instrumenting additional packages
** Jetpack Compose (#5622)
** io.mockk (#5169)
** org.bouncycastle and org.conscrypt (#5845) - β‘οΈ Update RoboMonitoringInstrumentation to post shadowActivity.callOnActivityResult asynchronously (#5671, #5674)
- β‘οΈ Update ShadowServiceManager to lazily create binder proxies (#5716, #5714) and fix issues in ShadowServiceManager (#5717, #5722)
- β Use guava's ByteStreams to read and copy streams (#5726)
- Preload android.net.Uri in Android Q+ (#5733)
- π Fix Scheduler return values in PAUSED LooperMode, and support Scheduler#size (#5001)
- Throw if ShadowPausedLooper APIs are used on a quit looper (#5499)
- β Removed the pegdown-doclet Markdown doclet gradle plugin due to Java 10+ incompatibility (#5743)
- Converted all Robolectric Markdown Javadoc to regular Javadoc (#5746, #5747, #5753, #5759)
- β Add BackgroundTestRule to simplify running test code in a background thread (#5732)
- β Add BackgroundExecutor.runInBackground(Callable) helper method (similar to the existing BackgroundExecutor.runInBackground(Runnable) (#5730)
- π Improve support for MockK (#5169)
- π Fix 'Duplicate key' error when running ./gradlew upload (#5788)
- β Add robolectric.util.Logger.lifecycle method and use it to log some lifecycle events in RobolectricTestRunner (#5824)
- β¬οΈ Drop maven-ant-tasks dependency (due to CVE) and fetch from Maven manually (#5833, #5842, #5849, #5854, #5855)
- Generate reflector class with valid access (#5841)
- β Add shadow API to ShadowNetwork to determine whether a socket is bound, or how many sockets are bound (#5836)
- π Allow tests to configure value returned by P+'s Application.getProcessName (#5825)
- β Add better support for Conscrypt (#5851)
-
v4.4-beta
August 15, 2020 -
v4.4-alpha Changes
July 23, 2020π Robolectric 4.4 Alpha 2 is an alpha release. APIs are very likely to change and new features will be added. We'd love feedback from testing this version, but we recommend you don't rely on it in your test suite.
This is a massive release in terms of improvements to Android compatibility. The most noticeable item in the release is that the new PAUSED looper mode is now the default. You can read about the PAUSED looper in more detail here: http://robolectric.org/blog/2019/06/04/paused-looper/.
Note:
π 1. Not all changes are listed in the release notes. There were many other minor changes (such as dependency version bumps) that weren't included in this list for brevity. For all changes view the comparison to 4.3.1. π 2. Some of the pull requests in this release may contain duplicate changes from other pull requests in this release. We apologize for this messy history, it was the result of some misconfigured code sync tool. Weβve taken measures to ensure it doesnβt happen any more.
π Android SDK/JVM support
- β Add support for Android Q final (#5289, #5292)
- π Support running on Java 11 (#5479)
- π Support running on Java 13 (#5550
π Deprecations
- π Deprecate LooperMode LEGACY in favor of PAUSED (#5490), and default to PAUSED looper mode (#5491)
- π Accessibility checking is now deprecated and has been moved into a separate maven artifact
org.robolectric:plugin-accessibility-deprecated
. Accessibility checking will be removed entirely from Robolectric 4.5. Please switch to Espresso for accessibility checking. (#5547) - π Deprecate ShadowContentResolver shadow API because they do not work with ContentProviderClient (#5376)
- β‘οΈ Deprecate ShadowLocationManager.getLocationUpdateListeners and ShadowLocationManager.getLocationUpdateListeners (#5150)
- β Make it an error to run on Q with an unsupported java version instead of just silently skipping tests (#5290)
- π Deprecate Robolectric's custom cursor implementation (#5613)
β Android support / Robolectric test API improvements
- π Fix bug in ShadowImageDecoder.decodeBitmap (#4966)
- Use real setting for WIFI_SCAN_ALWAYS_AVAILABLE (#4968)
- β Add a shadow for Font.Builder (#4993)
- β Add killProcess implementation to ShadowProcess (#4985)
- β Add a shadow for CallLog.Calls (#4996)
- β Add a shadow for CallScreeningService (#4997)
- β Add several shadows for camera2 classes (#4874)
- β Add option to avoid calling ShadowApplication.onServiceDisconnected in ShadowApplication.unbindService (#4979)
- β Add ability to simulate Bluetooth unavailable in ShadowBluetoothAdapter (#5002)
- π¦ Implement ShadowApplicationPackageManager.getApplicationIcon(ApplicationInfo) (#5005)
- β Add ability to simulate SecurityExceptions in bindService (#4980)
- β Add ability to simulate enabled/disabled networks in ShadowWifiManager (#4974)
- β Add ability to simulate wifi usability system APIs in ShadowWifiManager (#5168)
- β Add null check in ShadowWifiManager.addNetwork (#5014)
- β Add shadow implementation of ShadowTelephonyManager#getDataState (#5003)
- Fall back to Android's implementation of getResourcesForApplication (#4969)
- Implement ShadowTypeface.equals and ShadowTypeface.hashCode (#4992)
- β Add ability to make ShadowContentResolver.registerContentObserver throw an exception (#4988)
- Implement ShadowSubscriptionManager.getActiveSubscriptionInfoCountMax (#5010)
- β Add ability to set system dialer package in ShadowTelecomManager (#4986)
- Implement ShadowSensorManager.registerListener 5-arg overload (#5014)
- β Add ability to get last flags set in ShadowUIModeManager (#5027)
- β Add a shadow for BluetoothA2dp (#5034)
- β Add shadow implementation for BluetoothDevice.createRfcommSocketToServiceRecord (#5034)
- β Add shadow implementations for BluetoothDevice.setPin and BluetoothDevice.setPairingConfirmation (and ability to get the values set) (#5116)
- β Adding shadow implementations of BluetoothDevice.getAlias and BlueToothDevice.getAliasName and related test APIs (#5222)
- β Adds the ability to get broadcast intents sent to a specific user (#5045)
- Validate intents passed to start/stop/bindService (#5053)
- Complete rewrite of ShadowLocationManager to improve fidelity (#5035, #5062, #5152, #5587, #5666)
- β Add ability to clear broadcast intents in ShadowContextWrapper (#5066)
- π Fix package name ShadowApplicationPackageManager's Activity Chooser (#5068)
- β Add shadow implementation for MediaPlayer#setDataSource(Context, Uri) (#5064)
- β Add shadow implementation for UserManager.getUserHandle(int) (#5065)
- β Add shadow implementations for DevicePolicyManager.setSystemUpdatePolicy and DevicePolicyManager.getSystemUpdatePolicy (#5069)
- β Remove ShadowOverscroller (#5081)
- β Add ability to simulate return value of AccessibilityService.getWindows list in ShadowAccessibilityService (#5083)
- π Fix bug in ShadowParcel.writeByteArray (#5089)
- β Add shadow implementation for UserManager.getUserName (#5099)
- π Improve fidelity of ShadowTime#parse3339 (#5101)
- β Add shadow for BiometricManager (#5072)
- Propagate RemoteException from Binder#onTransact method (#4984)
- β Add shadow for android.service.notification.NotificationListenerService.Ranking (#5113)
- β Add support for VibrationEffect.Prebaked in ShadowSystemVibrator (#5119
- β Add the ability to set Tx and Rx packets/bytes for ShadowTrafficStats (#5121)
- β Add shadow implementation for Activity.getCallingPackage (and the ability to set it) (#5126)
- β Add shadows for several telephony classes (android.telecom.Call, android.telecom.InCallAdapter, android.telecom.InCallService, android.telecom.Phone) (#5107)
- π Improve fidelity of ShadowCookieManager.removeSessionCookies (#5130)
- π Improve fidelity of OpEntry.getTime() and OpEntry.getDuration() in Q (#5133)
- 0οΈβ£ Set default NetworkCapabilities for the two Robolectric created Networks (#5129)
- Set the mimetype in ShadowBitmapFactory.decodeStream() (#5128)
- β Add module support for ShadowPackageManager and ShadowApplicationPackageManager (#5136)
- β Add the ability to set the external storage directory in ShadowEnvironment (#5140)
- β Add support for the dataChanged API in ShadowBackupManager (#5137)
- β Add ShadowContentResolver.registerInputStreamSupplier (#5142)
- π Notify settings ContentResolver when settings change (#5138)
- Include size and mtime members in Os.stat variants (#5148)
- Implement ShadowInstrumentation.execStartActivity variant with UserHandle (#5096)
- β Add ability to add entries to ShadowDropBoxManager (#5160)
- π Fix ShadowSigningInfo parceling (#5163)
- β Add ability to set Build.VERSION.SECURITY_PATCH (#5173), Build.PRODUCT (#5304), Build.BRAND (#5566), and Build.HARDWARE (#5619)
- β Add support for DisplayManager BrightnessConfiguration APIs (#5170)
- β Add ability to simulate location power save modes in ShadowPowerManager (#5176)
- β Add shadow method and test API for PowerManager.isLightDeviceIdleMode (#5226)
- β Add support for Android Q usb port statuses in ShadowUsbManager (#5175)
- β Add ability to simulate sending and downloading multimedia messages in ShadowSmsManager (#5177)
- β Add ability to query the number of times a WebView was reloaded (#5182)
- β Add ability to simulate WebViewClient and WebViewClient callbacks on page loads (#5188, #5199)
- β Add shadow method for WebView.getTitle (#5200)
- β Add test APIs to check if WebViewDatabase.clearFormData was called (#5201)
- β Add ability to override autofill service component name to ShadowAutofillManager (#5181)
- β Add ability to construct AttestedKeyPair objects (#5183)
- β Add shadow method for CameraCaptureSessionImpl.capture (#5191)
- β Add shadow method and test APIs for MediaScannerConnection.scanFile (#5178)
- β Add synchronous support to ShadowMediaCodec and the ability to apply fake codecs (#5195)
- β Add shadow methods for CameraParameters metering and focus areas and test APIs (#5189)
- β Add shadow method for AudioManager.getActiveRecordingConfigurations and test APIs (#5198)
- β Add ShadowAudioRecord (#5202)
- β Add several shadow methods for SliceManager (#5227)
- β Add shadow methods for new Android Q variants of setPackagesSuspended (#5135)
- β Add shadow method and test APIs for AccessibilityManager.sendAccessibilityEvent (#5192)
- β Add ability to log time in ShadowLog (#5224)
- β Add shadow for SuspendDialogInfo system API (#5232)
- β Add shadow method for PackageManager.canonicalToCurrentPackageNames and the ShadowPackageManageraddCanonicalName test API (#5233)
- β Add better support for camera2 CaptureRequestBuilder (#5230)
- β Add shadow method for Os.sysconf and a shadow API to set sysconf values (#5247)
- β Add shadow method for PackageManager.setDistractingPackageRestrictions and shadow API to get the set value (#5248)
- β Add shadow method for Bitmap.extractAlpha(Paint, int[]) (#5240)
- β Add the ability to set the user id in ContextImpl (#5253)
- π Fix some bugs in ShadowStorageManager StorageVolume logic (#5251, #5250)
- β Add shadow method for Trace.isEnabled and shadow API to toggle the value (#5256)
- π Fix infinite loop when using CameraManager (#5269)
- β Add shadow class for MediaController (#5266, #5395)
- β Add shadow method for MediaMetadataRetriever.setDataSource and a shadow API to add bitmaps to a data source (#5279)
- β Add shadow method for MediaMetadataRetriever.getScaledFrameAtTime and the ability to set scaled frames (#5279)
- β Add shadow method for BluetoothDevice.getBluetoothClass and the ability to set the bluetooth class (#5277)
- β Add shadow methods for PendingIntent.readPendingIntentOrNullFromParcel and PendingIntent.writePendingIntentOrNullToParcel (#5283)
- π Improve fidelity of AccessibilityWindowInfo.equals (#5278)
- β Add shadow methods for DevicePolicyManager.bindDeviceAdminServiceAsUser and DevicePolicyManager.getBindDeviceAdminTargetUsers and a shadow API to set the authorized users for these methods (#5287)
- β Add shadow method for ContextImpl.getExternalCacheDirs (#5288)
- β Add shadow method for WebSettings.getDefaultUserAgent to prevent crash (#5294)
- β Add shadow method for MediaBrowserCompat.getSessionToken (#5301)
- β Add shadow method for VMRuntime.getCurrentInstructionSet and shadow API to set the current instruction set (#5318)
- β Add shadow methods for PowerManager.getCurrentThermalStatus, PowerManager.addThermalStatusListener, PowerManager.removeThermalStatusListener. Athermal, and a shadow API to set the current thermal status (#5297)
- β Add support for opening a ParcelFileDescriptor in truncate and append modes (#5322)
- β Add shadow method for UserManager.isUserUnlocked(UserHandle) and shadow API to set user unlocked status (#5323)
- π Improve fidelity of DateFormat.get*DateFormat( #5314)
- β Add shadows for ContextHubManager and ContextHubClient (#5340, #5399)
- β Add support for AudioPlaybackCallback in ShadowAudioManager (#5342)
- β‘οΈ Update many ShadowUserManager methods to support profiles and add shadow method for UserManager.isManagedProfile(int) (#5346)
- β Add shadow for RoleManager (#5357)
- β Add shadow method for AccountManager.addOnAccountsUpdatedListener and shadow API to notify the listeners (#5347)
- β Add shadow API to get AccountManager OnAccountsUpdateListeners (#5361)
- β Add shadow method TelephonyManager.requestCellInfoUpdate and a shadow API to set the cell infos for the callbacks (#5355)
- β Add shadow method for MediaCodec.getOutputFormat and the ability to set the output format (#5372)
- β Add shadow method for AudioManager.isBluetoothScoAvailableOffCall and shadow API to set the value (#5364)
- β Add more complete shadow implementation for TelecomManager.placeCall and shadow API to query information about outgoing calls (#5373)
- β Add shadow APIs for allowing and denying calls to ShadowTelecomManager (#5374)
- β Add shadow method for CrossProfileApps.startActivity and shadow APIs to peek/get/clear the started activities (#5387)
- β Add shadow API to get all available loopers (#5371)
- β Add shadow for android.media.AudioTrack (#5379)
- β Add shadow for android.media.MediaCodecList (#5390, #5699)
- β Add shadow methods for View.addOnAttachStateChangeListener and View.removeOnAttachStateChangeListener and test API to get the OnAttachStateChangeListeners (#5401)
- π¦ Throw IllegalArgumentException in PackageManager.getInstallerPackageName if package name is not installed (#5403)
- β Add shadow method for PackageManager.getUnsuspendablePackages (#5406)
- β Add static factory method ShadowSensorManager.createSensorEvent(int, int) that takes a sensor type (#5398)
- β Add shadow method for TelephonyManager.isRttSupported and a test API to set whether or not Rtt is supported (#5411)
- β Add shadow methods for NfcAdapter.enableReaderMode, NfcAdapter.disableReaderMode, and some shadow API to work with reader mode (#5405)
- β Add shadow for UserManager#isQuietModeEnabled (#5416)
- π Improve fidelity of MediaCodec.dequeueOutputBuffer (#5409, #5466)
- β Add shadow methods for AutofillManager.isAutofillSupported and AutofillManager.isEnabled and shadow API to set values returned (#5408)
- β Add shadow method for WifiRttManager.isAvailable (#5429)
- β Add shadow method for AccessibilityService.dispatchGesture and some shadow API to toggle and get the dispatched gestures (#5441)
- β Add shadow method for Adding TelephonyManager.sendDialerSpecialCode and shadow API to get the values sent (#5444)
- π Improve fidelity of Path copy constructor shadow implementation (#5444)
- β Add shadow method for AppOpsManager.java.unsafeCheckOpRawNoThrow (#5448)
- β Add shadow method for TelephonyManager.isHearingAidCompatibilitySupported and a shadow API method to set the value returned (#5450)
- β Add shadow methods for DevicePolicyManager.getAffiliationIds and DevicePolicyManager.setAffiliationIds (#5452)
- β Add shadow method for Canvas.drawRoundRect and shadow API to get information about the drawn round rects (#5451)
- β Add shadow method for UserManager.getProfileParent (#5457)
- β Add shadow method for DevicePolicyManager.isDeviceProvisioned and shadow API to set the value returned (#5461)
- β Add shadow methods for DevicePolicyManager.getPermissionPolicy and DevicePolicyManager.setPermissionPolicy in ShadowDevicePolicyManager (#5453)
- β Add a Configurer plugin that changes the behavior of the PackageManager.html.getInstallerPackageName shadow method to throw an exception (instead of returning null), which is consistent with real Android (#5465)
- β Add shadow API to optionally enforce a notification limit to NotificationManager.notify (#5467)
- π Fix triggering broadcasts from explicit intents if data on intent is specified (#5482)
- β Add shadow for android.telephony.ims.ImsMmTelManager system service and shadow API to set various pieces of state on the shadow (#5483, #5497)
- π Make ShadowTrace sections thread aware (#5494)
- π Fix permission check when matching broadcast receivers (#5495)
- π¨ Refactor ShadowWrangler to delegate to a ShadowMatcher for making SDK-level decisions (f5371b5, dda4709)
- β Add shadow for android.media.MediaActionSound and shadow API to get the play counts (#5500)
- β Add shadow method for DownloadManager#setDestinationInExternalPublicDir (#5489)
- Include StatusBarNotification post times in ShadowNotificationManager (#5519)
- β Add a more complete shadow method for TelecomManager.getDefaultOutgoingPhoneAccount and shadow API to to set (and reset) the default outgoing phone account (#5524)
- β Add shadow method for BluetoothAdapter.isLeExtendedAdvertisingSupported and shadow API to set the value returned (#5515)
- β Add shadow methods for AudioManager.registerAudioPolicy and AudioManager.unregisterAudioPolicy system APIs and shadow API to get information about the audio policies (#5538)
- β Add shadow methods for TrafficStats.setThreadStatsTag and TrafficStats.getThreadStatsTag (#5541)
- Create separate cache directory for getExternalCacheDir instead of using the external storage root directory (#5534)
- β‘οΈ Use provided executor in TelephonyManager.requestCellInfoUpdate and add shadow API to set the error details for the callback (#5543)
- β Add more complete shadow methods for UserManager.isQuietModeEnabled and UserManager.requestQuietModeEnabled and shadow API to set whether a profile is locked (#5555)
- β Add support for CameraManager.openCamera for older SDKs (21-27) (#5551)
- β Add shadow method for CameraDeviceImpl.close (which is used in CameraDevice.close) (#5552)
- β Add shadow method for ConnectivityManager.getRestrictBackgroundStatus and shadow API to set the returned value (#5556)
- β Add shadow for android.service.voice.VoiceInteractionService and shadow APIs to get set UI hints and set the active service (#5537)
- β Add shadow method for AudioManager.generateAudioSessionId that returns monotonically increasing values (#5559)
- β Add shadow methods for NotificationManager.{getNotificationDelegate,canNotifyAsPackage,setNotificationDelegate} and shadow API ShadowNotificationManager.canNotifyAsPackage (#5565, #5573)
- β Add shadow method for PackageManager.getPackagesHoldingPermissions (#5568)
- β Add shadow method for TelephonyManager.getSimLocale and shadow API to set the returned value (#5582)
- β Add shadow method ConnectivityManager.getProxyForNetwork and shadow API to set the returned value (#5570)
- β Add shadow method for TelephonyManager.getDataNetworkType and shadow API to set the retired value (#5581)
- β Add shadow method for Paint.setUnderlineText (#5585)
- β Add support for MenuItem.setActionView(int) (#5603)
- β Add support for writing and reading FileDescriptors in Parcel. Specifically this adds shadow methods for Parcel.nativeWriteFileDescriptor and Parcel.nativeReadFileDescriptor (#5588)
- β Add shadow methods for DevicePolicyManager.isDeviceProvisioningConfigApplied and DevicePolicyManager.isDeviceProvisioningConfigApplied (#5599)
- π Better support reading/writing SharedMemory objects to Parcels (#5612)
- β Add shadow method for GradientDrawable.setStroke and shadow API methods to get the information about the stroke. (#5589)
- β Add shadow API for setting default user agent in ShadowWebSettings (#5615)
- β Add shadow method for TelephonyManager.isVoiceCapable and shadow API to set the value returned (#5606)
- β Add shadow method for Android P Typeface.create static factory method (#5616)
- β Add rudimentary support for Paint#breakText (#5607)
- β Add shadow methods for Environment.isExternalStorageLegacy (both no-arg and 1-arg variants) and shadow API to set the value returned (#5617)
- β Add shadow for android.service.voice.VoiceInteractionSession and many shadow API methods to work with the type (#5595)
- β Add shadow method for TelephonyManager.getCarrierIdFromSimMccMnc and a shadow API method to set the value returned (#5618)
- β Add shadow methods for WebView.goForward and WebView.canGoForward and shadow API to get the number of invocations of goForward (#5620)
- β Add shadow method for WebView.getHitTestResult and shadow API to set the value returned (#5630)
- β Add shadow for android.content.rollback.RollbackManager system API and some shadow API methods to get rollback information (#5621)
- β Add shadow for android.media.audiofx.DynamicsProcessing and make significant improvements to ShadowAudioEffect (#5591)
- β Add support for System.logW (#5634)
- β Add ShadowCamera.removeCamera shadow API for removing cameras (#5651)
- β Add an implementation for async setCookie to RoboCookieManager (#5653)
- Support ADJUST_LOWER and ADJUST_RAISE in AudioManager.adjustStreamVolume shadow method (#5650)
- β Add shadow for android.bluetooth.le.BluetoothLeScanner and add shadow API to BluetoothAdapter to work with BluetoothLeScanner (#5659)
- β Add shadow method for TileService.startActivityAndCollapse(Intent) (#5664)
- β Add shadow API method ShadowWebView.pushEntryToHistory(String) to improve fidelity of history in a WebView (#5654)
- β Add builders for android.media.MediaCodecInfo and android.media.MediaCodecInfo.CodecCapabilities and a shadow API method ShadowMediaCodecList.addCodec (#5705)
- β‘οΈ Update DeviceConfig to populate additional display metrics (#5706)
- π Improve fidelity of Activity#requestPermissions behavior (#5707)
- β‘οΈ Update ShadowPausedAsyncTaskLoader to allow setting a custom executor (#5708)
- π Improve fidelity of password tokens in DevicePolicyManager (#5693)
- β Add shadow methods for BluetoothA2dp.getConnectedDevices and BluetoothA2dp.getDevicesMatchingConnectionStates and shadow API to set the values returned (#5681)
- β Add shadow for android.media.RingtoneManager (#5689)
- β Add shadow method for MediaCodec.native_flush (to support MediaCodec.flush) (#5698)
- β Add shadow methods for BluetoothHeadset.{startVoiceRecognition,stopVoiceRecognition,isAudioConnected} (#5660)
- β Add shadow for android.os.BugreportManager and some shadow API to query state and trigger callbacks for bug reports #5675)
- π Fix handling of null admin in DevicePolicyManager.isUninstallBlocked() (#5720)
- π¦ Implement shadow method for ApplicationPackageManager.isInstantApp (#5725)
- π Improve fidelity related to input buffer ownership in ShadowMediaCodec (#5719)
- β‘οΈ Update ShadowSensorManager to support listeners registering more than one sensor type, as well as a shadow API method to query the registration for a (listener, sensor) pair (#5735)
- β Add shadow method for ContentResolver.query(Uri uri, String[], Bundle, CancellationSignal) (#5729)
Misc improvements
- β Simplify single-parameter tests in ParameterizedRobolectricTestRunner (#5026)
- π Allow extension point for running custom actions for unsupported SDKs (#5028)
- π Fix SandboxClassLoader classloader inheritance (#5036)
- π Fix noisy NPE in ShadowInstrumentation (#5063)
- π Create Android application specified in package metadata (#5039)
- Tolerate gaps between ZIP entries when jumping between Local File Headers (#5120)
- β Add extension points so child tests can be created (#5132)
- π Improve thread safety of many shadows (#5018, #5087, #5094, #5144, #5193, #5231, #5306, #5445, #5703, #5676 )
- Stop depending on javac annotation processing internals (#5155)
- β Add a way to specify classes to not instrument based on a regex (#5264)
- π Make reading binary resource zips more performant (#5309)
- π Fix issue transitioning to RESUMED state in ActivityScenario (#5332, #5331)
- β Add a plugin mechanism to provide a custom ShadowWrangler specialization (#5268)
- π Better support AssumptionViolatedException in RobolectricTestRunner (#5359, #5704)
- π Fix Util.getJavaVersion to support double-digit values (#5381)
- π Fix duplicate call to ContentProvider.onCreate (#5393)
- β Use AAPT for R class (and other cleanup) in shadows.support.v4 tests (#5430)
- Clean up autoservice usage and dependencies (#5432)
- Mark fields and methods added to classes as synthetic (#5418)
- π¦ Stop shadowing
ApplicationPackageManager
's constructor (#5455) - β¬οΈ Upgrade to Android Gradle Plugin 3.5.3 and Gradle 5.4.1 (#5498)
- CircleCI improvements (#5498, a64beaf, #5709, #5700)
- β Add expectLogMessageWithThrowable to ExpectedLogMessagesRule (#5516) and other fixes/improvements to ExpectedLogMessagesRule (#5640, #5657, #5680)
- β‘οΈ Update BouncyCastle security provider due CVE-2018-1000613 (#5572)
- π¦ Avoid instrumenting additional packages
** Jetpack Compose (#5622) - β‘οΈ Update RoboMonitoringInstrumentation to post shadowActivity.callOnActivityResult asynchronously (#5671, #5674)
- β‘οΈ Update ShadowServiceManager to lazily create binder proxies (#5716, #5714) and fix issues in ShadowServiceManager (#5717, #5722)
- β Use guava's ByteStreams to read and copy streams (#5726)
- Preload android.net.Uri in Android Q+ (#5733)
- π Fix Scheduler return values in PAUSED LooperMode, and support Scheduler#size (#5001)
- Throw if ShadowPausedLooper APIs are used on a quit looper (#5499)
π Use Robolectric:
testCompile "org.robolectric:robolectric:4.4-alpha-2"
-
v4.3.1
October 11, 2019 -
v4.3 Changes
May 30, 2019π This release introduces a new PAUSED Looper mode, enhanced Espresso compatibility, support for Android Q Beta 2, and numerous SDK support improvements and bug fixes
π Features
- π Support Android Q beta 2 (build 5415296). [1717fb1]
- π Support for new
PAUSED
Looper
mode. - π Support clicking menu items via Espresso [issue #4889]
- More realistically measure and layout Android text views
β Android SDK support and Test API changes
- π Use real OverScroller in PAUSED LooperMode. [4337639]
- β Add ShadowDevicePolicyManager#isLockTaskPermitted(String).
- β Add Locale methods to Shadow for CaptioningManager.
- β Add enabling/disabling data in ShadowTelephonyManager. [issue #4844]
- β Add an initial shadow for the LauncherApps System Service. [issue #4837]
- β Add ShadowUserManager.removeUser(UserHandle) [issue #4854]
- β Add IntentSenderRequest for startIntentSenderForResult methods. [issue #4870]
- Shadow night display ColorDisplayManager methods
- β Add getPasswordComplexity support to ShadowDevicePolicyManager [issue #4878]
- β Add shadow implementation for ShadowDexFile.isDexOptNeeded. [issue #4886]
- Shadow DisplayManagerGlobal#getStableDisplaySize [issue #4838]
- Shadow ContextImpl.startActivityAsUser [issue #4899]
- Shadow implementation of android.hardware.HardwareBuffer [issue #4895]
- β Add shadow for ShadowAppOpsManager#noteProxyOpNoThrow. [issue #4906]
- β Add support for new Android Q fields to EventBuilder [issue #4905]
- β Add support for UsageStatsManager#getUsageSource() [issue #4920]
- π Support stopForeground(int) in ShadowService. [issue #4919]
- π Support ShadowSensor#getMaximumRange [issue #4881]
- β Add support for passing resultCode through to broadcasts intents [issue #4917]
- π Fix activities leaking between test cases [issue #4930]
- π¦ Fall back to Android's implementation of PackageManager.getPackageArchiveInfo [issue #4928]
- β Add ShadowPausedAsyncTask#overrideExecutor API to replace waitForIdle. [issue #4950]
- β Add API
ShadowApplicationPackageManager.getLeanbackLaunchIntentForPackage()
(wrapsgetLaunchIntentForPackage()
) [c16c3bf] - β Add new shadow
Looper
APIs for retrieving the scheduled time for tasks. [6494bde] - β Added Robolectric shadow for
TotalCaptureResult
. [8e1e585] - β Add
ShadowLooper#isIdle
[f4a5d49] - Create APIs for executing tasks on real background threads in
PAUSED
looper mode. [d29bf89] - β Add
get
/setLockTaskPackages
support toDevicePolicyManager
[b1ecc5a] - β Add implementation of -
ShadowSubscriptionManager#getAvailableSubscriptionInfoList
-ShadowSubscriptionManager#setAvailableSubscriptionInfoList
-ShadowSubscriptionManager#setAvailableSubscriptionInfos
-SubscriptionInfoBuilder#setMnc
[95bac4a] - Modify
ShadowLocationManager
to respectLOCATION_MODE
. [348d0d2] - π Make
ActivityController#recreate
aware of the current lifecycle state [7cc5b42] - Implement
ActivityManager#isBackgroundRestricted()
[4cbe349] UiModeManager
[78a4eec]- Set different values for each of
OsConstants
errno
values [aeadc29] - β Add ShadowIsoDep [2e94093]
- β Add
ShadowBluetoothGatt.connect()
[8cffa29] - Implement
SubscriptionManager.getPhoneId()
with a map between subscription IDs and phone IDs. [01ea680] - β Add torch setting capabilities to
ShadowCameraManager
. [f25ec77] - β Add method to
ShadowContextWrapper
to expose the options of the most recently started activity [da1bace] - β Add
setInMultiWindowMode()
to change multi window state forShadowActivity
. [9b2af0b] - π Supports
setProfileClass
&setIsEmbedded
inSubscriptionInfoBuilder
[4c74611] - π Supports
EuiccManager#getEid
inShadowEuiccManager
[e64f675] - π Fake out a minimal implementation of
ShadowSliceManager.getPinnedSlices()
. [2f7aa83] - β Add
setSeedAccountType()
forShadowUserManager
[70d712f] - π Allow delivering broadcasts by class name. [665000d]
- β Add shadow for
ColorDisplayManager
per-app grayscale [095c527] - β Add
ShadowApplication#clearRegisteredReceivers
helper method [c0d1719] - β¨ Enhance
ShadowBroadcastReceiver
to allow testing async receivers [78c3998] - β Add
supportsMultipleUsers()
&setSupportsMultipleUsers()
forShadowUserManager
[50ec6ed] - π Support tag in
ShadowWakeLock
[3137c1c] - β Add
createConfirmFactoryResetCredentialIntent
toShadowKeyguardManager
[1d20033] ShadowInputDevice
: Add shadow implementation for thegetProductId()
andgetVendorId()
methods. [8aa09a5]- β Add
switchUser(UserHandle)
forShadowActivityManager
[7a63796] - Creating a Shadow for
NetworkCapabilities
. The current implementation only overrides fetching and updation of transport. [d432dcf] - π Allow
ShadowEvent
to set thread id as well. [ff84723] - β Add partial (backward)
@Implementation
ofgoBackOrForward(steps)
toShadowWebView
[a616926] - Create a Shadow for
SigningInfo
, which was added in API 28. [dd1d408] - Implement
ShadowBinder.setCallingUserHandle()
/Binder.getCallingUserHandle()
[aaa393b] - π Support
ShadowBluetoothDevice.connectGatt()
overloads. [7d95ef4] - π Implement
AccountManager.removeAccount(...)
withActivity
parameter. [63816d7] - π Fix
ShadowMediaPlayer.setDataSource(MediaDataSource)
[c3037c1] - β add missing shadow of
MediaPlayer.setDataSource(MediaDataSource)
[2876f57] - β Add
getDefault{X}SubscriptionId()
equivalents for older versions of Android toShadowSubscriptionManager
. [daa72ae]
π§ Configuration
- π Introduced an opt-in mode that fixes zero-sized
TextView
s in Robolectric [9bfa258] - π§ Move ConfigurationRegistry into shadowsapi [b5e63df]
- β Added extension points to
AndroidEnvironment
andClassInstrumentor
[3604e42]
π Bug Fixes
- π Fix another 'NoSuchMethodError java.nio.ByteBuffer.position' issue in Java8 [804b89a]
- π Fix concurrent modification exception in ShadowAlarmManager [03fd8c3]
- π Fixed transliteration problems where cpp copy assignments were transliterated as java reference copies
- Propagate RemoteException from Binder#onTransact method
- π Fix AccessibilityNodeinfo.obtation(NodeInfo) to clone Extra correctly [issue #4865]
- Protecting ShadowSensorManager.sendSensorEvent from ConcurrentModificationException [issue #4839]
- π Synchronize cleanup of ApkAssets cache with corresponding native object [issue #4910]
- π Fix a bug causing flakes when using ShadowSQLiteConnection. [issue #4904]
- π Fix typing text into phone EditText fields. [issue #4909]
- Includes st_mode in Os.stat/lstat/fstat system calls. [issue #4915]
- π Fixed an issue where nine patch chunks are overridden [issue #4914]
- Ensure ActivityScenario lifecycle events are consistent with device. [issue #4954]
- π Make Instrumentation.runOnMainSync behave consistently with device. [issue #4951]
- π Make sure that ShadowAccountManager doesn't crash on empty features. [issue #4953]
- π Initialize Robolectric environment location properly. [72fa419]
- π Introduced an opt-in mode that fixes zero-sized
TextView
s in Robolectric [9bfa258] - Oops, missed a Q Beta 1 shadow. [04db5d5]
- Don't instrument
androidx.room.CoroutinesRoom$Companion
. [6d24639] - β
Stem
CachedDependencyResolverFileCacheTest
flakiness by increasing valid cache time. [10acb64] - π Windows actually works finally, maybe [issue #4605].
- π Fixes bug in activity lifecycle state transition with finish() in onCreate [7e0d8c1]
- π Apply fixes from
LocalActivityInvoker
toRoboMonitoringInstrumentation
. [017559d]
π Deprecations and Removals
- π
@Deprecate
a bunch of methods inShadowView
where alternatives exist in Espresso [312376d]
Internal Changes
- β‘οΈ Updated to AndroidX Test 1.2.0 [47c0736]
- Restructure ShadowLooper and related shadows into a abstract base 'API' class, and two subclasses: ShadowLegacy* and
ShadowPaused*. A shadowPicker will be used to pick the correct shadow to use based on LooperMode. - Exclude Arch Components and Room from Shadows [issue #4883]
- Break org.robolectric:annotations -> org.robolectric:shadow-api dependency [issue #4948]
- β
Rename
(Android)?Environment
to(Android)?TestEnvironment
. [6308e4f] [issue #4850] - β
Idle main looper after each
SupportFragmentTestUtil
call when looper mode isPAUSED
. [78d27a9] - β Added missing native functions in
ShadowRenderNode
[7740562] - β Add
setExecutor
shadow API [1e2c79c] - Introduce a new "Paused looper" threading model. [acb7af7]
- π Change
ShadowNativeAllocationRegistry
to use loose signatures [5409c0d] - π§ Create a
LooperMode
configurer annotation. [8e26be1] - 0οΈβ£ Enable
callThroughByDefault
forNativeAllocationRegistry
, and explicitly shadow methods instead. [1f5f0fe] - π Allow
ShadowAppOpsManager#toOpEntry
to be overridden, and makeTestUtil
use injectedDependencyResolver
andSdkProvider
. [adad503] - π¨ Refactor exception-message assertions to use
ThrowableSubject.hasMessageThat()
. [729acc2] - β Add link to github issue explaining workaround. [9ef6e60]
- π» Attempt 2 at clearing exception handler. [2fd0a1b]
- π Merge pull request #4736 from robolectric/undeclared-activtiy-workaround [a4275f1]
- Internal change [f662314]
- β Aggregate test results from all projects. [65b0975]
- Ignore mysterious AGP fail: [1b0d479]
- β Test for AGP manifest bug workaround. [6d57524]
- π Make it clear that
Util.sneakyThrow()
disrupts program flow. [316e3f0] - β Remove
ShadowHandler
- it is an empty implementation now. [bcbf11d] - π Fix
ShadowAppOpsManager.toOpEntry()
compilation. [37d9948] - π Merge pull request #4645 from robolectric:jakew/sneaky-throw/2019-02-17 [91af73f]
- Internal change [f3980e1]
- π Fix call order of
postCreate()
and start() inActivityController#recreate
. See https://developer.android.com/reference/android/app/Activity.html#onPostCreate%28android.os.Bundle%29 [0cbe259] - π Quiet some build warnings. [aaf9e8d]
- Obtain
ShadowProviders
viaInjector
. [0e4184c] - β± Output scheduler state on test failures (PR#4711) [b89fe07]
- π Compatibility test for
BuildCompat
[cf3a057] - Internal [aed7553]
- π Fix call order of
postCreate()
andstart()
inLocalActivityInvoker
. See https://developer.android.com/reference/android/app/Activity.html#onPostCreate%28android.os.Bundle%29 [d64534c] - β±
Activity.recreate()
should call back to theActivityController
to handle the recreation. This is because we wish to simulate real Android which schedules the activity for recreation with a new instance by the framework. [84f330f] - β Remove dependency on server side Apache HTTP jars. Use Android legacy jars instead. [6602e1a]
- ..internal.. [8bd178a]
- β Remove
DisplayConfig.address
for now. [4443002] - Internal change [0b5944c]
- π Use 'sneaky throw' technique instead of
Unsafe
[13cc3ef] - Throw a
RuntimeException
whenActivity
cannot be resolved. [5923f51] - π Merge pull request #4638 from robolectric:rel-42 [fad2e99]
- π¨ Refactor
DefaultSdkProvider
to allow plugins to customize. [d43598f] - π Synchronize list access for bound/unbound services [35098f6]
- Register shadow classes in a stable order, so locally overridden shadows work predictably. [5725427]
- Internal [02f57c9]
- π Subinjectors now work better. [f535f84]
- β remove
ShadowExifInterface
to allow calling actual methods. [2127bbf]
Known Issues
- π Espresso's IdlingResources are not supported
- β When running with Java 9, Robolectric triggers a warning about illegal reflective access [issue #4776].
- π Activities must now be explicitly declared in a manifest (as is the case for normal Android); however, Android Gradle Plugin doesn't currently merge a test manifest. See #4736 for more context and #4727 for a workaround.
- β
Android Gradle Plugin 3.3 reports the following warning, which may be safely ignored:
WARNING: The option setting 'android.enableUnitTestBinaryResources=true' is experimental and unsupported.
. Android Gradle Plugin 3.4 will resolve this issue. - π Android Gradle Plugin 3.2.1 does not work on Windows; use 3.3 instead [issue #3955].
Compatibility
- π Android Studio/Android Gradle Plugin 3.4 or 3.5 Beta
- β Android SDK 28 (includes support for testing against SDKs from 16 on) and Android Q Beta 2.
- β Running tests on Android Q requires Java 9.
- π Legacy resources mode will not be supported for Android Q.
- π AndroidX Test 1.2.0
π Use Robolectric:
testCompile "org.robolectric:robolectric:4.3"
Find more details here. Report issues here. Enjoy!
-
v4.3-beta Changes
May 06, 2019π NOTE: Robolectric 4.3-beta-1 is a outdated preview release; please use 4.3 or later instead.
-
v4.3-alpha Changes
May 01, 2019π NOTE: Robolectric 4.3-alpha-3 is a outdated preview release; please use 4.3 or later instead.
-
v4.2.1 Changes
March 15, 2019π This release introduces a new extension mechanism for Robolectric, fixes a major performance regression in 4.x, and includes numerous SDK support improvements and bug fixes.
π Bug Fixes
- π Robolectric 4.2.1 fixes a number of issues when running tests on Windows [issue 4670].
- π Applied fixes to activity lifecycle
RoboMonitoringInstrumentation
[4c7f968].
Known Issues
- π Activities must now be explicitly declared in a manifest (as is the case for normal Android); however, Android Gradle Plugin doesn't currently merge a test manifest. See #4736 for more context and #4727 for a workaround.
- β
Android Gradle Plugin 3.2.1 and 3.3 report the following warning, which may be safely ignored:
WARNING: The option setting 'android.enableUnitTestBinaryResources=true' is experimental and unsupported.
. Android Gradle Plugin 3.4 will resolve this issue. - π Android Gradle Plugin 3.2.1 does not work on Windows; use 3.3+ instead [issue #3955].
Compatibility
- π Android Studio/Android Gradle Plugin 3.3 or 3.4 Beta
- β Android SDK 28 (includes support for testing against SDKs from 16 on)
π Use Robolectric:
testCompile "org.robolectric:robolectric:4.2.1"
Find more details here. Report issues here. Enjoy!
-
v4.2 Changes
February 14, 2019π This release introduces a new extension mechanism for Robolectric, fixes a major performance regression in 4.x, and includes numerous SDK support improvements and bug fixes.
π Features
- π Robolectric 4.2 introduces a new plugin system, replacing the previous ad-hoc customization mechanisms (subclassing
RobolectricTestRunner
, providing system properties, etc.). The old mechanisms are deprecated and will eventually be removed; let us know if there are missing extension points you need. See org.robolectric.pluginapi for more details [issue #4362]. - π Fixed a significant performance regression in 4.x. Thanks @cesar1000! [issues #4142, #4585].
- For developers of custom shadows, Robolectric 4.2 has a new typesafe and more performant way to access fields and methods on @RealObjects using the Reflector API [issues #4361, #4315, #4351, #4456]
β Android SDK support and Test API changes
- π Activities must now be explicitly declared in a manifest (as is the case for normal Android). See #4736 for more context.
- π¦ PackageManager
PackageManager
is moving to returning defensive immutable copies of its internal data (as on a real device). A series of new testing APIs have been added to modify the package under test; seePackageManager.addOrUpdateActivity()
andremoveActivity()
, plusService
,ContentProvider
, andBroadcastReceiver
equivalents [issue #4489].- Implement
PackageManager.isSafeMode()
[issue #4526].
ShadowDisplayManager.getSaturationLevel()
is now an instance method [issue #4522].- Telephony
- Add
slotId
basedgetImei()
andgetMeid()
toTelephonyManager
[issue #4521]. - Add the ability to prevent certain networks from being updated in tests [issue #4515].
- Implement
TelephonyManager.getListenersForFlags
in tests [issue #4469]. - Implement
TelephonyManager.getVisualVoicemailPackageName()
[issue #4444].
- Add
- Bluetooth
- Test
APIs
forBluetoothSocket
andBluetoothServerSocket
connections [issue #4510]. - Implement
BluetoothLeAdvertiser
[issues #4478 and #4454]. - Implement
BluetoothHeadset.getConnectedDevices()
,getConnectionState()
, andsendVendorSpecificResultCode()
, with test APIs [issue #4442]. - Add ability to send BluetoothGattCallback connection state change updates [issue #4584].
- Test
- Implement
ActivityManager#getCurrentUser()
[issue #4483]. UserManager
- Implement
Context.sendBroadcastAsUser
[issue #4486]. - π Implement
WindowManagerImpl#removeViewImmediate(View)
[issue #4447]. - Implement
SensorManager.registerListener()
: [issue #4446]. - Implement
NetworkScoreManager.disableScoring()
andisScoringEnabled()
to [issue #4436]. DevicePolicyManager
now enforces password restrictions [issues #4532, #4545, and #4539].- Implement
UiModeManager
[issue #4548]. - Implement
AccessibilityManager#addAccessibilityStateChangeListener(AccessibilityStateChangeListener
, Handler) [issue #4448]. - Implement
ParcelFileDescriptor.createReliablePipe
method [issue #4562]. - π¦ Move intent filters to their own lists and out of the Package [issue #4488].
- Implement
WifiRttManager
andRangingResult
[issue #4561]. - β Add test API to toggle a
Sensor
wake-up mode [issue #4558]. - β Add
PowerManager.WakeLock
getTimesHeld()
test API to count number of times the wakelock was held [issue #4551]. - β Adds basic
MediaCodec
andMediaMuxer
shadows to robolectric. TheMediaCodec
shadow implements basic passthrough asynchronous encoding, and theMediaMuxer
shadow muxes input bytes directly to the file without modification [issue #4550]. - β‘οΈ Update to
ShadowDevicePolicyManager
to allow uses-policy granting [issue #4546]. - Modify
ShadowParcel
to throw an Error instead ofRuntimeException
to discourage [issue #4528]. - Don't autocreate activities in
LocalActivityInvoker
anymore [issue #4582]. - 0οΈβ£ Don't automatically generate default
ActivityInfo
whenever asked [issue #4580]. - π Implements
WebView.removeJavascriptInterface
[issue #4575]. - β‘οΈ Update to
ShadowDevicePolicyManager
to set storage encryption [issue #4563].
π§ Configuration
- π There are some small changes to the way Android SDK jars are located; see (
LegacyDependencyResolver
javadoc)[http://robolectric.org/javadoc/4.2/org/robolectric/plugins/LegacyDependencyResolver.html] for details [issue #4599].
π Bug Fixes
- The
android
system context is no longer a parent of the application context [issue #4481]. - π Fix
LocalActivityInvoker.recreateActivity.
Before this change, it calledActivity.onRetainNonConfigurationInstance()
directly to obtainnonConfigInstance
for the activity. This should've called indirectly fromActivity.retainNonConfigurationInstances().
retainNonConfigurationInstances()
also createsnonConfigInstances
for fragments to prepare for the host activity recreation [issue #4511]. - π Fix timeout in
FontsContract.getFontSync()
caused becauseContext.canLoadUnsafeResources()
now returns false since the context isn't a system context [issue #4517]. - π Fix handling of persisted preferred activities [issue #4480].
- π Fix
processName
setting and add few more reasonable defaults when installing new package [issue #4465]. - β Add permission check to
LocationManager.setLocationEnabledForUser
[issue #4500]. - No longer reset the data position after unmarshalling a
ShadowParcel
[issue #4468]. - π Fix
NPE
Robolectric when a failure occurs before shadows are set up [issue #4467]. - Set
AppBindData#processName
consistently withApplicationInfo#processName
[issue #4537]. - π¦ Throw
NameNotFoundException
from Context.createPackageContext
for non-existing packages [issue #4527]. - π Synchronize access to
ShadowPendingIntent
andShadowUsageStatsManager
fields [issue #4520]. - π Fix
Activity#isChangingConfigurations()
returning false during the recreation [issue #4540]. - π Fix equality in
ShadowNetwork
[issue #4464].
π Deprecations and Removals
- π
FsFile
et al. have been removed in favor of java.nio.file.Path [issue #4265]. - β‘οΈ
ShadowPackageManager.addResolveInfoForIntent
is deprecated; add explicit activity declarations in your manifest, or useShadowPackageManager.addOrUpdateActivity(ActivityInfo)
[issue #4489]. - π Deprecate Robolectric#
setupActivity
in favor ofActivityScenario
[issue #4564].
Internal Changes
- β Tests are now run on a dedicated thread for each SDK [issue #4559].
- π Resolve
AARs
like the android plugins do (kind of) [issue #4279]. - Reflector objects should unwrap invocation exceptions [issue #4361].
- Fast private method invocation [issue #4315].
- β Add support for static methods and fields to Reflector [issue #4351].
- π Fix Reflector class definition in Java 11 [issue #4456].
- π Support Java 9 [issue #4400].
- π Robolectric now builds successfully on Windows, though a few tests still fail [issue #4293].
- π§ Extensible configuration system [issue #4519].
- Switch circleci to
API
28 image. FixSDK
install license fail [issue #4541]. - π Changes to support Java 9 [issue #4452].
TypedArray
doesn't need a shadow in binary mode [issue #4470].- Extract
Sdk
fromSdkConfig
[issue #4394]. - Clean up
SdkProvider
interface [issue #4513]. - π Move
PerfStatsReporter
to pluginapi [issue #4471]. PerfStatsCollector
retains min and max timing info for events [issue #4552].- β Remove
DefaultConfigMerger
[issue #4549].
Known Issues
- π Activities must now be explicitly declared in a manifest (as is the case for normal Android); however, Android Gradle Plugin doesn't currently merge a test manifest. See #4736 for more context and #4727 for a workaround.
- π Robolectric 4.2 doesn't work on Windows in some cases [issue #4603 et al.].
- β
Android Gradle Plugin 3.2.1 and 3.3 report the following warning, which may be safely ignored:
WARNING: The option setting 'android.enableUnitTestBinaryResources=true' is experimental and unsupported.
. Android Gradle Plugin 3.4 will resolve this issue. - π Android Gradle Plugin 3.2.1 does not work on Windows; use 3.3 instead [issue #3955].
Compatibility
- π Android Studio/Android Gradle Plugin 3.3 or 3.4 Beta
- β Android SDK 28 (includes support for testing against SDKs from 16 on)
π Use Robolectric:
testCompile "org.robolectric:robolectric:4.2"
Find more details here. Report issues here. Enjoy!
- π Robolectric 4.2 introduces a new plugin system, replacing the previous ad-hoc customization mechanisms (subclassing