Skip to content

Fill in device_model field for AQS #4892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -16,6 +16,7 @@

package com.google.firebase.sessions

import android.os.Build
import com.google.firebase.FirebaseApp
import com.google.firebase.encoders.DataEncoder
import com.google.firebase.encoders.FieldDescriptor
Expand Down Expand Up @@ -127,7 +128,7 @@ internal object SessionEvents {

return ApplicationInfo(
appId = firebaseApp.options.applicationId,
deviceModel = "",
deviceModel = Build.MODEL,
sessionSdkVersion = BuildConfig.VERSION_NAME,
logEnvironment = LogEnvironment.LOG_ENVIRONMENT_PROD,
androidAppInfo =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.firebase.sessions

import android.content.Context
import android.os.Build
import androidx.test.core.app.ApplicationProvider
import com.google.common.truth.Truth.assertThat
import com.google.firebase.FirebaseApp
Expand All @@ -36,7 +37,7 @@ class ApplicationInfoTest {
.isEqualTo(
ApplicationInfo(
appId = FakeFirebaseApp.MOCK_APP_ID,
deviceModel = "",
deviceModel = Build.MODEL,
sessionSdkVersion = BuildConfig.VERSION_NAME,
logEnvironment = LogEnvironment.LOG_ENVIRONMENT_PROD,
AndroidApplicationInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.firebase.sessions

import android.os.Build
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.google.common.truth.Truth.assertThat
import com.google.firebase.FirebaseApp
Expand Down Expand Up @@ -68,7 +69,7 @@ class SessionEventEncoderTest {
},
"application_info":{
"app_id":"1:12345:android:app",
"device_model":"",
"device_model":"${Build.MODEL}",
"session_sdk_version":"0.1.0",
"log_environment":3,
"android_app_info":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.firebase.sessions.testing

import android.content.Context
import android.os.Build
import androidx.test.core.app.ApplicationProvider
import com.google.firebase.sessions.*

Expand Down Expand Up @@ -55,7 +56,7 @@ internal object TestSessionEventData {
applicationInfo =
ApplicationInfo(
appId = FakeFirebaseApp.MOCK_APP_ID,
deviceModel = "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the tests have access to Build.MODEL too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems they do - updated

deviceModel = Build.MODEL,
sessionSdkVersion = BuildConfig.VERSION_NAME,
logEnvironment = LogEnvironment.LOG_ENVIRONMENT_PROD,
AndroidApplicationInfo(
Expand Down