Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
th...@gmail.com <th...@gmail.com> #3
il...@google.com <il...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically ( b/140759491 ).
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
https://android-review.googlesource.com/1288456
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d0c85eb6e595cfd4383ef345e97e1b8d6acd0a44
Author: Ian Lake <ilake@google.com>
Date: Thu Apr 18 10:40:16 2019
Have each Fragment register its own back pressed callback
By splitting the OnBackPressedCallback apart at
a FragmentManager level, we can ensure that the
appropriate Lifecycle is used for each callback,
allowing developers to interleave the Fragment
back stack management with their own custom
callbacks.
Test: updated PrimaryNavFragmentTest tests
BUG: 111598096
Change-Id: I22cc38794c1ee20da370f1843d667b34a9529c22
M activity/api/1.0.0-alpha07.txt
M activity/api/current.txt
M activity/src/main/java/androidx/activity/ComponentActivity.java
A activity/src/main/java/androidx/activity/OnBackPressedDispatcherOwner.java
M fragment/src/androidTest/java/androidx/fragment/app/PrimaryNavFragmentTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
https://android-review.googlesource.com/947823
https://goto.google.com/android-sha1/d0c85eb6e595cfd4383ef345e97e1b8d6acd0a44
Branch: androidx-master-dev
commit d0c85eb6e595cfd4383ef345e97e1b8d6acd0a44
Author: Ian Lake <ilake@google.com>
Date: Thu Apr 18 10:40:16 2019
Have each Fragment register its own back pressed callback
By splitting the OnBackPressedCallback apart at
a FragmentManager level, we can ensure that the
appropriate Lifecycle is used for each callback,
allowing developers to interleave the Fragment
back stack management with their own custom
callbacks.
Test: updated PrimaryNavFragmentTest tests
BUG: 111598096
Change-Id: I22cc38794c1ee20da370f1843d667b34a9529c22
M activity/api/1.0.0-alpha07.txt
M activity/api/current.txt
M activity/src/main/java/androidx/activity/ComponentActivity.java
A activity/src/main/java/androidx/activity/OnBackPressedDispatcherOwner.java
M fragment/src/androidTest/java/androidx/fragment/app/PrimaryNavFragmentTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d5a1c250e6e3471297f64e116a46d1a3a5c9db6c
Author: Ian Lake <ilake@google.com>
Date: Wed Apr 24 15:37:02 2019
Use OnBackPressedCallback in NavController
Replace the brittle OnBackStackChangedListener
with an OnBackPressedCallback registered at the
NavController level which works on all Navigators.
It also helps fix a timing issue where the state
of the FragmentNavigator isn't updated after a Fragment
is popped off the stack, leading to a mismatch in
expected actions available if the newly visible Fragment
calls navigate() in a lifecycle method.
Test: updated tests, new OnBackPressedTest
BUG: 111598096
Change-Id: Id679ea6ac9b238240649656fc0796552d6191757
M navigation/common/api/restricted_2.1.0-alpha03.txt
M navigation/common/api/restricted_current.txt
M navigation/common/src/main/java/androidx/navigation/Navigator.java
M navigation/fragment/src/androidTest/AndroidManifest.xml
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
A navigation/fragment/src/androidTest/java/androidx/navigation/fragment/OnBackPressedTest.kt
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/test/EmptyFragment.kt
A navigation/fragment/src/androidTest/java/androidx/navigation/fragment/test/NavigationActivity.kt
A navigation/fragment/src/androidTest/res/navigation/nav_simple.xml
M navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
M navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
M navigation/runtime/api/2.1.0-alpha03.txt
M navigation/runtime/api/current.txt
M navigation/runtime/build.gradle
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
M navigation/runtime/src/main/java/androidx/navigation/NavHost.java
https://android-review.googlesource.com/951629
https://goto.google.com/android-sha1/d5a1c250e6e3471297f64e116a46d1a3a5c9db6c
Branch: androidx-master-dev
commit d5a1c250e6e3471297f64e116a46d1a3a5c9db6c
Author: Ian Lake <ilake@google.com>
Date: Wed Apr 24 15:37:02 2019
Use OnBackPressedCallback in NavController
Replace the brittle OnBackStackChangedListener
with an OnBackPressedCallback registered at the
NavController level which works on all Navigators.
It also helps fix a timing issue where the state
of the FragmentNavigator isn't updated after a Fragment
is popped off the stack, leading to a mismatch in
expected actions available if the newly visible Fragment
calls navigate() in a lifecycle method.
Test: updated tests, new OnBackPressedTest
BUG: 111598096
Change-Id: Id679ea6ac9b238240649656fc0796552d6191757
M navigation/common/api/restricted_2.1.0-alpha03.txt
M navigation/common/api/restricted_current.txt
M navigation/common/src/main/java/androidx/navigation/Navigator.java
M navigation/fragment/src/androidTest/AndroidManifest.xml
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
A navigation/fragment/src/androidTest/java/androidx/navigation/fragment/OnBackPressedTest.kt
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/test/EmptyFragment.kt
A navigation/fragment/src/androidTest/java/androidx/navigation/fragment/test/NavigationActivity.kt
A navigation/fragment/src/androidTest/res/navigation/nav_simple.xml
M navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
M navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
M navigation/runtime/api/2.1.0-alpha03.txt
M navigation/runtime/api/current.txt
M navigation/runtime/build.gradle
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
M navigation/runtime/src/main/java/androidx/navigation/NavHost.java
il...@google.com <il...@google.com> #7
NavController now offers new APIs to hook up to an OnBackPressedDispatcher: https://developer.android.com/guide/navigation/navigation-custom-back
Which allows NavController to intercept the back button before the FragmentManager, ensuring that we update our state before going through Lifecycle events and fixing this edge case.
This behavior is enabled by default if you're using NavHostFragment, but custom NavHosts can call through to this same API for their own Navigators and not try to intercept the back button themselves.
Which allows NavController to intercept the back button before the FragmentManager, ensuring that we update our state before going through Lifecycle events and fixing this edge case.
This behavior is enabled by default if you're using NavHostFragment, but custom NavHosts can call through to this same API for their own Navigators and not try to intercept the back button themselves.
il...@google.com <il...@google.com> #8
This will be available in Navigation 2.1.0-alpha03.
Description
Version used: 1.0.0-alpha03
Devices/Android versions reproduced on: All
Trying to navigate in onResume of a fragment is causing a crash if the fragment was popped to.
The attached project consists of three fragments: A, B, C.
A is the home fragment and has conditional navigation to B. The conditional navigation will be triggered when the app is started, and after fragment C has been shown.
When navigating to B from A at app start there are no issues. Going back to A, then tapping the button to navigate to C, and then going back will trigger the conditional navigation again and cause a crash.
Same problem exists in alpha02.