Skip to content

Commit 8489203

Browse files
committed
Merge branch 'refs/heads/main' into crashlytics-kts-customKey
# Conflicts: # firebase-crashlytics/CHANGELOG.md
2 parents e5a1077 + c00de5a commit 8489203

File tree

7 files changed

+29
-9
lines changed

7 files changed

+29
-9
lines changed

firebase-crashlytics/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Unreleased
22
* [fixed] Fixed inefficiency in the Kotlin `FirebaseCrashlytics.setCustomKeys` extension.
3+
* [fixed] Execute failure listener outside the main thread [#6535]
34

45
# 19.2.1
56
* [changed] Updated protobuf dependency to `3.25.5` to fix

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.google.firebase.analytics.connector.AnalyticsConnector;
1919
import com.google.firebase.annotations.concurrent.Background;
2020
import com.google.firebase.annotations.concurrent.Blocking;
21+
import com.google.firebase.annotations.concurrent.Lightweight;
2122
import com.google.firebase.components.Component;
2223
import com.google.firebase.components.ComponentContainer;
2324
import com.google.firebase.components.ComponentRegistrar;
@@ -42,6 +43,8 @@ public class CrashlyticsRegistrar implements ComponentRegistrar {
4243
Qualified.qualified(Background.class, ExecutorService.class);
4344
private final Qualified<ExecutorService> blockingExecutorService =
4445
Qualified.qualified(Blocking.class, ExecutorService.class);
46+
private final Qualified<ExecutorService> lightweightExecutorService =
47+
Qualified.qualified(Lightweight.class, ExecutorService.class);
4548

4649
static {
4750
// Add Crashlytics as a dependency of Sessions when this class is loaded into memory.
@@ -57,6 +60,7 @@ public List<Component<?>> getComponents() {
5760
.add(Dependency.required(FirebaseInstallationsApi.class))
5861
.add(Dependency.required(backgroundExecutorService))
5962
.add(Dependency.required(blockingExecutorService))
63+
.add(Dependency.required(lightweightExecutorService))
6064
.add(Dependency.deferred(CrashlyticsNativeComponent.class))
6165
.add(Dependency.deferred(AnalyticsConnector.class))
6266
.add(Dependency.deferred(FirebaseRemoteConfigInterop.class))
@@ -79,7 +83,8 @@ private FirebaseCrashlytics buildCrashlytics(ComponentContainer container) {
7983
container.getDeferred(AnalyticsConnector.class),
8084
container.getDeferred(FirebaseRemoteConfigInterop.class),
8185
container.get(backgroundExecutorService),
82-
container.get(blockingExecutorService));
86+
container.get(blockingExecutorService),
87+
container.get(lightweightExecutorService));
8388

8489
long duration = System.currentTimeMillis() - startTime;
8590
if (duration > 16) {

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public class FirebaseCrashlytics {
6767
@NonNull Deferred<AnalyticsConnector> analyticsConnector,
6868
@NonNull Deferred<FirebaseRemoteConfigInterop> remoteConfigInteropDeferred,
6969
ExecutorService backgroundExecutorService,
70-
ExecutorService blockingExecutorService) {
70+
ExecutorService blockingExecutorService,
71+
ExecutorService lightExecutorService) {
7172

7273
Context context = app.getApplicationContext();
7374
final String appIdentifier = context.getPackageName();
@@ -160,7 +161,8 @@ public class FirebaseCrashlytics {
160161
// Kick off actually fetching the settings.
161162
settingsController
162163
.loadSettingsData(crashlyticsWorkers)
163-
.addOnFailureListener(ex -> Logger.getLogger().e("Error fetching settings.", ex));
164+
.addOnFailureListener(
165+
lightExecutorService, ex -> Logger.getLogger().e("Error fetching settings.", ex));
164166

165167
final boolean finishCoreInBackground = core.onPreExecute(appData, settingsController);
166168

firebase-functions/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Unreleased
2+
* [fixed] Fixed HttpsCallableResult.data resolution in Kotlin
3+
4+
# 21.1.0
25
* [changed] Migrated to Kotlin
36

47
# 21.0.0

firebase-functions/api.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ package com.google.firebase.functions {
110110

111111
public final class HttpsCallableResult {
112112
method @Nullable public Object getData();
113+
field @Nullable public final Object data;
113114
}
114115

115116
public final class Serializer {

firebase-functions/src/androidTest/java/com/google/firebase/functions/ktx/CallTests.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CallTests {
6464
)
6565

6666
var function = functions.getHttpsCallable("dataTest")
67-
val actual = Tasks.await(function.call(input)).getData()
67+
val actual = Tasks.await(function.call(input)).data
6868

6969
assertThat(actual).isInstanceOf(Map::class.java)
7070
@Suppress("UNCHECKED_CAST") val map = actual as Map<String, *>
@@ -77,7 +77,7 @@ class CallTests {
7777
fun testNullDataCall() {
7878
val functions = Firebase.functions(app)
7979
var function = functions.getHttpsCallable("nullTest")
80-
val actual = Tasks.await(function.call(null)).getData()
80+
val actual = Tasks.await(function.call(null)).data
8181

8282
assertThat(actual).isNull()
8383
}
@@ -86,7 +86,7 @@ class CallTests {
8686
fun testEmptyDataCall() {
8787
val functions = Firebase.functions(app)
8888
var function = functions.getHttpsCallable("nullTest")
89-
val actual = Tasks.await(function.call()).getData()
89+
val actual = Tasks.await(function.call()).data
9090

9191
assertThat(actual).isNull()
9292
}

firebase-functions/src/main/java/com/google/firebase/functions/HttpsCallableResult.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,21 @@ package com.google.firebase.functions
1616
/** The result of calling a HttpsCallableReference function. */
1717
public class HttpsCallableResult
1818
internal constructor( // The actual result data, as generic types decoded from JSON.
19-
private val data: Any?) {
19+
/**
20+
* The data that was returned from the Callable HTTPS trigger.
21+
*
22+
* The data is in the form of native Java objects. For example, if your trigger returned an array,
23+
* this object would be a `List<Object>`. If your trigger returned a JavaScript object with keys
24+
* and values, this object would be a `Map<String, Object>`.
25+
*/
26+
@JvmField public val data: Any?
27+
) {
2028
/**
2129
* Returns the data that was returned from the Callable HTTPS trigger.
2230
*
2331
* The data is in the form of native Java objects. For example, if your trigger returned an array,
24-
* this object would be a List<Object>. If your trigger returned a JavaScript object with keys and
25-
* values, this object would be a Map<String, Object>.
32+
* this object would be a `List<Object>`. If your trigger returned a JavaScript object with keys
33+
* and values, this object would be a `Map<String, Object>`.
2634
*/
2735
public fun getData(): Any? {
2836
return data

0 commit comments

Comments
 (0)