Small refactoring.

This commit is contained in:
Onuray Sahin 2022-09-22 15:28:26 +03:00
parent 8b3eaf10e1
commit ea78f504d7
1 changed files with 5 additions and 5 deletions

View File

@ -57,17 +57,17 @@ internal class UserAgentHolder @Inject constructor(
}
val appVersion = tryOrNull { pm.getPackageInfo(context.applicationContext.packageName, 0).versionName }
if (appName.isNullOrEmpty() || appVersion.isNullOrEmpty()) {
userAgent = tryOrNull { System.getProperty("http.agent") } ?: ("Java" + System.getProperty("java.version"))
return
}
val deviceManufacturer = Build.MANUFACTURER
val deviceModel = Build.MODEL
val androidVersion = Build.VERSION.RELEASE
val deviceBuildId = Build.DISPLAY
val matrixSdkVersion = BuildConfig.SDK_VERSION
if (appName.isNullOrEmpty() || appVersion.isNullOrEmpty()) {
userAgent = tryOrNull { System.getProperty("http.agent") } ?: ("Java" + System.getProperty("java.version"))
return
}
userAgent = buildString {
append(appName)
append("/")