diff options
author | Adrian Roos <roosa@google.com> | 2021-02-04 15:53:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-02-04 15:53:34 +0000 |
commit | 60f3d5cee463ca09aa969fa9ab3cd087764e71f5 (patch) | |
tree | 521c8026259b354bae25ec4c733633383f5b4942 | |
parent | 5f36d6f70a5cfeb598647757f9a16c6e6b50daa5 (diff) | |
parent | f3d73871240fff4936e16e2dad21a45a10436cb9 (diff) |
Merge changes from topic "nullablecollection"
* changes:
API: Suppress existing NullableCollections lints (TaskOrganizer)
API: Suppress existing NullableCollections lints
9 files changed, 22 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 733b0c4efa2d..04e0468fde90 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -5001,7 +5001,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/core/java/android/window/TaskOrganizer.java b/core/java/android/window/TaskOrganizer.java index 502680de9bcf..7b4fcbf16754 100644 --- a/core/java/android/window/TaskOrganizer.java +++ b/core/java/android/window/TaskOrganizer.java @@ -20,6 +20,7 @@ import android.annotation.BinderThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; +import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.ActivityManager; import android.os.RemoteException; @@ -101,6 +102,7 @@ public class TaskOrganizer extends WindowOrganizer { /** Gets direct child tasks (ordered from top-to-bottom) */ @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) @Nullable + @SuppressLint("NullableCollection") public static List<ActivityManager.RunningTaskInfo> getChildTasks( @NonNull WindowContainerToken parent, @NonNull int[] activityTypes) { try { @@ -113,6 +115,7 @@ public class TaskOrganizer extends WindowOrganizer { /** Gets all root tasks on a display (ordered from top-to-bottom) */ @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) @Nullable + @SuppressLint("NullableCollection") public static List<ActivityManager.RunningTaskInfo> getRootTasks( int displayId, @NonNull int[] activityTypes) { try { 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 |