Fixed log submission and added telemetry OS version.

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

View file

@ -64,12 +64,11 @@ class Logging {
val client = OkHttpClient()
val response: Response = client.newCall(request).execute()
if (response.isSuccessful) {
val body = response.body?.string();
return if (body != null) Json.decodeFromString<String>(body) else null;
return if (response.isSuccessful) {
response.body?.string();
} else {
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 brand: 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,
Build.BRAND,
Build.MANUFACTURER,
Build.MODEL
Build.MODEL,
Build.VERSION.SDK_INT
);
val headers = hashMapOf(