Skip to content

Robolectric 4.10

Compare
Choose a tag to compare
@hoisie hoisie released this 11 Apr 16:55
· 774 commits to master since this release

Robolectric 4.10 adds support for native Android graphics. It is currently disabled by default and can be enabled using @GraphicsMode(NATIVE). When native graphics is enabled, interactions with Android graphics classes use real native Android graphics code and are much higher fidelity.

Behavior changes

In Robolectric 4.10, ReflectionHelpers.setStaticField no longer removes the final keyword from static fields. This is because removing final using reflection stops working in JDK 18 due to https://openjdk.java.net/jeps/416. To remove final from static fields, consider using some instrumentation-based approach, such as mockito-inline.

What's Changed

  • Remove dead code that uses Plan based instrumentation (ClassHandler.Plan) #7610
  • Run SDK 33 tests on CI by @utzcoz in #7613
  • Bump maximum API for GMD to SDK 33 by @utzcoz in #7614
  • Remove use-sdk from androidx_test/sharedTest/AndroidManifest.xml by @utzcoz in #7615
  • [Warning] Eliminated AnnotateFormatMethod warnings by @hellosagar in #7353
  • Remove 0x prefix for string format log by @utzcoz in #7617
  • Bump compile/targetSdk to 33 by @utzcoz in #7616
  • Remove unused Exception for ShadowActivityTest by @utzcoz in #7618
  • Support Activity setShowWhenLocked() and setTurnScreenOn() by @utzcoz in #7438
  • Exclude kotlin-stdlib dependency from utils generated .pom by @utzcoz in #7607
  • Move dependencies of shadows/framework to gradle.properties by @utzcoz in #7627
  • Bump ASM to 9.3 by @utzcoz in #7626
  • Add the ability to deploy specific preinstrumented jars to maven by @hoisie in #7602
  • Combine exceptions for ReflectionHelpers#getDeclaredField by @utzcoz in #7634
  • Clean up ShadowAccountManager by @utzcoz in #7636
  • Migrate Gradle dependencies to dependencies.gradle by @utzcoz in #7635
  • Add alternative to Unsafe.defineAnonymousClass by @utzcoz in #7633
  • Support all authentication results for BiometricManager by @charlesng in #7427
  • Bump bcprov-jdk15on from 1.68 to 1.70 by @dependabot in #7638
  • Bump constraintlayout from 2.1.3 to 2.1.4 by @dependabot in #7640
  • Reuse bytecode of ClassWriter for ProxyMaker by @utzcoz in #7643
  • Migrate instance calling in ReflectionHelpers to lambda by @utzcoz in #7644
  • Bump compile-testing from 0.18 to 0.19 by @dependabot in #7645
  • Bump apiCompatVersion from 4.7 to 4.8.2 by @dependabot in #7647
  • Bump gson from 2.8.6 to 2.9.1 by @dependabot in #7646
  • Bump core from 1.5.0 to 1.9.0 by @dependabot in #7649
  • Clean up unused code for ShadowDisplayManagerTest by @utzcoz in #7662
  • Remove unused shadows ShadowCornerPathEffect and ShadowLinearGradient #7668
  • Bump apiCompatVersion from 4.8.2 to 4.9 by @dependabot in #7672
  • Add call to $$robo$init for Jacoco-instrumented constructors #7677
  • Respect ShadowProvider priority when populating the ShadowPicker map #7686
  • Properly parse & populate process information from the manifest. ServiceInfo.processName and ActivityInfo.processName will now correctly reflect the value of the process attribute from their respective manifest entry. #7690
  • Bump autoServiceVersion from 1.0-rc6 to 1.0.1 by @dependabot in #7674
  • Create an activity context for activities. #6481
  • Remove deprecated Utils#intArrayToList by @utzcoz in #7687
  • Fix configuration/resource handling in activity contexts #7692
  • Add Java source & target compatibility config for preinstrumented by @utzcoz in #7664
  • Update the ResourcesManager configuration when applying qualifiers #7697
  • Replace Config with Implementation #7710
  • Switch to ubuntu-20.04 for GitHub Actions by @utzcoz in #7716
  • Bump errorproneVersion from 2.9.0 to 2.16 by @dependabot in #7715
  • Bump Kotlin to 1.7.10 by @utzcoz in #7497
  • Upgrade androidx.test and androidx.fragment versions to latest. by @brettchabot in #7683
  • Bump kotlinVersion from 1.5.20 to 1.7.20 by @dependabot in #7694
  • Adding proxy settings to fetching artifacts by @sebastienrussell in #7713
  • Fix potential ClassCastException in RobolectricModel #7735
  • Ignore hprof file for Git by @utzcoz in #7739
  • Fix some issues in ShadowWallpaperManager #7740
  • Disable animation when running instrumentation tests by @utzcoz in #7741
  • Switch to use macos-12 for instrumentation-tests on CI by @utzcoz in #7743
  • Make CI Emulator's environment cleaner by @utzcoz in #7742
  • Bump auto-value from 1.9 to 1.10 by @dependabot in #7747
  • Add shadow implementation of MediaController#getExtras() #7749
  • Clean up language that appears to be cursing in Korean by @rexhoffman in #7752
  • Create Robolectric shadow for ResponderLocation. #7754
  • Make ShadowBitmap public APIs extendable #7756
  • Add getPackageUid (String packageName, PackageManager.PackageInfoFlags flags) to ShadowApplicationPackageManager. #7737
  • Update setLinkDownstreamBandwidthKbps Shadow method to shadow all APIs and have loose signatures #7758
  • Add new APIs to ShadowAlarmManager. #7759
  • Update snapshot version to 4.10 in README.md by @utzcoz in #7760
  • Fix android-9.0.0_r12 ResourceTypes.h link for ResTable by @utzcoz in #7762
  • Update to androidx.test 10.26.2022 RC release by @utzcoz in #7763
  • Make ShadowMatrix public APIs extendable #7768
  • Treat Pattern as the same if the pattern and flags are the same #7776
  • Remove unused looseSignatures from ShadowConextHubClient by @utzcoz in #7769
  • Update some access modifiers from private to protected to allow for overriding and subclass access #7781
  • Enclose The Robolectric.buildActivity() call with in try by @arinmodi in #7782
  • fix: Avoid referring to Android S's TelephonyCallback by @styluo in #7786
  • Bump AGP to 7.3.1 by @utzcoz in #7789
  • Enable Implements validation on Gradle again by @utzcoz in #7788
  • Add missed override for LocalActivityInvoker#startActivityForResult by @utzcoz in #7790
  • Migrate shadows/playservices to AndroidX by @jselbo in #7784
  • Only filter sdk when PREINSTRUMENTED_SDK_VERSIONS is not empty by @utzcoz in #7787
  • Use uninterruptibly acquire for ResTable's lock by @utzcoz in #7761
  • Change where addCallToRoboInit() inserts call to $$robo$init #7793
  • Deletes some ShadowNumberPicker functions that don't do anything, which allows DatePickerSpinner to use real values and the real class. #7797
  • Update to androidx.test 11.04.2022 stable release by @utzcoz in #7785
  • Add getActiveDataSubscriptionId to ShadowSubscriptionManager. #7821
  • Delete unnecessary ShadowOutline #7824
  • Bump ASM to 9.4 by @utzcoz in #7823
  • Keep dependency the same as robolectric.org for Windows building by @utzcoz in #7825
  • Enable openRawResourceFd for ResourcesTest by @utzcoz in #7688
  • Add shadow for LocaleManager#getSystemLocales by @utzcoz in #7804
  • Make ShadowSensorManager call onFlushCompleted on relevant listeners when SensorManager.flush is called. #7837
  • Remove lifecycle-common dependency by @utzcoz in #7838
  • Fix package name in AndroidManifest.xml of compat-target28 by @utzcoz in #7843
  • Make OBJECT_TYPE in ClassInstrumentor protected and add getter method for classType in MutableClass #7847
  • Add test-services for instrumentation-test modules by @utzcoz in #7842
  • Use \R as regex's linebreak matcher for ExpectedLogMessagesRuleTest by @utzcoz in #7855
  • Remove unused code for ReflectionHelperTest by @utzcoz in #7858
  • Rename ShadowNativeAllocationRegistry to ShadowNoopNativeAllocationRegistry #7861
  • Add JUnit4 Enclosed runner compatibility tests by @utzcoz in #7873
  • Fix format of androidx_test's layout xml files by @utzcoz in #7853
  • Disable auto-correct for EspressTest's EditText by @utzcoz in #7854
  • Use binary resources for the 'nativeruntime' project by @hoisie in #7874
  • Ensure ShadowSpeechRecognizer can work with SDK 28 by @utzcoz in #7859
  • Keep to use Ubuntu 18.04 for nativeruntime by @utzcoz in #7881
  • Update DefaultNativeRuntimeLoader to work in RNG #7882
  • Enable CI when commits are pushed to release branches by @hoisie in #7884
  • Add ShadowUIModeManager#setCurrentModeType #7885
  • Add Espresso test for button clicking with onLongClickListener by @utzcoz in #7857
  • CI: Migrate set-output to GITHUB_OUTPUT by @utzcoz in #7888
  • Enable useTestStorageService for androidx_test by @utzcoz in #7889
  • Cleanup build by @hoisie in #7883
  • Bump libphonenumber from 8.0.0 to 8.13.3 by @dependabot in #7891
  • Include :integration_tests:play_services for Android Studio by @utzcoz in #7898
  • Bump mockitoVersion from 4.1.0 to 4.11.0 by @dependabot in #7899
  • Ignore tests of CI for md only modification by @utzcoz in #7903
  • Bump multiple dependencies by @utzcoz in #7902
  • Bump compile-testing from 0.19 to 0.21.0 by @dependabot in #7905
  • Bump errorproneVersion from 2.16 to 2.17.0 by @dependabot in #7906
  • Bump kotlinVersion from 1.7.22 to 1.8.0 by @dependabot in #7912
  • Bump okhttp-bom from 4.8.0 to 4.10.0 by @dependabot in #7911
  • Bump libphonenumber from 8.13.3 to 8.13.4 by @dependabot in #7913
  • Add getCallerConfiguredNetworks and removeNonCallerConfiguredNetworks. #7916
  • Bump apiCompatVersion from 4.9 to 4.9.2 by @dependabot in #7926
  • Bump errorproneVersion from 2.17.0 to 2.18.0 by @dependabot in #7925
  • Bump appcompat from 1.4.1 to 1.6.0 by @dependabot in #7924
  • Use loose signatures for ShadowApplicationPackageManager.getProperty #7929
  • Add example for custom shadow with Kotlin by @utzcoz in #7901
  • Adapt to ViewRootImpl.dispatchResized changes #7932
  • Add eglGetCurrentContext() implementation in ShadowEGL14. #7933
  • Update some dependencies by @utzcoz in #7935
  • Bump espressoVersion from 3.5.0 to 3.5.1 by @dependabot in #7937
  • Bump monitor from 1.6.0 to 1.6.1 by @dependabot in #7950
  • Support ResTable staged alias type by @jselbo in #7923
  • Fix typo for RobolectricShadow by @utzcoz in #7954
  • RoboCookieManager supports override cookie has the same key by @utzcoz in #7897
  • Bump io.mockk:mockk from 1.9.3 to 1.13.4 by @dependabot in #7955
  • Bump gson from 2.9.1 to 2.10.1 by @dependabot in #7936
  • Bump bcprov-jdk15on from 1.70 to 1.72 by @brandonweeks in #7961
  • Migrate kotlinOptions to compilerOptions by @utzcoz in #7976
  • Bump androidx.appcompat:appcompat from 1.6.0 to 1.6.1 by @dependabot in #7966
  • Bump androidx.test:runner from 1.5.0 to 1.5.2 by @dependabot in #7965
  • Remove --disable-shared from ICU's configuration command for MinGW by @utzcoz in #7979
  • Clean up PackageManagerTest code by @utzcoz in #7980
  • Bump com.diffplug.spotless:spotless-plugin-gradle from 6.12.0 to 6.15.0 by @dependabot in #7984
  • Bump com.google.auto.value:auto-value from 1.9 to 1.10.1 by @dependabot in #7982
  • Support PackageManager#getApplicationInfo(String, ApplicationInfoFlags) by @utzcoz in #7981
  • Add method to set the picture-in-picture mode flag. #7987
  • Bump fragmentVersion from 1.2.0 to 1.5.5 by @dependabot in #7983
  • Avoid instrumenting some legacy support packages #7993
  • Bump com.ibm.icu:icu4j from 70.1 to 72.1 by @dependabot in #8006
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.4 to 8.13.7 by @dependabot in #8008
  • Bump kotlinVersion from 1.8.0 to 1.8.10 by @dependabot in #8009
  • Fix sandboxed class lookup when a test is subclassed. #8003
  • Bump com.google.auto.value:auto-value-annotations from 1.10 to 1.10.1 by @dependabot in #8007
  • Add shadow implementation of UserManager#getUserHandles(boolean) #8018
  • Add integration tests for JaCoCo on-the-fly instrumented. by @ZSmallX in #8017
  • Only run jacoco-on-the-fly tests on Robolectric environment by @utzcoz in #8019
  • Migrate compileTestKotlin to compileKotlin for kotlin module by @utzcoz in #8020
  • Bump com.diffplug.spotless:spotless-plugin-gradle from 6.15.0 to 6.16.0 by @dependabot in #8023
  • Bump com.android.tools.build:gradle from 7.4.0 to 7.4.2 by @dependabot in #8026
  • Bump org.jetbrains:annotations from 16.0.2 to 24.0.1 by @dependabot in #8022
  • Make ShadowCompanionDeviceManagerTest future proof. #8027
  • Switch JaCoCo on-the-fly to offline for integration tests. by @ZSmallX in #8021
  • Convert test code of maven-dependency-resolver to Kotlin by @utzcoz in #7947
  • Add xmlns:app="http://schemas.android.com/apk/res-auto" to use app:actionViewClass with the appcompat library #8043
  • Skip ShadowHardwareBufferTest#createInvalidFormatThrows on platforms > T. #8036
  • Use prebuilt Robolectric Native Runtime artifacts from AOSP by @hoisie in #8045
  • Fix an edge case when PackageManager.getApplicationInfo is called by @hoisie in #8048
  • Remove CMake/Clang/GCC requirements from README.md by @utzcoz in #8049
  • Add Javadoc for some integration_tests/jacoco-offline sources by @hoisie in #8052
  • Fix Kotlin lint issues with MavenDependencyResolverTest by @hoisie in #8053
  • Remove setOnLongClickListener call in EspressoActivity by @hoisie in #8051
  • Remove unused recursive checkout parameter from GitHub Actions by @utzcoz in #8050

New Contributors

Full Changelog: robolectric-4.9.2...robolectric-4.10-alpha-1