diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-07-19 23:06:52 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-07-19 23:06:52 +0000 |
commit | 5e54310bd4c503c34441ac505b707403feea0cc6 (patch) | |
tree | 76f58dcb5e5aaf1f30a0dadee1e2791001b5ece7 | |
parent | ef3f6c2fe4048ea3e1e4b4103c5d327332281d8c (diff) | |
parent | e0b6a6ee3b816ae05e3ef65ad58ea597795c53c7 (diff) | |
download | cts-5e54310bd4c503c34441ac505b707403feea0cc6.tar.gz |
Snap for 6692658 from e0b6a6ee3b816ae05e3ef65ad58ea597795c53c7 to rvc-release
Change-Id: I53cbf558922b1e07fb965be43c66ed4597b42498
-rw-r--r-- | tests/tests/match_flags/src/android/matchflags/cts/MatchFlagTests.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/tests/match_flags/src/android/matchflags/cts/MatchFlagTests.java b/tests/tests/match_flags/src/android/matchflags/cts/MatchFlagTests.java index 74024df9377..77a00f89e00 100644 --- a/tests/tests/match_flags/src/android/matchflags/cts/MatchFlagTests.java +++ b/tests/tests/match_flags/src/android/matchflags/cts/MatchFlagTests.java @@ -52,7 +52,7 @@ public class MatchFlagTests { .addCategory(Intent.CATEGORY_BROWSABLE) .setData(Uri.parse(ONLY_BROWSER_URI)); - if (isBrowserPresent()) { + if (isBrowserPresent(true)) { startActivity(onlyBrowserIntent); } else { try { @@ -110,7 +110,7 @@ public class MatchFlagTests { .addFlags(Intent.FLAG_ACTIVITY_REQUIRE_NON_BROWSER) .addFlags(Intent.FLAG_ACTIVITY_REQUIRE_DEFAULT); - if (isBrowserPresent()) { + if (isBrowserPresent(false)) { // with non-browser, we'd expect the resolver // with require default, we'll get activity not found try { @@ -126,12 +126,14 @@ public class MatchFlagTests { } } - private static boolean isBrowserPresent() { + private static boolean isBrowserPresent(boolean includeFallback) { return InstrumentationRegistry.getInstrumentation().getTargetContext().getPackageManager() .queryIntentActivities(new Intent(Intent.ACTION_VIEW).addCategory( Intent.CATEGORY_BROWSABLE).setData(Uri.parse(ONLY_BROWSER_URI)), 0 /* flags */) - .stream().anyMatch(resolveInfo -> resolveInfo.handleAllWebDataURI); + .stream().anyMatch(resolveInfo -> + resolveInfo.handleAllWebDataURI + && (includeFallback || resolveInfo.priority >= 0)); } private static void startActivity(Intent onlyBrowserIntent) { |