diff options
author | 2025-01-29 10:36:44 -0800 | |
---|---|---|
committer | 2025-01-29 10:36:44 -0800 | |
commit | d53dd53113d428d1a54ef5d13589ce66d0192711 (patch) | |
tree | 9750596a3a2d820c24bc12e36f3d601efe392df4 /nfc-non-updatable | |
parent | 9e935923649cdf29156c854c6630dd9e7d2b2cf0 (diff) |
If the passed in string toShouldAutoTransact is a string represent of a pattern filter, check it against the string representation of filter patterns.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5ad3de7b3e9ad9d2068c20d9bde356f3de40a2b4)
Merged-In: I096211b1dff14738e023d1654e24c5967a6ad60a
Change-Id: I096211b1dff14738e023d1654e24c5967a6ad60a
Diffstat (limited to 'nfc-non-updatable')
-rw-r--r-- | nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java index 93d6eb73dcae..e83b9f1afddb 100644 --- a/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java +++ b/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java @@ -572,8 +572,10 @@ public final class ApduServiceInfo implements Parcelable { if (mAutoTransact.getOrDefault(plf.toUpperCase(Locale.ROOT), false)) { return true; } - List<Pattern> patternMatches = mAutoTransactPatterns.keySet().stream() - .filter(p -> p.matcher(plf).matches()).toList(); + boolean isPattern = plf.contains("?") || plf.contains("*"); + List<Pattern> patternMatches = mAutoTransactPatterns.keySet().stream().filter( + p -> isPattern ? p.toString().equals(plf) : p.matcher(plf).matches()).toList(); + if (patternMatches == null || patternMatches.size() == 0) { return false; } |