summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Maryam Dehaini <mdehaini@google.com> 2024-12-06 00:06:42 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-12-06 00:06:42 +0000
commite1006da77ee8f2715e5db5f26a74f637fedceeba (patch)
tree04923c7bb6ebdd40489f6e11a8fd64c07a316ddf
parentd8c915c0c27747d046c13f8f68a26b55c60e4f64 (diff)
parentd0bb83e501ffb1d4534916c0e434026048ce697b (diff)
Merge "Updating Activity#requestOpenInBrowserEducation javadoc" into main
-rw-r--r--core/java/android/app/Activity.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 38aea64386a0..03ef669c0675 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -1279,7 +1279,24 @@ public class Activity extends ContextThemeWrapper
*
* <p>This method should be utilized when an activity wants to nudge the user to switch
* to the web application in cases where the web may provide the user with a better
- * experience. Note that this method does not guarantee that the education will be shown.</p>
+ * experience. Note that this method does not guarantee that the education will be shown.
+ *
+ * <p>The number of times that the "Open in browser" education can be triggered by this method
+ * is limited per application, and, when shown, the education appears above the app's content.
+ * For these reasons, developers should use this method sparingly when it is least
+ * disruptive to the user to show the education and when it is optimal to switch the user to a
+ * browser session. Before requesting to show the education, developers should assert that they
+ * have set a link that can be used by the "Open in browser" feature through either
+ * {@link AssistContent#EXTRA_AUTHENTICATING_USER_WEB_URI} or
+ * {@link AssistContent#setWebUri} so that users are navigated to a relevant page if they choose
+ * to switch to the browser. If a URI is not set using either method, "Open in browser" will
+ * utilize a generic link if available which will direct users to the homepage of the site
+ * associated with the app. The generic link is provided for a limited number of applications by
+ * the system and cannot be edited by developers. If none of these options contains a valid URI,
+ * the user will not be provided with the option to switch to the browser and the education will
+ * not be shown if requested.
+ *
+ * @see android.app.assist.AssistContent#EXTRA_SESSION_TRANSFER_WEB_URI
*/
@FlaggedApi(com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_WINDOWING_APP_TO_WEB_EDUCATION)
public final void requestOpenInBrowserEducation() {