From 2fa1c95404cd29047ead492ca3f11f1e2ff75780 Mon Sep 17 00:00:00 2001 From: Patrick Baumann Date: Tue, 28 Jan 2020 09:41:22 -0800 Subject: Adds NON_BROWSER & DEFAULT match flags This change adds two new flags for starting activities: FLAG_ACTIVITY_REQUIRE_NON_BROWSER and FLAG_ACTIVITY_REQUIRE_DEFAULT. The first will only start if the result is a non-browser result. The second will only start if the result is not the resolver activity. Bug: 148452357 Test: Builds Change-Id: I1f25bd78b6231c08036c15436bd8c2e3dccf56d6 --- core/java/android/content/Intent.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/java/android/content/Intent.java') diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 2e591ca1b4ee..acc4cb098ffb 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -6477,6 +6477,21 @@ public class Intent implements Parcelable, Cloneable { */ public static final int FLAG_ACTIVITY_MATCH_EXTERNAL = 0x00000800; + /** + * If set in an intent passed to {@link Context#startActivity Context.startActivity()}, this + * flag will only launch the intent if it resolves to a result that is not a browser. If no such + * result exists, an {@link ActivityNotFoundException} will be thrown. + */ + public static final int FLAG_ACTIVITY_REQUIRE_NON_BROWSER = 0x00000400; + + /** + * If set in an intent passed to {@link Context#startActivity Context.startActivity()}, this + * flag will only launch the intent if it resolves to a single result. If no such result exists + * or if the system chooser would otherwise be displayed, an {@link ActivityNotFoundException} + * will be thrown. + */ + public static final int FLAG_ACTIVITY_REQUIRE_DEFAULT = 0x00000200; + /** * If set, when sending a broadcast only registered receivers will be * called -- no BroadcastReceiver components will be launched. -- cgit v1.2.3