Skip to content

Commit 908fad4

Browse files
committed
Resolve comments. Revert FirebaseCrashlytics api change, the plugin will call from core directly.
1 parent 3e3f1fc commit 908fad4

File tree

3 files changed

+16
-28
lines changed

3 files changed

+16
-28
lines changed

firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/FirebaseCrashlytics.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,6 @@ public void recordException(@NonNull Throwable throwable) {
201201
core.logException(throwable);
202202
}
203203

204-
/** Records a fatal report and sends to Crashlytics on-demand. */
205-
// TODO(mrober): Move this to a FirebaseCrashlyticsInternal interface.
206-
private void recordFatalException(Throwable throwable) {
207-
if (throwable == null) {
208-
Logger.getLogger().w("A null value was passed to recordFatalException. Ignoring.");
209-
return;
210-
}
211-
core.logFatalException(throwable);
212-
}
213-
214204
/**
215205
* Logs a message that's included in the next fatal, non-fatal, or ANR report.
216206
*

firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/OnDemandCounter.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,35 @@
1414

1515
package com.google.firebase.crashlytics.internal.common;
1616

17+
import java.util.concurrent.atomic.AtomicInteger;
18+
1719
/** Simple, thread-safe, class to keep count of recorded and dropped on-demand events. */
1820
public final class OnDemandCounter {
19-
private int recordedOnDemandExceptions;
20-
private int droppedOnDemandExceptions;
21+
private final AtomicInteger recordedOnDemandExceptions;
22+
private final AtomicInteger droppedOnDemandExceptions;
2123

2224
public OnDemandCounter() {
23-
recordedOnDemandExceptions = 0;
24-
droppedOnDemandExceptions = 0;
25+
recordedOnDemandExceptions = new AtomicInteger();
26+
droppedOnDemandExceptions = new AtomicInteger();
2527
}
2628

27-
public synchronized int getRecordedOnDemandExceptions() {
28-
return recordedOnDemandExceptions;
29+
public int getRecordedOnDemandExceptions() {
30+
return recordedOnDemandExceptions.get();
2931
}
3032

31-
public synchronized void incrementRecordedOnDemandExceptions() {
32-
recordedOnDemandExceptions++;
33+
public void incrementRecordedOnDemandExceptions() {
34+
recordedOnDemandExceptions.getAndIncrement();
3335
}
3436

35-
public synchronized int getDroppedOnDemandExceptions() {
36-
return droppedOnDemandExceptions;
37+
public int getDroppedOnDemandExceptions() {
38+
return droppedOnDemandExceptions.get();
3739
}
3840

39-
public synchronized void incrementDroppedOnDemandExceptions() {
40-
droppedOnDemandExceptions++;
41+
public void incrementDroppedOnDemandExceptions() {
42+
droppedOnDemandExceptions.getAndIncrement();
4143
}
4244

43-
public synchronized void resetDroppedOnDemandExceptions() {
44-
droppedOnDemandExceptions = 0;
45+
public void resetDroppedOnDemandExceptions() {
46+
droppedOnDemandExceptions.set(0);
4547
}
4648
}

firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/send/ReportQueue.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
package com.google.firebase.crashlytics.internal.send;
1616

17-
import static com.google.firebase.components.Preconditions.checkState;
18-
1917
import com.google.android.datatransport.Event;
2018
import com.google.android.datatransport.Transport;
2119
import com.google.android.gms.tasks.TaskCompletionSource;
@@ -139,8 +137,6 @@ private boolean isQueueAvailable() {
139137
}
140138

141139
private boolean isQueueFull() {
142-
// TODO(mrober): Remove this after testing.
143-
checkState(queue.size() <= queueCapacity, "Queue went over capacity. Concurrency issue?");
144140
return queue.size() == queueCapacity;
145141
}
146142

0 commit comments

Comments
 (0)