Skip to content

Commit f6e8523

Browse files
committed
Resolve comments
1 parent c7d0ca4 commit f6e8523

File tree

3 files changed

+20
-4
lines changed
  • firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/send
  • transport/transport-runtime/src/main/java/com/google/android/datatransport/runtime

3 files changed

+20
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void flushScheduledReportsIfAble() {
125125
CountDownLatch latch = new CountDownLatch(1);
126126
new Thread(
127127
() -> {
128-
ForcedSender.sendBlockingWithPriority(transport, Priority.HIGHEST);
128+
ForcedSender.sendBlocking(transport, Priority.HIGHEST);
129129
latch.countDown();
130130
})
131131
.start();

transport/transport-runtime/src/main/java/com/google/android/datatransport/runtime/ForcedSender.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package com.google.android.datatransport.runtime;
216

317
import android.annotation.SuppressLint;
@@ -11,10 +25,10 @@
1125
"TransportRuntime is not a realtime delivery system, don't use unless you absolutely must.")
1226
public final class ForcedSender {
1327
@WorkerThread
14-
public static void sendBlockingWithPriority(Transport<?> transport, Priority priority) {
28+
public static void sendBlocking(Transport<?> transport, Priority priority) {
1529
@SuppressLint("DiscouragedApi")
1630
TransportContext context = getTransportContextOrThrow(transport).withPriority(priority);
17-
TransportRuntime.getInstance().getUploader().upload(context, 1, () -> {});
31+
TransportRuntime.getInstance().getUploader().logAndUpdateState(context, 1);
1832
}
1933

2034
private static TransportContext getTransportContextOrThrow(Transport<?> transport) {
@@ -23,4 +37,6 @@ private static TransportContext getTransportContextOrThrow(Transport<?> transpor
2337
}
2438
throw new IllegalArgumentException("Expected instance of TransportImpl.");
2539
}
40+
41+
private ForcedSender() {}
2642
}

transport/transport-runtime/src/main/java/com/google/android/datatransport/runtime/scheduling/jobscheduling/Uploader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void upload(TransportContext transportContext, int attemptNumber, Runnabl
111111
});
112112
}
113113

114-
BackendResponse logAndUpdateState(TransportContext transportContext, int attemptNumber) {
114+
public BackendResponse logAndUpdateState(TransportContext transportContext, int attemptNumber) {
115115
TransportBackend backend = backendRegistry.get(transportContext.getBackendName());
116116
long maxNextRequestWaitMillis = 0;
117117

0 commit comments

Comments
 (0)