Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ constructor(
) {

init {
Log.d(TAG, "Initializing Firebase Sessions SDK.")
Log.d(TAG, "Initializing Firebase Sessions ${BuildConfig.VERSION_NAME}.")
val appContext = firebaseApp.applicationContext.applicationContext
if (appContext is Application) {
appContext.registerActivityLifecycleCallbacks(sessionsActivityLifecycleCallbacks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ constructor(private val sharedSessionRepository: SharedSessionRepository) :
}

override fun onActivityResumed(activity: Activity) {
// There is a known issue in API level 34 where in some cases with a split screen, the call to
// onActivityResumed can happen before the call to onActivityPaused. This is fixed in API 35+
if (enabled) {
sharedSessionRepository.appForeground()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ constructor(
Log.d(TAG, "App backgrounded, but local SessionData not initialized")
return
}
val sessionData = localSessionData
Log.d(TAG, "App backgrounded on ${processDataManager.myProcessName} - $sessionData")
Log.d(TAG, "App backgrounded on ${processDataManager.myProcessName}")

CoroutineScope(backgroundDispatcher).launch {
try {
sessionDataStore.updateData {
sessionDataStore.updateData { sessionData ->
sessionData.copy(backgroundTime = timeProvider.currentTime())
}
} catch (ex: Exception) {
Expand All @@ -127,7 +126,7 @@ constructor(
return
}
val sessionData = localSessionData
Log.d(TAG, "App foregrounded on ${processDataManager.myProcessName} - $sessionData")
Log.d(TAG, "App foregrounded on ${processDataManager.myProcessName}")

// Check if maybe the session data needs to be updated
if (isSessionExpired(sessionData) || isMyProcessStale(sessionData)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class FirstFragment : Fragment() {
val intent = Intent(requireContext(), SecondActivity::class.java)
intent.addFlags(FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_LAUNCH_ADJACENT)
startActivity(intent)
activity?.finish()
}
binding.startSplitscreenSame.setOnClickListener {
val intent = Intent(requireContext(), MainActivity::class.java)
Expand Down