Skip to content

Commit 0dd159c

Browse files
committed
Final cleanup before merging (#7112)
1 parent d0b7357 commit 0dd159c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/FirebaseSessions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ constructor(
4242
) {
4343

4444
init {
45-
Log.d(TAG, "Initializing Firebase Sessions SDK.")
45+
Log.d(TAG, "Initializing Firebase Sessions ${BuildConfig.VERSION_NAME}.")
4646
val appContext = firebaseApp.applicationContext.applicationContext
4747
if (appContext is Application) {
4848
appContext.registerActivityLifecycleCallbacks(sessionsActivityLifecycleCallbacks)

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/SessionsActivityLifecycleCallbacks.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ constructor(private val sharedSessionRepository: SharedSessionRepository) :
3838
}
3939

4040
override fun onActivityResumed(activity: Activity) {
41+
// There is a known issue in API level 34 where in some cases with a split screen, the call to
42+
// onActivityResumed can happen before the call to onActivityPaused. This is fixed in API 35+
4143
if (enabled) {
4244
sharedSessionRepository.appForeground()
4345
}

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/SharedSessionRepository.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,11 @@ constructor(
105105
Log.d(TAG, "App backgrounded, but local SessionData not initialized")
106106
return
107107
}
108-
val sessionData = localSessionData
109-
Log.d(TAG, "App backgrounded on ${processDataManager.myProcessName} - $sessionData")
108+
Log.d(TAG, "App backgrounded on ${processDataManager.myProcessName}")
110109

111110
CoroutineScope(backgroundDispatcher).launch {
112111
try {
113-
sessionDataStore.updateData {
112+
sessionDataStore.updateData { sessionData ->
114113
sessionData.copy(backgroundTime = timeProvider.currentTime())
115114
}
116115
} catch (ex: Exception) {
@@ -127,7 +126,7 @@ constructor(
127126
return
128127
}
129128
val sessionData = localSessionData
130-
Log.d(TAG, "App foregrounded on ${processDataManager.myProcessName} - $sessionData")
129+
Log.d(TAG, "App foregrounded on ${processDataManager.myProcessName}")
131130

132131
// Check if maybe the session data needs to be updated
133132
if (isSessionExpired(sessionData) || isMyProcessStale(sessionData)) {

0 commit comments

Comments
 (0)