Bug P3
Status Update
Comments
jb...@google.com <jb...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 85c1de7395f07e3256a50706d4f619e654624250
Author: Ian Lake <ilake@google.com>
Date: Fri Apr 19 13:54:21 2019
Ensure Fragment OnBackPressedCallbacks take priority
As FragmentController is not yet driven by a
LifecycleObserver ( b/127528777 ), LifecycleObservers on
Fragments are not necessarily nested within
LifecycleObservers registered at the Activity level.
This can lead to cases where a Fragment is started
before the Activity's Lifecycle is started.
In the case of FragmentManager's usage of Lifecycle to
add OnBackPressedCallbacks, that nesting is critical
to ensure the ordering of callbacks. By creating a
host level Lifecycle that is exactly nested outside
the callbacks to FragmentController, we can ensure
the proper nesting in callbacks.
Test: added test passes
Change-Id: I958d2389c90dcd9d157c6c3d30dffb689ed40c62
M fragment/src/androidTest/AndroidManifest.xml
M fragment/src/androidTest/java/androidx/fragment/app/OnBackPressedCallbackTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
https://android-review.googlesource.com/948209
https://goto.google.com/android-sha1/85c1de7395f07e3256a50706d4f619e654624250
Branch: androidx-master-dev
commit 85c1de7395f07e3256a50706d4f619e654624250
Author: Ian Lake <ilake@google.com>
Date: Fri Apr 19 13:54:21 2019
Ensure Fragment OnBackPressedCallbacks take priority
As FragmentController is not yet driven by a
LifecycleObserver (
Fragments are not necessarily nested within
LifecycleObservers registered at the Activity level.
This can lead to cases where a Fragment is started
before the Activity's Lifecycle is started.
In the case of FragmentManager's usage of Lifecycle to
add OnBackPressedCallbacks, that nesting is critical
to ensure the ordering of callbacks. By creating a
host level Lifecycle that is exactly nested outside
the callbacks to FragmentController, we can ensure
the proper nesting in callbacks.
Test: added test passes
Change-Id: I958d2389c90dcd9d157c6c3d30dffb689ed40c62
M fragment/src/androidTest/AndroidManifest.xml
M fragment/src/androidTest/java/androidx/fragment/app/OnBackPressedCallbackTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
Description
Component used: Navigation Safe-Args (navigation-safe-args-gradle-plugin)
Version used: 2.7.7, 2.8.7, 2.9.0-alpha06
Devices/Android versions reproduced on: Android 10 (compileSdk 34)
Navigation with not nullable args (at least boolean) produces incorrect code (to build/generated/source/navigation-args).
SafeArgs produces getDeletingCapability method with base non-nullable type without safe casting or using default values. It's boolean in example, but the same happens for integer and other basic types. So in my case app crashes in NavDirections.onString()