Skip to content

Commit 990b568

Browse files
authored
Merge branch 'main' into dconeybe/dataconnect/MutableStateFlowUseUpdateInsteadOfCompareAndSet
2 parents c7b19c0 + e98dd2c commit 990b568

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.google.firebase.crashlytics.internal.send.DataTransportCrashlyticsReportSender;
3737
import com.google.firebase.crashlytics.internal.settings.SettingsProvider;
3838
import com.google.firebase.crashlytics.internal.stacktrace.StackTraceTrimmingStrategy;
39+
import java.io.BufferedInputStream;
3940
import java.io.ByteArrayOutputStream;
4041
import java.io.File;
4142
import java.io.IOException;
@@ -427,13 +428,15 @@ private static CrashlyticsReport.ApplicationExitInfo convertApplicationExitInfo(
427428
@VisibleForTesting
428429
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
429430
public static String convertInputStreamToString(InputStream inputStream) throws IOException {
430-
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
431-
byte[] bytes = new byte[DEFAULT_BUFFER_SIZE];
432-
int length;
433-
while ((length = inputStream.read(bytes)) != -1) {
434-
byteArrayOutputStream.write(bytes, 0, length);
431+
try (BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
432+
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
433+
byte[] bytes = new byte[DEFAULT_BUFFER_SIZE];
434+
int length;
435+
while ((length = bufferedInputStream.read(bytes)) != -1) {
436+
byteArrayOutputStream.write(bytes, 0, length);
437+
}
438+
return byteArrayOutputStream.toString(StandardCharsets.UTF_8.name());
435439
}
436-
return byteArrayOutputStream.toString(StandardCharsets.UTF_8.name());
437440
}
438441

439442
/** Finds the first ANR ApplicationExitInfo within the session. */

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ firebaseAppdistributionGradle = "5.1.1"
2727
firebaseCommon = "21.0.0"
2828
firebaseComponents = "18.0.0"
2929
firebaseCrashlyticsGradle = "3.0.2"
30-
glide = "4.11.0"
30+
glide = "4.16.0"
3131
googleApiClient = "1.30.9"
3232
googleServices = "4.3.15"
3333
gradleErrorpronePlugin = "3.1.0"

smoke-tests/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ android {
5454
}
5555

5656
compileOptions {
57+
coreLibraryDesugaringEnabled true
5758
sourceCompatibility 1.8
5859
targetCompatibility 1.8
5960
}
@@ -97,6 +98,9 @@ dependencies {
9798
// Common utilities (instrumentation side)
9899
androidTestImplementation "androidx.test:runner:1.4.0"
99100
androidTestImplementation libs.junit
101+
102+
// Desugaring library
103+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
100104
}
101105

102106
clean.doLast {

0 commit comments

Comments
 (0)