Fixed log submission and added telemetry OS version.

This commit is contained in:
Koen 2023-10-23 16:31:50 +02:00
commit 70939cbac6
3 changed files with 7 additions and 6 deletions

View file

@ -64,12 +64,11 @@ class Logging {
val client = OkHttpClient() val client = OkHttpClient()
val response: Response = client.newCall(request).execute() val response: Response = client.newCall(request).execute()
if (response.isSuccessful) { return if (response.isSuccessful) {
val body = response.body?.string(); response.body?.string();
return if (body != null) Json.decodeFromString<String>(body) else null;
} else { } else {
Logger.e("Failed to submit log.") { "Failed to submit logs (${response.code}): ${response.body?.string()}" }; Logger.e("Failed to submit log.") { "Failed to submit logs (${response.code}): ${response.body?.string()}" };
return null; null;
} }
} }
} }

View file

@ -11,5 +11,6 @@ data class Telemetry(
val isUnstableBuild: Boolean, val isUnstableBuild: Boolean,
val brand: String, val brand: String,
val manufacturer: String, val manufacturer: String,
val model: String val model: String,
val sdkVersion: Int
) { } ) { }

View file

@ -39,7 +39,8 @@ class StateTelemetry {
BuildConfig.IS_UNSTABLE_BUILD, BuildConfig.IS_UNSTABLE_BUILD,
Build.BRAND, Build.BRAND,
Build.MANUFACTURER, Build.MANUFACTURER,
Build.MODEL Build.MODEL,
Build.VERSION.SDK_INT
); );
val headers = hashMapOf( val headers = hashMapOf(