diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCore.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCore.java index 494802ae676..073b621fb70 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCore.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCore.java @@ -22,6 +22,7 @@ import androidx.annotation.VisibleForTesting; import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Tasks; +import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.firebase.FirebaseApp; import com.google.firebase.crashlytics.BuildConfig; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent; @@ -220,6 +221,7 @@ public boolean onPreExecute(AppData appData, SettingsProvider settingsProvider) } /** Performs background initialization asynchronously on the background worker's thread. */ + @CanIgnoreReturnValue public Task doBackgroundInitializationAsync(SettingsProvider settingsProvider) { return Utils.callTask( crashHandlerExecutor, @@ -232,6 +234,7 @@ public Task call() throws Exception { } /** Performs background initialization synchronously on the calling thread. */ + @CanIgnoreReturnValue private Task doBackgroundInitialization(SettingsProvider settingsProvider) { // create the marker for this run markInitializationStarted(); diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsReportDataCapture.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsReportDataCapture.java index b8ad6c967de..9f79ebf7041 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsReportDataCapture.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsReportDataCapture.java @@ -46,6 +46,7 @@ * This class is responsible for capturing information from the system and exception objects, * parsing them, and returning canonical CrashlyticsReport and Event objects. */ +@SuppressWarnings("KotlinInternal") public class CrashlyticsReportDataCapture { private static final Map ARCHITECTURES_BY_NAME = new HashMap<>(); diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/Utils.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/Utils.java index 61f376a6f38..645c3fb3d95 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/Utils.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/Utils.java @@ -19,6 +19,8 @@ import com.google.android.gms.tasks.Continuation; import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.TaskCompletionSource; +import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.util.concurrent.Callable; import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; @@ -135,6 +137,7 @@ public static T awaitEvenIfOnMainThread(Task task) } /** Invokes latch.await(timeout, unit) uninterruptibly. */ + @CanIgnoreReturnValue public static boolean awaitUninterruptibly(CountDownLatch latch, long timeout, TimeUnit unit) { boolean interrupted = false; try { diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/RolloutAssignmentList.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/RolloutAssignmentList.java index 06b38c8001c..761ba1ca57f 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/RolloutAssignmentList.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/RolloutAssignmentList.java @@ -14,6 +14,7 @@ package com.google.firebase.crashlytics.internal.metadata; +import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.firebase.crashlytics.internal.Logger; import com.google.firebase.crashlytics.internal.model.CrashlyticsReport; import java.util.ArrayList; @@ -38,6 +39,7 @@ public synchronized List getRolloutAssignmentList() { return Collections.unmodifiableList(new ArrayList(rolloutsState)); } + @CanIgnoreReturnValue public synchronized boolean updateRolloutAssignmentList(List newMapList) { rolloutsState.clear(); int nOverLimit = 0; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java index 645ad0670a4..bff27633526 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java @@ -16,6 +16,8 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; + +import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.firebase.crashlytics.internal.common.CommonUtils; import com.google.firebase.crashlytics.internal.common.CrashlyticsBackgroundWorker; import com.google.firebase.crashlytics.internal.model.CrashlyticsReport; @@ -180,6 +182,7 @@ public List getRolloutsState( * Update RolloutsState in memory and persistence. Return True if update successfully, false * otherwise */ + @CanIgnoreReturnValue public boolean updateRolloutsState(List rolloutAssignments) { synchronized (rolloutsState) { if (!rolloutsState.updateRolloutAssignmentList(rolloutAssignments)) { diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/model/CrashlyticsReport.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/model/CrashlyticsReport.java index bdb98f752b0..63ab0b4e712 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/model/CrashlyticsReport.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/model/CrashlyticsReport.java @@ -1119,7 +1119,7 @@ public static RolloutsState.Builder builder() { public abstract static class Builder { @NonNull public abstract RolloutsState.Builder setRolloutAssignments( - @Nullable List rolloutAssignments); + @NonNull List rolloutAssignments); @NonNull public abstract RolloutsState build(); @@ -1215,7 +1215,7 @@ public abstract static class Builder { @NonNull public abstract Builder setLog(@NonNull Log value); - @Nullable + @NonNull public abstract Builder setRollouts(@NonNull RolloutsState rolloutsState); @NonNull