[SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
Extracted from ag/9990011 to make NetworkStatsManager sync with internal
line, given that it is missing in aosp/1198084.
Bug: 126528330
Test: Treehugger
Change-Id: I77f50326869799f51d4636cb7c6d7c97daf531e6
Merged-In: I42117ebfb640e3b0b133183e5e146860bed8471a
diff --git a/core/java/android/app/usage/NetworkStatsManager.java b/core/java/android/app/usage/NetworkStatsManager.java
index 7412970..4346d97 100644
--- a/core/java/android/app/usage/NetworkStatsManager.java
+++ b/core/java/android/app/usage/NetworkStatsManager.java
@@ -16,8 +16,6 @@
package android.app.usage;
-import static com.android.internal.util.Preconditions.checkNotNull;
-
import android.annotation.Nullable;
import android.annotation.SystemService;
import android.annotation.TestApi;
@@ -42,6 +40,8 @@
import com.android.internal.annotations.VisibleForTesting;
+import java.util.Objects;
+
/**
* Provides access to network usage history and statistics. Usage data is collected in
* discrete bins of time called 'Buckets'. See {@link NetworkStats.Bucket} for details.
@@ -418,7 +418,7 @@
/** @hide */
public void registerUsageCallback(NetworkTemplate template, int networkType,
long thresholdBytes, UsageCallback callback, @Nullable Handler handler) {
- checkNotNull(callback, "UsageCallback cannot be null");
+ Objects.requireNonNull(callback, "UsageCallback cannot be null");
final Looper looper;
if (handler == null) {