Skip to content

Commit bb47179

Browse files
committed
Add new fields to Sessions
1 parent c63bc13 commit bb47179

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ internal data class ApplicationInfo(
5151
/** The SDK version of the sessions library. */
5252
val sessionSdkVersion: String,
5353

54+
/** The display version of the Android operating system. */
55+
val osDisplayVersion: String,
56+
5457
/** The logging environment for the events. */
5558
val logEnvironment: LogEnvironment,
5659

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ internal object SessionEvents {
8181
ctx.add(FieldDescriptor.of("app_id"), applicationInfo.appId)
8282
ctx.add(FieldDescriptor.of("device_model"), applicationInfo.deviceModel)
8383
ctx.add(FieldDescriptor.of("session_sdk_version"), applicationInfo.sessionSdkVersion)
84+
ctx.add(FieldDescriptor.of("os_version"), applicationInfo.osDisplayVersion)
8485
ctx.add(FieldDescriptor.of("log_environment"), applicationInfo.logEnvironment)
8586
ctx.add(FieldDescriptor.of("android_app_info"), applicationInfo.androidAppInfo)
8687
}
@@ -130,6 +131,7 @@ internal object SessionEvents {
130131
appId = firebaseApp.options.applicationId,
131132
deviceModel = Build.MODEL,
132133
sessionSdkVersion = BuildConfig.VERSION_NAME,
134+
osDisplayVersion = Build.VERSION.RELEASE,
133135
logEnvironment = LogEnvironment.LOG_ENVIRONMENT_PROD,
134136
androidAppInfo =
135137
AndroidApplicationInfo(packageName = packageName, versionName = packageInfo.versionName)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class ApplicationInfoTest {
3939
appId = FakeFirebaseApp.MOCK_APP_ID,
4040
deviceModel = Build.MODEL,
4141
sessionSdkVersion = BuildConfig.VERSION_NAME,
42+
osDisplayVersion = Build.VERSION.RELEASE,
4243
logEnvironment = LogEnvironment.LOG_ENVIRONMENT_PROD,
4344
AndroidApplicationInfo(
4445
packageName = ApplicationProvider.getApplicationContext<Context>().packageName,

0 commit comments

Comments
 (0)