From ac35b899e2ac02f3907853a0039cec6122e59805 Mon Sep 17 00:00:00 2001 From: Krainov Gleb Date: Thu, 15 Oct 2026 17:54:24 +0000 Subject: [PATCH] refactor(avatar): log avatar decoding errors with the shared PickImage TAG decodeAvatarToFile logged with a hardcoded "PickImage" tag. The TAG constant moves from the PickImage companion to file level so the top-level function can use it too. Assisted-by: Claude-Code:claude-opus-5-5 Signed-off-by: Krainov Gleb --- app/src/main/java/com/nextcloud/talk/utils/PickImage.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/utils/PickImage.kt b/app/src/main/java/com/nextcloud/talk/utils/PickImage.kt index f86632e83f0..93c23d2a17d 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/PickImage.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/PickImage.kt @@ -45,6 +45,7 @@ import java.io.IOException import java.io.InputStream import javax.inject.Inject +private const val TAG: String = "PickImage" private const val FULL_QUALITY: Int = 100 /** @@ -69,7 +70,7 @@ internal fun decodeAvatarToFile( val bitmap = body?.use { decode(it.byteStream()) } if (bitmap == null) { val cause = if (body == null) "request returned no body" else "could not be decoded" - Log.e("PickImage", "Avatar thumbnail $cause") + Log.e(TAG, "Avatar thumbnail $cause") return null } return try { @@ -80,7 +81,7 @@ internal fun decodeAvatarToFile( if (!written) throw IOException("Bitmap.compress returned false") file } catch (e: IOException) { - Log.e("PickImage", "Error saving the avatar image", e) + Log.e(TAG, "Error saving the avatar image", e) null } } @@ -226,7 +227,6 @@ class PickImage(private val activity: ComponentActivity, private var currentUser } companion object { - private const val TAG: String = "PickImage" private const val MAX_SIZE: Int = 1024 private const val AVATAR_PATH = "photos/avatar.png" private const val CAMERA_CAPTURE_PATH = "photos/camera_capture.jpg"