Merge "Suppress OnNameExpected lint for ComponentCaller APIs in Activity" into main
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index e1cb630..67c0190 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -1183,6 +1183,7 @@
* @see #setIntent(Intent, ComponentCaller)
*/
@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS)
+ @SuppressLint("OnNameExpected")
public @Nullable ComponentCaller getCaller() {
return mCaller;
}
@@ -1203,6 +1204,7 @@
* @see #getCaller
*/
@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS)
+ @SuppressLint("OnNameExpected")
public void setIntent(@Nullable Intent newIntent, @Nullable ComponentCaller newCaller) {
internalSetIntent(newIntent, newCaller);
}
@@ -7161,6 +7163,7 @@
* @see ComponentCaller
*/
@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS)
+ @SuppressLint("OnNameExpected")
public @NonNull ComponentCaller getInitialCaller() {
return mInitialCaller;
}
@@ -7188,10 +7191,11 @@
* @see #getCaller
*/
@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS)
+ @SuppressLint("OnNameExpected")
public @NonNull ComponentCaller getCurrentCaller() {
if (mCurrentCaller == null) {
throw new IllegalStateException("The caller is null because #getCurrentCaller should be"
- + " called within #onNewIntent method");
+ + " called within #onNewIntent or #onActivityResult methods");
}
return mCurrentCaller;
}