|
17 | 17 | package com.google.firebase.sessions.settings
|
18 | 18 |
|
19 | 19 | import android.content.Context
|
| 20 | +import android.os.Build |
20 | 21 | import android.util.Log
|
21 | 22 | import androidx.datastore.preferences.preferencesDataStore
|
22 | 23 | import com.google.firebase.installations.FirebaseInstallationsApi
|
@@ -102,11 +103,11 @@ internal class RemoteSettings(
|
102 | 103 | // All the required fields are available, start making a network request.
|
103 | 104 | val options =
|
104 | 105 | mapOf(
|
105 |
| - "X-Crashlytics-Installation-ID" to installationId as String, |
106 |
| - "X-Crashlytics-Device-Model" to appInfo.deviceModel, |
107 |
| - // TODO(visum) Add OS version parameters |
108 |
| - // "X-Crashlytics-OS-Build-Version" to "", |
109 |
| - // "X-Crashlytics-OS-Display-Version" to "", |
| 106 | + "X-Crashlytics-Installation-ID" to installationId, |
| 107 | + "X-Crashlytics-Device-Model" to |
| 108 | + removeForwardSlashesIn(String.format("%s/%s", Build.MANUFACTURER, Build.MODEL)), |
| 109 | + "X-Crashlytics-OS-Build-Version" to removeForwardSlashesIn(Build.VERSION.INCREMENTAL), |
| 110 | + "X-Crashlytics-OS-Display-Version" to removeForwardSlashesIn(Build.VERSION.RELEASE), |
110 | 111 | "X-Crashlytics-API-Client-Version" to appInfo.sessionSdkVersion
|
111 | 112 | )
|
112 | 113 |
|
@@ -163,8 +164,13 @@ internal class RemoteSettings(
|
163 | 164 | )
|
164 | 165 | }
|
165 | 166 |
|
| 167 | + private fun removeForwardSlashesIn(s: String): String { |
| 168 | + return s.replace(FORWARD_SLASH_STRING.toRegex(), "") |
| 169 | + } |
| 170 | + |
166 | 171 | companion object {
|
167 | 172 | private const val SESSION_CONFIGS_NAME = "firebase_session_settings"
|
168 | 173 | private const val TAG = "SessionConfigFetcher"
|
| 174 | + private const val FORWARD_SLASH_STRING: String = "/" |
169 | 175 | }
|
170 | 176 | }
|
0 commit comments