Fixed
Status Update
Comments
il...@google.com <il...@google.com>
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
sl...@czerwinski.info.pl <sl...@czerwinski.info.pl> #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
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit a2e68921841727237528c4ac7076d50af64663c8
Author: Ian Lake <ilake@google.com>
Date: Wed Oct 17 16:46:28 2018
Make setGraph(int) and setGraph(NavGraph) act identically
Remove the auto restore functionality from NavController's
setGraph(int) method so that it functions identically to
setGraph(NavGraph).
This ensures that developers that manually are calling
setGraph() after adding custom navigators don't get
recreated too early.
Test: updated NavController test
BUG: 110763345
Change-Id: I51ae7c74451669d6bfed0fe84df445c2ff272e6e
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/792819
https://goto.google.com/android-sha1/a2e68921841727237528c4ac7076d50af64663c8
Branch: androidx-master-dev
commit a2e68921841727237528c4ac7076d50af64663c8
Author: Ian Lake <ilake@google.com>
Date: Wed Oct 17 16:46:28 2018
Make setGraph(int) and setGraph(NavGraph) act identically
Remove the auto restore functionality from NavController's
setGraph(int) method so that it functions identically to
setGraph(NavGraph).
This ensures that developers that manually are calling
setGraph() after adding custom navigators don't get
recreated too early.
Test: updated NavController test
BUG: 110763345
Change-Id: I51ae7c74451669d6bfed0fe84df445c2ff272e6e
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
il...@google.com <il...@google.com> #6
We've decided to remove the automatic recreation that was unique to setGraph(int) - it now acts identically to setGraph(NavGraph), so the flow in #2 can be used to ensure that you have custom Navigators added before calling setGraph.
This fix will be available in 1.0.0-alpha07
This fix will be available in 1.0.0-alpha07
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit f40bad0faef05bded2d226711338e489309885ba
Author: Ian Lake <ilake@google.com>
Date: Tue Oct 23 21:03:24 2018
Ensure NavHostFragment calls setGraph on restore
If a graph is set on NavHostFragment via
NavHostFragment.create() or through
app:navGraph, it should be restored immediately
after the call to restoreState.
Test: testapp now works
BUG: 110763345
Change-Id: I7a0c656480e27a66637667519eabe61820b09a6c
M navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
https://android-review.googlesource.com/799721
https://goto.google.com/android-sha1/f40bad0faef05bded2d226711338e489309885ba
Branch: androidx-master-dev
commit f40bad0faef05bded2d226711338e489309885ba
Author: Ian Lake <ilake@google.com>
Date: Tue Oct 23 21:03:24 2018
Ensure NavHostFragment calls setGraph on restore
If a graph is set on NavHostFragment via
NavHostFragment.create() or through
app:navGraph, it should be restored immediately
after the call to restoreState.
Test: testapp now works
BUG: 110763345
Change-Id: I7a0c656480e27a66637667519eabe61820b09a6c
M navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
Description
Version used: 1.0.0-alpha02
Devices/Android versions reproduced on: Emulator API 28, Samsung J5 API 25
Sample project attached.
I'm trying to create a custom Navigator and custom NavDestination that would animate ConstraintLayout (but any custom NavDestination would cause this issue).
Intended behaviour is shown in attached video: Layout_animations.webm
However, when I rotate the screen, while the navigation is on the custom destination, the application crashes.
The crash is caused by an unknown destination, which can only be added after custom navigator.
If I add custom destination in nav_main.xml, the app will also crash, because the navigator is not yet added.
This issue could be fixed by extending NavHostFragment, but I would need to override the whole onCreate() method.
I would need to add my custom navigator right after the line:
mNavController = new NavController(context);
I can think of 2 possible solutions in the library:
1. Delegate creating of NavController, so that a custom NavController can be provided in the XML layout file.
2. Call a new protected method "NavHostFragment.onNavControllerCreated(NavController)" right after the NavController is created, that could be overridden in a custom NavHostFragment, before the graph is created.
If there is any solution to my problem that I didn't think of, please provide a more exhaustive example in the documentation:
Stack trace:
2018-06-25 10:54:28.356 14543-14543/it.czerwinski.customnavigatorexample E/AndroidRuntime: FATAL EXCEPTION: main
Process: it.czerwinski.customnavigatorexample, PID: 14543
java.lang.RuntimeException: Unable to start activity ComponentInfo{it.czerwinski.customnavigatorexample/it.czerwinski.customnavigatorexample.MainActivity}: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2925)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3060)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:4792)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4711)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:110)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class fragment
Caused by: java.lang.IllegalStateException: unknown destination during restore: it.czerwinski.customnavigatorexample:id/animatedLayoutDestination
at androidx.navigation.NavController.onGraphCreated(NavController.java:424)
at androidx.navigation.NavController.setGraph(NavController.java:386)
at androidx.navigation.NavController.restoreState(NavController.java:742)
at androidx.navigation.fragment.NavHostFragment.onCreate(NavHostFragment.java:215)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2400)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1418)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1684)
at androidx.fragment.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3772)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:120)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:395)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:377)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:780)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:467)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at it.czerwinski.customnavigatorexample.MainActivity.onCreate(MainActivity.kt:15)
at android.app.Activity.performCreate(Activity.java:7130)
at android.app.Activity.performCreate(Activity.java:7121)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1262)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2905)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3060)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:4792)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4711)
2018-06-25 10:54:28.356 14543-14543/it.czerwinski.customnavigatorexample E/AndroidRuntime: at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:110)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)