Status Update
Comments
do...@google.com <do...@google.com> #2
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #3
since it is already marked as deprecated, we can probably do it by now.
ap...@google.com <ap...@google.com> #4
ap...@google.com <ap...@google.com> #5
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request from
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
cl...@google.com <cl...@google.com> #6
Fixed internally and available in navigation-2.8.0-rc01
.
Note that Android Bundle is deeply integrated into the parsing of arguments by NavType and cannot be removed, hence non-instrumented tests will require robolectric in order to properly support bundles.
ap...@google.com <ap...@google.com> #7
Branch: androidx-main
commit df6f97f72af9fa61365b44af75905ddd9039bb26
Author: Clara Fok <clarafok@google.com>
Date: Tue Jun 18 10:47:42 2024
Update SavedStateHandleFactory kdoc
Clarify that android Bundles cannot be avoided at this stage and non-instrumented tests need to be run with robolectric.
Test: TH
Bug: 340966212
Relnote: "To use SavedStateHandle test factory in non-instrumented tests, robolectric is required. This is because android Bundle is necessarily integrated into the parsing of nav arguments."
Change-Id: I8047c1a2d2dff4cb2efd0452407287738f2ce157
M navigation/navigation-testing/src/main/java/androidx/navigation/testing/SavedStateHandleFactory.kt
do...@google.com <do...@google.com> #8
Thanks for doing this. Whilst this is technically an improvement, the fact remains that if you want to test a ViewModel which accepts navigation arguments you now need to introduce a dependency on Robolectric which is a fairly major blocker for many developers. Robolectric slows down tests and reduces test fidelity.
Is there no way of removing the Bundle
dependency? Or perhaps moving Bundle
into AndroidX?
pr...@google.com <pr...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-common:2.8.0-beta04
androidx.navigation:navigation-testing:2.8.0-beta04
do...@google.com <do...@google.com> #10
I created a follow up bug to track the Android dependency forcing unit->instrumented tests for ViewModels.
Description
Component used: Navigation Version used: 2.8.0-beta01 Devices/Android versions reproduced on: all
aosp/3073537 introduced a new API for creating a
SavedStateHandle
using an object for the route parameter e.g.SavedStateHandle(route = MyDestination)
.Internally, this constructor relies on
android.net.Uri
which means that you can only call it from an instrumented test, not a unit test.This is undesirable since one of the use cases for this API is to be able to unit test ViewModels by passing them a
SavedStateHandle
containing a route.Example:https://github.com/android/nowinandroid/pull/1413/files#diff-bbcd9ff3a5be72096922a84b290125441e34d8183492cd27536e343a903579a8R57