Robolectric 4.16
·
783 commits
to master
since this release
Robolectric 4.16 supports Android Baklava (SDK 36), and you need to use JDK 21 if running tests with SDK 36 target. It also removes support for Android L (SDK 21 and 22).
One exciting new feature is native resources (ResourcesMode.NATIVE). Note this is currently only available in SDK 36.
If you have any issues, please file them here.
What's Changed
- Reuse
ShadowUIModeManagerinShadowUIModeManagerTestby @MGaetan89 in #10368 - Update AndroidX by @renovate[bot] in #10373
- Update dependency gradle to v8.14.2 by @renovate[bot] in #10372
- Update dependency com.googlecode.libphonenumber:libphonenumber to v9.0.7 by @renovate[bot] in #10371
- Update dependency org.bouncycastle:bcprov-jdk18on to v1.81 by @renovate[bot] in #10374
- Fix ApplicationInfo inconsistencies in Robolectric. in #10375
- Add shadow for new resolveActivityAsUser variant. in #10377
- Adjust to indevelopment SDK changes. in #10379
- Adding support to the Simulator for picking up the device configuration from a Configurer. in #10381
- Clean up SDK ranges for shadow methods in Baklava. in #10380
- Add a shadow for Equalizer in #10384
- Update example to be consistent with robolectric.org by @seadowg in #7475
- Update the
simulator-gradle-pluginto depends on AGPgradle-apiby @MGaetan89 in #10386 - Replace custom
getOrDefault()with the corresponding Java method by @MGaetan89 in #10370 - Fix Javadoc for
ShadowPausedLooperby @MGaetan89 in #10387 - Fix condition in
ResourceHelper#parseFloatAttribute()by @MGaetan89 in #10369 - Validate listener in
ShadowAccountManager#addOnAccountsUpdatedListener()by @MGaetan89 in #10361 - Add support for UiModeManager.setNightMode(UiModeManager.MODE_NIGHT_CUSTOM) in #10390
- Lazily register the simulator plugin by @MGaetan89 in #10391
- Enable stricter plugin validation by @hoisie in #10388
- Add the VirtualDeviceManager#getVirtualDevice(int deviceId) to the ShadowVirtualDeviceManager. in #10395
- Fix various small warnings by @MGaetan89 in #10394
- Add shadow implement of AccessibilityService#getRootInActiveWindow in #10397
- Add more information to the generated POM file by @MGaetan89 in #10392
- Change ShadowChoreographer.getDefaultFrameDelay into a shadow method. in #10404
- Restore removed methods from
Configby @MGaetan89 in #10406 - Add shadow override for Network SocketFactory. in #10409
- Add missing deprecations to some
Config.Buildermethods by @MGaetan89 in #10408 - Remove
testDebugUnitTestfrom the dependencies of thesimulatortask by @MGaetan89 in #10413 - Merge branch 'google' into 'master' by @hoisie in #10414
- Bump the snapshot version to 4.16 by @MGaetan89 in #10415
- Add ability to specify is80211azNtbMeasurement to ShadowRangingResult in #10410
- Added implementation for Path.op by @GisoBartels in #10288
- Fix massive code warnings of ShadowVirtualDeviceManagerTest by @utzcoz in #10399
- Remove redundant String concatenation by @MGaetan89 in #10417
- Migrate deprecated APIs to idleMainLooper for ShadowVirtualDeviceManagerTest by @utzcoz in #10418
- Replace Stream#toList to Stream#collect(Collectors.toList()) by @utzcoz in #10420
- Support Java 11 in the simulator gradle plugin by @hoisie in #10421
- Update AndroidX by @renovate[bot] in #10422
- Update roborazzi to v1.45.1 by @renovate[bot] in #10424
- Update dependency io.mockk:mockk to v1.14.4 by @renovate[bot] in #10423
- Replace
Asset#toIntExact()withMath#toIntExact()by @MGaetan89 in #10425 - Add support for getPrimaryImei() in ShadowTelephonyManager. in #10427
- Fix elevation in HW rendering for Android R (30) and below in #10429
- Add ShadowTextureView to noOp drawing with it. in #10433
- Update dependency com.googlecode.libphonenumber:libphonenumber to v9.0.8 by @renovate[bot] in #10435
- Update Android Gradle Plugin by @renovate[bot] in #10436
- Update error.prone to v2.39.0 by @renovate[bot] in #10439
- Update dependency net.ltgt.errorprone to v4.3.0 by @renovate[bot] in #10438
- Update kotlin monorepo to v2.2.0 by @renovate[bot] in #10440
- Update deprecation message in
ShadowRoleManagerby @MGaetan89 in #10432 - Implemente getLastAuthenticationTime supported since V. in #10443
- Remove hyphens from 'security-providers' project in #10444
- Remove temporary system property
robolectric.supportElevationPreSin #10445 - Fix the
IntentSenderin Robolectric to handle newer APIs. in #10448 - Remove deprecated methods in
:shadows:httpclientby @MGaetan89 in #10450 - Update roborazzi to v1.46.1 by @renovate[bot] in #10452
- Update dependency gradle to v8.14.3 by @renovate[bot] in #10451
- Update dependency com.squareup.okhttp3:okhttp-bom to v5 by @renovate[bot] in #10453
- Set calling package for launchActivityForResult before onCreate. in #10454
- Fix keyboard focus problem after right-click menu is displayed in #10456
- Add waitForService, isDeclared and waitForDeclaredService for ShadowServiceManager. in #10457
- Remove
deckardreferences from the readme by @MGaetan89 in #10431 - Let ShadowWifiManager return empty list for getPrivilegedConfiguredNetworks(). in #10459
- Update google-java-format to 1.28.0 by @MGaetan89 in #10460
- Add lseek functionality to ShadowOs. in #10462
- Let ShadowWifiManager return invalid network ID for addNetwork. in #10463
- Update Android Gradle Plugin by @renovate[bot] in #10465
- Update error.prone to v2.40.0 by @renovate[bot] in #10470
- Update dependency com.squareup.okhttp3:okhttp-bom to v5.1.0 by @renovate[bot] in #10469
- Update dependency com.googlecode.libphonenumber:libphonenumber to v9.0.9 by @renovate[bot] in #10467
- Update dependency com.diffplug.spotless:spotless-plugin-gradle to v7.1.0 by @renovate[bot] in #10468
- Update ShadowSystemServiceRegistry to match the framework. in #10458
- Add tests to
ResourceHelperandResourceHelper2by @MGaetan89 in #10400 - Add public shadow APIs ShadowInputManager.addInputDevice and ShadowInputManager.addInputDeviceKeys in #10474
- Cleanup looper control runnable posting. in #10476
- Update Kotlin declaration in Gradle script by @MGaetan89 in #10477
- Allow create/removeBond to properly change bond state on ShadowBluetoothDevice. in #10478
- Update dependency com.googlecode.libphonenumber:libphonenumber to v9.0.10 by @renovate[bot] in #10479
- Update dependency com.diffplug.spotless:spotless-plugin-gradle to v7.2.0 by @renovate[bot] in #10482
- Update dependency io.mockk:mockk to v1.14.5 by @renovate[bot] in #10480
- Update dependency androidx.compose:compose-bom to v2025.07.00 by @renovate[bot] in #10481
- Support maxBounds in WindowConfiguration. in #9031
- Remove tests that require
maxSdk = 22in #10483 - Remove tests that only run on 21/22 Lollipop. in #10484
- Update test to remove lollipop references. in #10487
- Restore the minSdk for nativeSetConfiguration to be Baklava as git_main is still developing Baklava in #10488
- Adapt to constructor API changes in Android. in #10485
- Set default applicationInfo.uid in AndroidTestEnvironment to Process.myUid() in #10486
- Speed up ShadowWifiP2pManagerTest and fix ShadowWifiP2pGroup. in #10492
- Deprecate
TextLayoutModeby @MGaetan89 in #10493 - Support
classificationin MotionEffect shadow in #10494 - Update error.prone to v2.41.0 by @renovate[bot] in #10496
- Update dependency com.diffplug.spotless:spotless-plugin-gradle to v7.2.1 by @renovate[bot] in #10495
- Mark LEGACY LooperMode as unsupported in upcoming SDKs. in #10498
- Fix list formatting of javadoc and simplify condition in #10499
- Implement shadow of confirmCredentials in ShadowAccountManager in #10501
- Add shadow for WifiAwareManager#isDeviceAttached. in #10502
- Add unit tests for unpause handling. in #10503
- Use a mock RemoteAdapterConnectionCallback in ShadowRemoteViewsAdapterTest in #10505
- Move Process.myUid test from AndroidTestEnvironmentTest to ActivityScenarioTest in #10506
- Fix launchActivityForResult_intent_hasCallingPackageOnCreate in Gradle by @hoisie in #10507
- Update dependency com.googlecode.libphonenumber:libphonenumber to v9.0.11 by @renovate[bot] in #10509
- Update AndroidX by @renovate[bot] in #10511
- Update Android Gradle Plugin by @renovate[bot] in #10510
- Deprecate
TextLayoutModeConfigurerby @MGaetan89 in #10497 - Specify POM file when installing local android prebuilt by @hoisie in #10508
- Make the simulator task variant aware by @MGaetan89 in #10515
- Move
assume()statement to setUp method in ShadowSQLiteConnectionTest in #10519 - Update Android V android-all Jar to 12714715 in #10520
- Invoke ContrastChangeListeners in ShadowUIModeManager#setContrast to help verify the effect of contrast changes. in #10518
- Update bundle generation for install-android-prebuilt.sh by @hoisie in #10517
- Update publishing URLs to point to Maven Central Portal by @hoisie in #10516
- Update the URL for SNAPSHOTS repo in README by @hoisie in #10521
- Test Merge by @hoisie in #10524
- Add BAKLAVA (SDK 36) to AndroidSdk and DefaultSdkProvider by @hoisie in #10526
- Update
SimulatorPluginto use configuration avoidance by @MGaetan89 in #10527 - Simplify
ResourceHelper2by @MGaetan89 in #10475 - Use
ApkAssetsinShadowArscApkAssets9by @MGaetan89 in #10464 - Update shadow for setNetworkCountryIso with broadcast in #10528
- Remove the
shadows-playservicesmodule by @MGaetan89 in #10430 - Expose the params Bundle supplied to the speak method for testing. in #10529
- Add subscription broadcasts to ShadowSubscriptionManager in #10530
- Add capability to mimic updated system image app PackageInfo behavior in package manager shadows. in #10532
- Add tests to the simulator
Versionclass by @MGaetan89 in #10533 - fix native library loading failing due to logging by @damianw in #10534
- Remove SDK 21 and 22 from the supported SDK list. in #10535
- Min SDK 23 cleanup. in #10536
- Run GitHub Actions
testsworkflow on Android B (SDK 36) in #10537 - Ensure all the idleFor logic runs on the Looper thread. in #10538
- Adds robolectric support for AccessibilityInputConnection.deleteSurroundingText. in #10540
- Partial convert to use TestLooperManager APIs. in #10541
- Add ShadowLooper#runUntilEmpty. in #10543
- Prepare for BluetoothSocket move of mDevice. in #10544
- Convert ShadowPausedLooper#getNextScheduledTaskTime to use TestLooperManager APIs. in #10545
- Update ShadowActivity to support peeking activities launched with startActivityIfNeeded. in #10542
- Remove deprecated methods in
Configby @MGaetan89 in #10434 - Deprecate ShadowPausedMessageQueue#isIdle in favor of using real MessageQueue#isIdle. in #10547
- Increment minimum supported compile SDK to 30 and fix shadowOf(vpnManager). in #10548
- Roll back recent ShadowActivity change in #10549
New Contributors
- @GisoBartels made their first contribution in #10288
- @damianw made their first contribution in #10534
Full Changelog: robolectric-4.15.1...robolectric-4.16