summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-06-14 08:21:19 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-06-14 08:21:19 +0000
commitc4535bc7d04ddcbe850a1dcc302322bcd6115aa1 (patch)
tree29e92abfc800132935af08e85c25dd3202af75c1
parente964af097df5ad30fcd9fd3cb5ac15203057e2af (diff)
parent3b1a17a416fd6f7398a007f34c4a3fb928742cbf (diff)
Merge "Clarify documentation of getCaller, getIntent, and getInitialCaller" into main
-rw-r--r--core/java/android/app/Activity.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 807fa48117b3..c8e1e4d205dd 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -1150,6 +1150,11 @@ public class Activity extends ContextThemeWrapper
*
* <p>To keep the Intent instance for future use, call {@link #setIntent(Intent)}, and use
* this method to retrieve it.
+ *
+ * <p>Note that in {@link #onNewIntent}, this method will return the original Intent. You can
+ * use {@link #setIntent(Intent)} to update it to the new Intent.
+ *
+ * @return {@link Intent} instance that started this activity, or that was kept for future use
*/
public Intent getIntent() {
return mIntent;
@@ -1170,9 +1175,14 @@ public class Activity extends ContextThemeWrapper
}
/**
- * Returns the ComponentCaller instance of the app that launched this activity with the intent
- * from {@link #getIntent()}. To keep the value of the ComponentCaller instance for new intents,
- * call {@link #setIntent(Intent, ComponentCaller)} instead of {@link #setIntent(Intent)}.
+ * Returns the ComponentCaller instance of the app that started this activity.
+ *
+ * <p>To keep the ComponentCaller instance for future use, call
+ * {@link #setIntent(Intent, ComponentCaller)}, and use this method to retrieve it.
+ *
+ * <p>Note that in {@link #onNewIntent}, this method will return the original ComponentCaller.
+ * You can use {@link #setIntent(Intent, ComponentCaller)} to update it to the new
+ * ComponentCaller.
*
* @return {@link ComponentCaller} instance corresponding to the intent from
* {@link #getIntent()}, or {@code null} if the activity was not launched with that
@@ -7156,8 +7166,8 @@ public class Activity extends ContextThemeWrapper
/**
* Returns the ComponentCaller instance of the app that initially launched this activity.
*
- * <p>Note that calls to {@link #onNewIntent} have no effect on the returned value of this
- * method.
+ * <p>Note that calls to {@link #onNewIntent} and {@link #setIntent} have no effect on the
+ * returned value of this method.
*
* @return {@link ComponentCaller} instance
* @see ComponentCaller