From 6d0355aeacb5cbf501da5982b6dd9f0a9a87bde9 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Mon, 16 Sep 2024 13:11:32 +0200 Subject: [PATCH 1/2] [Oztechan/CCC#3952] Increase Target SDK (#3953) Increase Target SDK --- buildSrc/src/main/kotlin/ProjectSettings.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/ProjectSettings.kt b/buildSrc/src/main/kotlin/ProjectSettings.kt index c8e508613b..dd6a6dd766 100644 --- a/buildSrc/src/main/kotlin/ProjectSettings.kt +++ b/buildSrc/src/main/kotlin/ProjectSettings.kt @@ -21,7 +21,7 @@ object ProjectSettings { const val COMPILE_SDK_VERSION = 34 const val MIN_SDK_VERSION = 21 - const val TARGET_SDK_VERSION = 33 + const val TARGET_SDK_VERSION = 34 val JAVA_VERSION = JavaVersion.VERSION_21 From 04efd016f2663faf2fe637a249c7e96bbecfa46c Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Mon, 16 Sep 2024 13:11:40 +0200 Subject: [PATCH 2/2] [Oztechan/CCC#3954] Update resolveAndStartIntent with more error prone approach (#3955) --- .../ccc/android/ui/mobile/util/IntentUtil.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/util/IntentUtil.kt b/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/util/IntentUtil.kt index 2a2e525955..c36b1b09aa 100644 --- a/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/util/IntentUtil.kt +++ b/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/util/IntentUtil.kt @@ -1,13 +1,22 @@ package com.oztechan.ccc.android.ui.mobile.util +import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent import co.touchlab.kermit.Logger +@Suppress("TooGenericExceptionCaught") fun Context.resolveAndStartIntent(intent: Intent) { - intent.resolveActivity(packageManager)?.let { - startActivity(intent) - } ?: Exception("No activity found to handle the intent: $intent").let { + try { + intent.resolveActivity(packageManager)?.let { + startActivity(intent) + null + } ?: Exception("No activity found to handle the intent: $intent") + } catch (e: ActivityNotFoundException) { + Exception("Unable to open link", e) + } catch (e: Exception) { + Exception("An error occurred", e) + }.let { Logger.e(it) { it.message.orEmpty() } } }