From 2060275c0ed6eec3bb76d555799ed2931df18955 Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Sun, 21 Jun 2026 04:26:27 +0200 Subject: [PATCH] fix compatibility with old android releases --- .../flutter_mozilla_components/api/GeckoAddonsApiImpl.kt | 4 ++-- .../flutter_mozilla_components/api/GeckoFetchApiImpl.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoAddonsApiImpl.kt b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoAddonsApiImpl.kt index 2a9325e3..0c336081 100644 --- a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoAddonsApiImpl.kt +++ b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoAddonsApiImpl.kt @@ -489,7 +489,7 @@ class GeckoAddonsApiImpl(private val context: Context) : GeckoAddonsApi { } val responseBody = response.body.useStream { stream -> - String(stream.readAllBytes(), Charsets.UTF_8) + String(stream.readBytes(), Charsets.UTF_8) } val json = JSONObject(responseBody) val currentVersion = json.optJSONObject("current_version") ?: return null @@ -564,7 +564,7 @@ class GeckoAddonsApiImpl(private val context: Context) : GeckoAddonsApi { } val body = response.body.useStream { stream -> - String(stream.readAllBytes(), Charsets.UTF_8) + String(stream.readBytes(), Charsets.UTF_8) } val json = JSONObject(body) val results = json.optJSONArray("results") ?: return emptyList() diff --git a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoFetchApiImpl.kt b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoFetchApiImpl.kt index e8829148..d2bf0b2c 100644 --- a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoFetchApiImpl.kt +++ b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoFetchApiImpl.kt @@ -83,7 +83,7 @@ class GeckoFetchApiImpl : GeckoFetchApi { GeckoFetchResponse( url = response.url, status = response.status.toLong(), - body = response.body.useStream { stream -> stream.readAllBytes() }, + body = response.body.useStream { stream -> stream.readBytes() }, headers = response.headers.map { it -> GeckoHeader(it.name, it.value) } ))) }