diff options
author | Adrian Roos <roosa@google.com> | 2021-01-29 12:15:00 +0100 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2021-02-01 15:04:10 +0100 |
commit | 6a6aa5e23dbcb59840c494603df2ff35f9699f76 (patch) | |
tree | 397b28ec1cbcd6c9375436e42899abdf3dcb8dd6 | |
parent | d4caba4dafb3bccd8b26342a792ed5f4286ada7d (diff) |
API: Suppress existing NullableCollections lints
Bug: 152525509
Bug: 154763999
Test: make checkapi
Change-Id: Iecd0927e6be5496b2fbd1a49396db5439257ffe4
8 files changed, 19 insertions, 4 deletions
diff --git a/core/java/android/content/AutofillOptions.java b/core/java/android/content/AutofillOptions.java index 80a7b16ee761..0581ed5cbf22 100644 --- a/core/java/android/content/AutofillOptions.java +++ b/core/java/android/content/AutofillOptions.java @@ -17,6 +17,7 @@ package android.content; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.ActivityThread; import android.os.Parcel; @@ -62,6 +63,7 @@ public final class AutofillOptions implements Parcelable { * List of allowlisted activities. */ @Nullable + @SuppressLint("NullableCollection") public ArraySet<ComponentName> whitelistedActivitiesForAugmentedAutofill; /** @@ -73,6 +75,7 @@ public final class AutofillOptions implements Parcelable { * The disabled Activities of the package. key is component name string, value is when they * will be enabled. */ + @SuppressLint("NullableCollection") @Nullable public ArrayMap<String, Long> disabledActivities; diff --git a/core/java/android/content/ContentCaptureOptions.java b/core/java/android/content/ContentCaptureOptions.java index ef49e029db13..c296bb52e73d 100644 --- a/core/java/android/content/ContentCaptureOptions.java +++ b/core/java/android/content/ContentCaptureOptions.java @@ -17,6 +17,7 @@ package android.content; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.ActivityThread; import android.os.Parcel; @@ -73,6 +74,7 @@ public final class ContentCaptureOptions implements Parcelable { * for all acitivites in the package). */ @Nullable + @SuppressLint("NullableCollection") public final ArraySet<ComponentName> whitelistedComponents; /** @@ -96,6 +98,7 @@ public final class ContentCaptureOptions implements Parcelable { */ public ContentCaptureOptions(int loggingLevel, int maxBufferSize, int idleFlushingFrequencyMs, int textChangeFlushingFrequencyMs, int logHistorySize, + @SuppressLint("NullableCollection") @Nullable ArraySet<ComponentName> whitelistedComponents) { this(/* lite= */ false, loggingLevel, maxBufferSize, idleFlushingFrequencyMs, textChangeFlushingFrequencyMs, logHistorySize, whitelistedComponents); diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 31beb6e6a565..993355ce1d87 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -4945,7 +4945,7 @@ public abstract class PackageManager { * * @hide */ - @SuppressWarnings("HiddenAbstractMethod") + @SuppressWarnings({"HiddenAbstractMethod", "NullableCollection"}) @TestApi public abstract @Nullable String[] getNamesForUids(int[] uids); diff --git a/core/java/android/view/inputmethod/InlineSuggestionInfo.java b/core/java/android/view/inputmethod/InlineSuggestionInfo.java index 1c703ecf06ca..a17c012d16ad 100644 --- a/core/java/android/view/inputmethod/InlineSuggestionInfo.java +++ b/core/java/android/view/inputmethod/InlineSuggestionInfo.java @@ -82,6 +82,7 @@ public final class InlineSuggestionInfo implements Parcelable { public static InlineSuggestionInfo newInlineSuggestionInfo( @NonNull InlinePresentationSpec presentationSpec, @NonNull @Source String source, + @SuppressLint("NullableCollection") @Nullable String[] autofillHints, @NonNull @Type String type, boolean isPinned) { return new InlineSuggestionInfo(presentationSpec, source, autofillHints, type, isPinned); } diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java index 33c69511d273..ccb74eb39642 100644 --- a/location/java/android/location/LocationManager.java +++ b/location/java/android/location/LocationManager.java @@ -1445,6 +1445,7 @@ public class LocationManager { @TestApi @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG) @Nullable + @SuppressWarnings("NullableCollection") public List<String> getProviderPackages(@NonNull String provider) { try { return mService.getProviderPackages(provider); diff --git a/packages/Connectivity/framework/src/android/net/NetworkAgent.java b/packages/Connectivity/framework/src/android/net/NetworkAgent.java index d22d82d1f4d0..27aa15d1e1e4 100644 --- a/packages/Connectivity/framework/src/android/net/NetworkAgent.java +++ b/packages/Connectivity/framework/src/android/net/NetworkAgent.java @@ -20,6 +20,7 @@ import android.annotation.IntDef; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; @@ -775,7 +776,8 @@ public abstract class NetworkAgent { * @param underlyingNetworks the new list of underlying networks. * @see {@link VpnService.Builder#setUnderlyingNetworks(Network[])} */ - public final void setUnderlyingNetworks(@Nullable List<Network> underlyingNetworks) { + public final void setUnderlyingNetworks( + @SuppressLint("NullableCollection") @Nullable List<Network> underlyingNetworks) { final ArrayList<Network> underlyingArray = (underlyingNetworks != null) ? new ArrayList<>(underlyingNetworks) : null; queueOrSendMessage(reg -> reg.sendUnderlyingNetworks(underlyingArray)); diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java index b73ef9b794e4..be5fae488d5e 100644 --- a/telecomm/java/android/telecom/ConnectionRequest.java +++ b/telecomm/java/android/telecom/ConnectionRequest.java @@ -18,6 +18,7 @@ package android.telecom; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.TestApi; import android.net.Uri; @@ -67,7 +68,8 @@ public final class ConnectionRequest implements Parcelable { * Sets the participants for the resulting {@link ConnectionRequest} * @param participants The participants to which the {@link Connection} is to connect. */ - public @NonNull Builder setParticipants(@Nullable List<Uri> participants) { + public @NonNull Builder setParticipants( + @SuppressLint("NullableCollection") @Nullable List<Uri> participants) { this.mParticipants = participants; return this; } diff --git a/telephony/java/android/telephony/ims/DelegateStateCallback.java b/telephony/java/android/telephony/ims/DelegateStateCallback.java index fb659490d546..6bf992e64480 100644 --- a/telephony/java/android/telephony/ims/DelegateStateCallback.java +++ b/telephony/java/android/telephony/ims/DelegateStateCallback.java @@ -18,6 +18,7 @@ package android.telephony.ims; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.telephony.ims.stub.SipDelegate; import android.telephony.ims.stub.SipTransportImplBase; @@ -52,7 +53,9 @@ public interface DelegateStateCallback { * implementing this feature elsewhere. If all features of this {@link SipDelegate} are * denied, this method should still be called. */ - void onCreated(@NonNull SipDelegate delegate, @Nullable Set<FeatureTagState> deniedTags); + void onCreated(@NonNull SipDelegate delegate, + @SuppressLint("NullableCollection") // TODO(b/154763999): Mark deniedTags @Nonnull + @Nullable Set<FeatureTagState> deniedTags); /** * This must be called by the ImsService after the framework calls |