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 4343import com .google .firebase .crashlytics .internal .persistence .FileStore ;
4444import com .google .firebase .crashlytics .internal .settings .Settings ;
4545import com .google .firebase .crashlytics .internal .settings .SettingsProvider ;
46+ import com .google .firebase .sessions .api .CrashEventReceiver ;
4647import java .io .ByteArrayOutputStream ;
4748import java .io .File ;
4849import java .io .FilenameFilter ;
@@ -189,6 +190,11 @@ synchronized void handleUncaughtException(
189190 Logger .getLogger ()
190191 .d ("Handling uncaught " + "exception \" " + ex + "\" from thread " + thread .getName ());
191192
193+ // Notify the Firebase Sessions SDK that a fatal crash has occurred.
194+ if (!isOnDemand ) {
195+ CrashEventReceiver .notifyCrashOccurred ();
196+ }
197+
192198 // Capture the time that the crash occurs and close over it so that the time doesn't
193199 // reflect when we get around to executing the task later.
194200 final long timestampMillis = System .currentTimeMillis ();
Original file line number Diff line number Diff line change 11# Unreleased
2-
2+ * [ changed ] Added internal api for Crashlytics to notify Sessions of crash events
33
44# 2.1.1
55* [ unchanged] Updated to keep SDK versions aligned.
Original file line number Diff line number Diff line change 11// Signature format: 3.0
22package com.google.firebase.sessions.api {
33
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+
49 public final class FirebaseSessionsDependencies {
510 method public static void addDependency(com.google.firebase.sessions.api.SessionSubscriber.Name subscriberName);
611 method public static void register(com.google.firebase.sessions.api.SessionSubscriber subscriber);
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- version =2.1.3
15+ version =2.2.0
1616latestReleasedVersion =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