Skip to content

Commit ff94345

Browse files
committed
Root
1 parent dec0c71 commit ff94345

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import com.google.firebase.ktx.Firebase
2424
import com.google.firebase.ktx.app
2525

2626
class FirebaseSessions internal constructor(firebaseApp: FirebaseApp) {
27+
28+
private val sessionGenerator = SessionGenerator(true)
29+
2730
init {
2831
val sessionInitiator = SessionInitiator(WallClock::elapsedRealtime, this::initiateSessionStart)
2932
val context = firebaseApp.applicationContext.applicationContext
@@ -40,6 +43,8 @@ class FirebaseSessions internal constructor(firebaseApp: FirebaseApp) {
4043
private fun initiateSessionStart() {
4144
// TODO(mrober): Generate a session
4245
Log.i(TAG, "Initiate session start")
46+
47+
sessionGenerator.generateNewSession()
4348
}
4449

4550
companion object {

firebase-sessions/src/test/kotlin/com/google/firebase/sessions/SessionGeneratorTest.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,12 @@ import org.junit.Test
2424
class SessionGeneratorTest {
2525
fun isValidSessionId(sessionId: String): Boolean {
2626
if (sessionId.length != 32) {
27-
// assertionFailure("Session ID isn't 32 characters long")
2827
return false
2928
}
3029
if (sessionId.contains("-")) {
31-
// assertionFailure("Session ID contains a dash")
3230
return false
3331
}
3432
if (sessionId.lowercase() != sessionId) {
35-
// assertionFailure("Session ID is not lowercase")
3633
return false
3734
}
3835
return true
@@ -100,9 +97,4 @@ class SessionGeneratorTest {
10097
// Session Index should increase
10198
assertThat(thirdSessionInfo.sessionIndex).isEqualTo(2)
10299
}
103-
104-
companion object {
105-
// private val SMALL_INTERVAL = 29.minutes // not enough time to initiate a new session
106-
// private val LARGE_INTERVAL = 31.minutes // enough to initiate another session
107-
}
108100
}

0 commit comments

Comments
 (0)