Skip to content

Robolectric 4.7

Compare
Choose a tag to compare
@hoisie hoisie released this 12 Nov 04:11
· 1867 commits to master since this release

Robolectric 4.7 adds support for Android S (API level 31).

Another big feature is support for Apple Silicon (Mac M1). Robolectric 4.7 now contains its own native implementation of the android.database.sqlite package. For Mac M1 machines, this SQLite mode is the default. For other OS's and architecture, use @SQLiteMode(NATIVE) to enable it. This new mode is currently only available for Mac and Linux. Native SQLite should be significantly faster, around 50-90% faster for SQLite operations, than the LEGACY SQLite mode. There were also several other performance improvements made for SQLite operations -- #6687, #6690, and #6711 (thanks @al-broco!).

The support v4 shadows are also deprecated at this release, and they will be removed at Robolectric 4.8.

Robolectric 4.7 also supports JDK 17.

What's Changed

  • Clear cookies after test finished for CookieManagerTest by @utzcoz in #6581
  • Only using ApplicationExitInfo for compile sdk 30 and above by @utzcoz in #6590
  • Rebase PR 4064 - Fix NPE during saving state of WebView by @utzcoz in #6597
  • Converting the String version of directlyOn(...) to @direct with reflector(...). by @hoisie in #6598
  • Add ITelephonyRegistry to ShadowServiceManager #6605
  • Implement new #startActivity methods for ShadowCrossProfileApps. #6601
  • Add ShadowMediaExtractor. #6592
  • Converting onVsync calls from ReflectionHelpers to use @direct with reflector(...) instead. #6602
  • Update ShadowDisplayEventReceiver to support S #6609
  • Converting the proxy version of directlyOn(...) to @direct with reflector(...). by @hoisie in #6610
  • Fix Robolectric camera shadows to work with newer SDK versions. #6611
  • Converting recycleUnchecked calls to use @direct with reflector(...) in place of ReflectionHelpers. #6603
  • Cleaning up unnecessary @direct annotations in DirectActivityReflector. #6616
  • Fixing the incorrect method signature in AssetManagerReflector that breaks GitHub CI. #6612
  • No longer automatically log everything in ShadowLog if stream is specified #6617
  • Support IntBuffer with copyPixelsFromBuffer #6613
  • Suppress missing /system/etc/fonts.xml log noise for SDK 27 #6618
  • Add perf stats for reflector class definition #6624
  • Use Object to replace GnssAntennaInfo.Listener at ShadowLocationManager by @utzcoz in #6623
  • Trimming the localrepository string. by @Squadella in #6653
  • Merging the the separate Reflector interfaces for Message into one main interface. #6619
  • Remove OldClassInstrumentor #6621
  • Remove unnecessary ShadowLegacyMessage.isInUse #6626
  • Converting directlyOn(...) to @direct with reflector(...) in ShadowWindow and ShadowPhoneWindow. #6625
  • Intercept calls to methods in {@link Socket} not present in the OpenJDK. #6622
  • Use bulk operations in copyPixels{to,from}Buffer #6628
  • Improve reflector caching using a regular HashMap #6629
  • Add shadow method ShadowLauncherApps#getShortcutConfigActivityList. #6631
  • Add OnPermissionChangedListener implementation to ShadowPackageManager. #6627
  • Update minSdkVersion to 14 in some integration_test manifests #6630
  • Merge InvokeDynamicClassInstrumentor into ClassInstrumentor #6632
  • Add a shadow method for PackageManager#getText which gets a String associated with package name and resource id. #6634
  • Pass through openInputStream calls for SCHEME_ANDROID_RESOURCE #6636
  • Names thread used by ShadowFileObserver to match behavior of FileObserver. #6640
  • Migrate from AnnotationValue#toString to auto-common's AnnotationValues.toString. #6638
  • Fix fidelity issue with Cursor.getBlob on a String column #6641
  • Remove InvokeDynamic perf stats #6644
  • Fix SQLiteDatabaseTest foreign key test to match Android behavior #6643
  • Add cardId support for ShadowEuiccManager. #6642
  • Add OnUidImportanceListener implementation to ShadowActivityManager and SCREEN_ON/SCREEN_OFF broadcasts to ShadowPowerManager. #6639
  • Instrument default interface methods #6645
  • Support Object array and Iterable as return type for single parameter by @utzcoz in #6696
  • Rebase PR 6265: Bounds check the correct variable. by @utzcoz in #6706
  • Remove allocation in ShadowCursorWindow.Data init by @al-broco in #6711
  • internal #6654
  • Add perfstats for ShadowSQLiteConnection #6659
  • Add support for startWatchingMode() with flags. #6661
  • Make isOpActive() public, so it can be used in tests below Android R. #6662
  • Add a sqlite test using LIKE ? ESCAPE ? #6666
  • Throw an exception if a query is performed using SQLiteDatabase.execSQL #6672
  • Add isAutoRevokeWhitelisted implementation to ShadowPackageManager. #6673
  • Add support for setting smart replies on ShadowRanking object, so getSmartRanking method can be used in tests. #6667
  • Use full class name in the SQLiteConnection shadow #6679
  • Improve NFC testability: #6587
  • Add experimental sqlite shadows derived from AOSP SQLite #6670
  • Exclude built-in config from being reloaded in Configuration registry #6680
  • Make legacy ShadowSQLiteConnection implementation methods protected #6681
  • Newly added shadow class for MediaStore is exposed to open source rebolectric library #6665
  • Update ShadowAppWidgetManager to better handle RemoteViews with multiple layouts #6677
  • Add shadow functionality for removing bonds(systemAPi) #6682
  • Add support for NetworkInfo.extraInfo to ShadowNetworkInfo #6683
  • Update default SQLite synchronous and journal modes #6687
  • Add a null check to ShadowCursorWindow.put{Blob,String} #6675
  • Add parameterized test name method to the test runner #6686
  • Add ability to uninstall app widgets to ShadowAppWidgetManager.java #6693
  • Add ShadowInetAddressUtil class #6694
  • Add @InlineMe to deprecated ShadowLooper APIs. #6689
  • Add @InlineMe to deprecated, inlineable APIs. #6455
  • Add setAnchor to ShadowAccessibilityWindowInfo #6699
  • Fix an ArrayIndexOutOfBoundsException in ByteBucketArray #6700
  • Add missing implementation for __android_log_assert #6701
  • Remove mocking from FragmentControllerTest #6703
  • Add API to retrieve Intent used to start SpeechRecognizer #6692
  • Update default SQLite synchronous mode when WAL is enabled #6690
  • Fix formatting in ShadowSQLiteConnectionsTest #6712
  • Add a SQLite mode that enables the new native Android SQLite shadows #6709
  • Use offset from BufferInfo instead of ByteBuffer for ShadowMediaMuxer#writeSampleData by @utzcoz in #6695
  • Support to open fd for uncompressed file in asset by @utzcoz in #6649
  • Update gradle wrapper to 7.2 by @utzcoz in #6738
  • Improve resetter for NfcAdapter and CardEmulation by @utzcoz in #6749
  • Remove debug print statement #6714
  • Fixes WindowInfo children not cloned in ShadowAccessibilityWindowInfo #6718
  • Clarify ShadowLooper.idle message when test fails. #6719
  • Skip ErrorProne on GitHub CI runs #6728
  • Migrate off deprecated mockito APIs #6729
  • Remove CircleCI metadata #6730
  • Fix ShadowMediaPlayer#prepare() to invoke prepared listener on handler instead of executing directly on calling thread. #6731
  • Delete ShadowBaseLooper #6733
  • Include stack trace in System.log[WE] calls. #6735
  • Implemented startForeground(int, Notification, int). #6717
  • Fix spurious CloseGuard errors in Surface and SurfaceControl #6739
  • Specify LEGACY SQLite mode for ShadowSQLiteConnectionTest #6746
  • Add CMake build for SQLite native artifacts by @hoisie in #6720
  • Deprecate ShadowSwipeRefreshLayout. by @utzcoz in #6710
  • Add CI job to check aggregateDocs by @utzcoz in #6748
  • Deprecate the supportv4 shadows as mentioned in #6185 by @alsutton in #6194
  • Rework api classification and enforcement. #6755
  • Add toString to ShadowApplication.Wrapper #6736
  • Use more conventional name for the native runtime library #6764
  • Add setWifiApConfiguration & getWifiApConfiguration to ShadowWifiManager #6763
  • Make IntentsTest work on device without browser. #6765
  • Merging HardwareRendererCompat fixes into one branch by @dmeng in #6773
  • Don't use HARDWARE bitmaps in Bitmap#createBitmap. #6766
  • Fix missing imports when building on Mac OSX. #6771
  • Update ShadowInCallService so that onCallAudioStateChanged callback is invoked when the audio route is changed. #6758
  • Reduce usage for this$0 by @utzcoz in #6760
  • Update nativeruntime CMake build to support Mac M1 by @hoisie in #6774
  • Use the display ID in the provided ActivityOptions when launching activities, instead of always using the default display. #6697
  • Add ctesque common tests to androidTest by @utzcoz in #6570
  • Create a separate task to prefetch non-instrumented SDKs by @hoisie in #6778
  • Clarify error message if the SQLite submodule is missing by @hoisie in #6786
  • Make implementation classes protected on ShadowRenderNode by @hoisie in #6818
  • Support self notification callbacks for AppOpsManager #6788
  • Add a ShadowPackageBackwardCompatibility class to handle when multiple APIs are on the classpath #6790
  • Always look for tzdata in the corresponding android-all jar instead of the classpath #6789
  • Fix NPE when calling Path.arcTo with an invalid arc #6797
  • Add support to system flags on ShadowWindow #6792
  • Synchronize BinderService.getBinder #6807
  • Add a binder service for TELEPHONY_SERVICE in ShadowServiceManager. #6808
  • Add support for Android S #6776
  • Add a test for getting and setting the global animation duration #6809
  • Add supports of addOnActiveSessionsChangedListener with 3-arguments for ShadowMediaSessionManager. #6813
  • Bump AGP to 7.1.0-beta02 by @utzcoz in #6815
  • Default to native Android SQLite on the Mac M1 #6819
  • Update ShadowRenderNodeAnimator to direct reflector #6821
  • Turn off shadowOf generation for RoleControllerManager #6822
  • Deprecate the proxy version of directlyOn #6823
  • Update ShadowApplicationPackageManager.getPackageArchiveInfo to use reflector #6825
  • Migrate supportv4 shadows from directlyOn proxy to reflector #6826
  • Ensure that ShadowAccessibilityRecord fields are preserved during AccessibilityEvent copy. #6820
  • Migrate to use platform InstrumentationRegistry for LocalActivityInvoker by @utzcoz in #6787
  • Use direct reflector for AcccessibiltyRecord.init in #6831
  • Add ShadowTimePickerDialog.getIs24HourView in #6805
  • Add libicu as a git submodule by @hoisie in #6833
  • Disable the universal library for Mac OS by @hoisie in #6845
  • Bump asm to 9.2 by @utzcoz in #6844
  • Add workflow that builds native runtime and uploads artifacts by @hoisie in #6827

New Contributors

Full Changelog: robolectric-4.6.1...robolectric-4.7