Pass Nullable to ActivityInterceptorInfo.Builder setters
ActivityInterceptorInfo.Builder setters should take nullable params
since the getters of these fields return nullable.
Bug: 267312646
Test: atest com.android.server.wm.ActivityInterceptorCallbackTest
Change-Id: I933a64665227732148cd5a995cb49c75a233cb17
diff --git a/services/api/current.txt b/services/api/current.txt
index a4deed3..e7299ef 100644
--- a/services/api/current.txt
+++ b/services/api/current.txt
@@ -299,11 +299,11 @@
public static final class ActivityInterceptorCallback.ActivityInterceptorInfo.Builder {
ctor public ActivityInterceptorCallback.ActivityInterceptorInfo.Builder(int, int, int, int, int, @NonNull android.content.Intent, @NonNull android.content.pm.ResolveInfo, @NonNull android.content.pm.ActivityInfo);
method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo build();
- method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setCallingFeatureId(@NonNull String);
- method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setCallingPackage(@NonNull String);
- method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setCheckedOptions(@NonNull android.app.ActivityOptions);
- method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setClearOptionsAnimationRunnable(@NonNull Runnable);
- method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setResolvedType(@NonNull String);
+ method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setCallingFeatureId(@Nullable String);
+ method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setCallingPackage(@Nullable String);
+ method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setCheckedOptions(@Nullable android.app.ActivityOptions);
+ method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setClearOptionsAnimationRunnable(@Nullable Runnable);
+ method @NonNull public com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptorInfo.Builder setResolvedType(@Nullable String);
}
public class ActivityInterceptorCallbackRegistry {
diff --git a/services/core/java/com/android/server/wm/ActivityInterceptorCallback.java b/services/core/java/com/android/server/wm/ActivityInterceptorCallback.java
index ff1d442..d844c6f 100644
--- a/services/core/java/com/android/server/wm/ActivityInterceptorCallback.java
+++ b/services/core/java/com/android/server/wm/ActivityInterceptorCallback.java
@@ -266,7 +266,7 @@
* @param resolvedType the resolved type.
*/
@NonNull
- public Builder setResolvedType(@NonNull String resolvedType) {
+ public Builder setResolvedType(@Nullable String resolvedType) {
mResolvedType = resolvedType;
return this;
}
@@ -276,7 +276,7 @@
* @param callingPackage the calling package.
*/
@NonNull
- public Builder setCallingPackage(@NonNull String callingPackage) {
+ public Builder setCallingPackage(@Nullable String callingPackage) {
mCallingPackage = callingPackage;
return this;
}
@@ -286,7 +286,7 @@
* @param callingFeatureId the calling feature id.
*/
@NonNull
- public Builder setCallingFeatureId(@NonNull String callingFeatureId) {
+ public Builder setCallingFeatureId(@Nullable String callingFeatureId) {
mCallingFeatureId = callingFeatureId;
return this;
}
@@ -296,7 +296,7 @@
* @param checkedOptions the {@link ActivityOptions}.
*/
@NonNull
- public Builder setCheckedOptions(@NonNull ActivityOptions checkedOptions) {
+ public Builder setCheckedOptions(@Nullable ActivityOptions checkedOptions) {
mCheckedOptions = checkedOptions;
return this;
}
@@ -306,7 +306,7 @@
* @param clearOptionsAnimationRunnable the calling package.
*/
@NonNull
- public Builder setClearOptionsAnimationRunnable(@NonNull
+ public Builder setClearOptionsAnimationRunnable(@Nullable
Runnable clearOptionsAnimationRunnable) {
mClearOptionsAnimation = clearOptionsAnimationRunnable;
return this;