Skip to content

Fix crashlytics copybara #5558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -220,6 +221,7 @@ public boolean onPreExecute(AppData appData, SettingsProvider settingsProvider)
}

/** Performs background initialization asynchronously on the background worker's thread. */
@CanIgnoreReturnValue
public Task<Void> doBackgroundInitializationAsync(SettingsProvider settingsProvider) {
return Utils.callTask(
crashHandlerExecutor,
Expand All @@ -232,6 +234,7 @@ public Task<Void> call() throws Exception {
}

/** Performs background initialization synchronously on the calling thread. */
@CanIgnoreReturnValue
private Task<Void> doBackgroundInitialization(SettingsProvider settingsProvider) {
// create the marker for this run
markInitializationStarted();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Integer> ARCHITECTURES_BY_NAME = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -135,6 +137,7 @@ public static <T> T awaitEvenIfOnMainThread(Task<T> task)
}

/** Invokes latch.await(timeout, unit) uninterruptibly. */
@CanIgnoreReturnValue
public static boolean awaitUninterruptibly(CountDownLatch latch, long timeout, TimeUnit unit) {
boolean interrupted = false;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,6 +39,7 @@ public synchronized List<RolloutAssignment> getRolloutAssignmentList() {
return Collections.unmodifiableList(new ArrayList<RolloutAssignment>(rolloutsState));
}

@CanIgnoreReturnValue
public synchronized boolean updateRolloutAssignmentList(List<RolloutAssignment> newMapList) {
rolloutsState.clear();
int nOverLimit = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -180,6 +182,7 @@ public List<CrashlyticsReport.Session.Event.RolloutAssignment> getRolloutsState(
* Update RolloutsState in memory and persistence. Return True if update successfully, false
* otherwise
*/
@CanIgnoreReturnValue
public boolean updateRolloutsState(List<RolloutAssignment> rolloutAssignments) {
synchronized (rolloutsState) {
if (!rolloutsState.updateRolloutAssignmentList(rolloutAssignments)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ public static RolloutsState.Builder builder() {
public abstract static class Builder {
@NonNull
public abstract RolloutsState.Builder setRolloutAssignments(
@Nullable List<RolloutAssignment> rolloutAssignments);
@NonNull List<RolloutAssignment> rolloutAssignments);

@NonNull
public abstract RolloutsState build();
Expand Down Expand Up @@ -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
Expand Down