Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 1e5efa0794e826bc1b3b153796ed5659fb97fca2
Author: Ian Lake <ilake@google.com>
Date: Fri Feb 08 10:23:54 2019
Prefer exact matching deep links
Instead of only taking into account the
number of matching arguments for deep link
matching, always prefer exact matches.
Test: updated tests
BUG: 123969518
Change-Id: Ibd8ab5b6ba251991fa994ebd297bcb9ffb5851bd
M navigation/common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
M navigation/common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
M navigation/common/src/main/java/androidx/navigation/NavDeepLink.java
M navigation/common/src/main/java/androidx/navigation/NavDestination.java
https://android-review.googlesource.com/898367
https://goto.google.com/android-sha1/1e5efa0794e826bc1b3b153796ed5659fb97fca2
Branch: androidx-master-dev
commit 1e5efa0794e826bc1b3b153796ed5659fb97fca2
Author: Ian Lake <ilake@google.com>
Date: Fri Feb 08 10:23:54 2019
Prefer exact matching deep links
Instead of only taking into account the
number of matching arguments for deep link
matching, always prefer exact matches.
Test: updated tests
BUG: 123969518
Change-Id: Ibd8ab5b6ba251991fa994ebd297bcb9ffb5851bd
M navigation/common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
M navigation/common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
M navigation/common/src/main/java/androidx/navigation/NavDeepLink.java
M navigation/common/src/main/java/androidx/navigation/NavDestination.java
il...@google.com <il...@google.com> #3
This is fixed internally and will be available in Navigation 1.0.0-beta02 - we'll always prefer an exact deep match link (where exact means your deep link does not contain any .* or {param} tags)
Description
Version used: 1.0.0-beta01
Devices/Android versions reproduced on:
This is a feature request.
TL;DR: Please make exact URI matches the highest priority for deep link resolution.
Currently, the navigation library places higher priority on the deep link matches with the highest number of placeholders.
Example:
Given deep links:
* deep link 1: uri="hostname/page.html"
* deep link 2: uri="hostname/{username}"
The second deep link will match even when the uri is actually "hostname/page.html".
Ian Lake suggested (in ASG) that the following might be a further refinement of the deep link resolution algorithm: "exact matches > multiple placeholders > single placeholder > partial match". This would make it possible to resolve the URIs correctly in the above example.