File tree Expand file tree Collapse file tree 5 files changed +52
-2
lines changed
firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common
src/main/kotlin/com/google/firebase/sessions/api Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 43
43
import com .google .firebase .crashlytics .internal .persistence .FileStore ;
44
44
import com .google .firebase .crashlytics .internal .settings .Settings ;
45
45
import com .google .firebase .crashlytics .internal .settings .SettingsProvider ;
46
+ import com .google .firebase .sessions .api .CrashEventReceiver ;
46
47
import java .io .ByteArrayOutputStream ;
47
48
import java .io .File ;
48
49
import java .io .FilenameFilter ;
@@ -189,6 +190,11 @@ synchronized void handleUncaughtException(
189
190
Logger .getLogger ()
190
191
.d ("Handling uncaught " + "exception \" " + ex + "\" from thread " + thread .getName ());
191
192
193
+ // Notify the Firebase Sessions SDK that a fatal crash has occurred.
194
+ if (!isOnDemand ) {
195
+ CrashEventReceiver .notifyCrashOccurred ();
196
+ }
197
+
192
198
// Capture the time that the crash occurs and close over it so that the time doesn't
193
199
// reflect when we get around to executing the task later.
194
200
final long timestampMillis = System .currentTimeMillis ();
Original file line number Diff line number Diff line change 1
1
# Unreleased
2
-
2
+ * [ changed ] Added internal api for Crashlytics to notify Sessions of crash events
3
3
4
4
# 2.1.1
5
5
* [ unchanged] Updated to keep SDK versions aligned.
Original file line number Diff line number Diff line change 1
1
// Signature format: 3.0
2
2
package com.google.firebase.sessions.api {
3
3
4
+ public final class CrashEventReceiver {
5
+ method public static void notifyCrashOccurred();
6
+ field public static final com.google.firebase.sessions.api.CrashEventReceiver INSTANCE;
7
+ }
8
+
4
9
public final class FirebaseSessionsDependencies {
5
10
method public static void addDependency(com.google.firebase.sessions.api.SessionSubscriber.Name subscriberName);
6
11
method public static void register(com.google.firebase.sessions.api.SessionSubscriber subscriber);
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- version =2.1.3
15
+ version =2.2.0
16
16
latestReleasedVersion =2.1.2
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2025 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package com.google.firebase.sessions.api
18
+
19
+ /* *
20
+ * Internal API used by Firebase Crashlytics to notify the Firebase Sessions SDK of fatal crashes.
21
+ *
22
+ * This object provides a static-like entry point that Crashlytics calls to inform Sessions a fatal
23
+ * crash has occurred.
24
+ */
25
+ object CrashEventReceiver {
26
+ /* *
27
+ * Notifies the Firebase Sessions SDK that a fatal crash has occurred.
28
+ *
29
+ * This method should be called by Firebase Crashlytics as soon as it detects a fatal crash. It
30
+ * safely processes the crash notification, treating the crash as a background event, to ensure
31
+ * that the session state is updated correctly.
32
+ *
33
+ * @see SharedSessionRepository.appBackground
34
+ */
35
+ @JvmStatic
36
+ fun notifyCrashOccurred () {
37
+ // TODO(mrober): Implement in #7039
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments