Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Filling in the data
, action
, and mimeType
fields of the Intent
for any usages of NavDeepLinkRequest
makes sense to me.
al...@mercari.com <al...@mercari.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 6ac4bffb0f35827a19f761599bb642dbd98e146a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 24 12:10:03 2021
Add intent when navigating with NavDeepLinkRequest
When you navigate with a NavDeepLinkRequest, we should also fill an
intent with the data, action, and type with the values from the
NavDeepLinkRequest, and pass that intent in the arguments of the
resulting destination using KEY_DEEP_LINK_INTENT. That way, the info can
be accessed from the resulting destination.
RelNote: "When navigating using a NavDeepLinkRequest, you can now
access the uri, action, and mimetype in the resulting destination by
getting the intent from arguments via KEY_DEEP_LINK_INTENT."
Bug: 181521877
Test: Adjusted tests in NavControllerTest
Change-Id: Ide575ab7123522da7816c1b219f444173dbfab8d
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/1651033
Branch: androidx-main
commit 6ac4bffb0f35827a19f761599bb642dbd98e146a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 24 12:10:03 2021
Add intent when navigating with NavDeepLinkRequest
When you navigate with a NavDeepLinkRequest, we should also fill an
intent with the data, action, and type with the values from the
NavDeepLinkRequest, and pass that intent in the arguments of the
resulting destination using KEY_DEEP_LINK_INTENT. That way, the info can
be accessed from the resulting destination.
RelNote: "When navigating using a NavDeepLinkRequest, you can now
access the uri, action, and mimetype in the resulting destination by
getting the intent from arguments via KEY_DEEP_LINK_INTENT."
Bug: 181521877
Test: Adjusted tests in NavControllerTest
Change-Id: Ide575ab7123522da7816c1b219f444173dbfab8d
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
al...@mercari.com <al...@mercari.com> #4
This has been fixed internally and will be part of the Navigation 2.3.5
release (via 2.4.0-alpha01
).
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 20308453fed8feb34c6eafd4dc51fe0d2ba575f2
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jan 13 19:12:55 2022
Only decode deep link args once
Uri.getQueryParameter already decodes any URI arguments for us, but we
are still decoding the value when we get it from the matcher.
We should remove our decode call so we only decode once instead.
RelNote: "`NavDeepLink`s are no longer unnecessarily decode args twice,
meaning that the proper args are now passed to your final destination."
Test: NavDeepLinkTest
Bug: 210711399
Change-Id: I31b0aa2e770650f483a3f75257c57035af298d9f
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/1949864
Branch: androidx-main
commit 20308453fed8feb34c6eafd4dc51fe0d2ba575f2
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jan 13 19:12:55 2022
Only decode deep link args once
Uri.getQueryParameter already decodes any URI arguments for us, but we
are still decoding the value when we get it from the matcher.
We should remove our decode call so we only decode once instead.
RelNote: "`NavDeepLink`s are no longer unnecessarily decode args twice,
meaning that the proper args are now passed to your final destination."
Test: NavDeepLinkTest
Bug: 210711399
Change-Id: I31b0aa2e770650f483a3f75257c57035af298d9f
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> #6
This has been fixed internally and will be available in both the Navigation 2.5.0-alpha01
and 2.4.1
releases.
Description
Component used: Navigation Version used: 2.4.0-beta02
Query parameters are being decoded twice,
The first one viahttps://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt;l=181
Uri.getQueryParameter
call in:and for the second time in :https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt;l=193
This results to wrong incorrect final decoded value provided to the
SavedStateHandle
.This leads to encoded special characters such as
%
to be decoded incorrectly. For example, the raw value being%555
gets encoded correctly to%25555
, Then on the first decode it gets correctly decoded back into%555
, but due to decoding an already decoded string, the final decoded argument value becomesU5
.It is easily replicable with common use case. For example, for routes with search query like
search?query=%555
, the argument transforms intoU5
and is searched instead.