Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 40fc519ba8fe0ba87ca39b9f70efefc49cd515cf
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Dec 02 16:20:26 2021
Ensure deeplink arg value can be the same as arg name
When matching deep links we specifically check if the given values in the
deep link matches the placeholder that we have in the pattern, and if it
does we provide a default value for that argument if one exists.
This check does not consider the possibility that the value is the same
as the placeholder without the brackets.
We need to ensure that we are actually replacing a placeholder before we
replace the value with anything.
RelNote: "Deeplinks will no longer ignore arguments with values that are
the same as the name of the placeholder."
Test: NavDeepLinkTest
Bug: 207389470
Change-Id: If8017489c9f36da2f20876313356f42ae8bfc208
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
https://android-review.googlesource.com/1909653
Branch: androidx-main
commit 40fc519ba8fe0ba87ca39b9f70efefc49cd515cf
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Dec 02 16:20:26 2021
Ensure deeplink arg value can be the same as arg name
When matching deep links we specifically check if the given values in the
deep link matches the placeholder that we have in the pattern, and if it
does we provide a default value for that argument if one exists.
This check does not consider the possibility that the value is the same
as the placeholder without the brackets.
We need to ensure that we are actually replacing a placeholder before we
replace the value with anything.
RelNote: "Deeplinks will no longer ignore arguments with values that are
the same as the name of the placeholder."
Test: NavDeepLinkTest
Bug: 207389470
Change-Id: If8017489c9f36da2f20876313356f42ae8bfc208
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the Navigation 2.4.0-rc01
release.
Description
Component used: Navigation
Version used: 2.4.0-beta02
Devices/Android versions reproduced on: Pixel 3 API 31 emulator, Pixel 3 physical device with Android 12
When you pass an optional value that is equal to its key name the value gets lost and the NavBackStackEntry reveives
null
(or default value if it's set). If any other value is passed everything is correct.For example when I navigate to route
secondary?param=param
the param value turns intonull
on the receiving end. I guess some internal parsing is messed up.I'm attaching a sample project showing this issue.