From a64efffd08e65cba3ed134a857733b967b264cbf Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 15 Jul 2024 20:08:03 +0500 Subject: [PATCH 1/2] Updated on 2026-08-14 --- .../com/tangem/tap/common/settings/IntentSettingsManager.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/tangem/tap/common/settings/IntentSettingsManager.kt b/app/src/main/java/com/tangem/tap/common/settings/IntentSettingsManager.kt index 09305fd59e..145073e75c 100644 --- a/app/src/main/java/com/tangem/tap/common/settings/IntentSettingsManager.kt +++ b/app/src/main/java/com/tangem/tap/common/settings/IntentSettingsManager.kt @@ -2,6 +2,7 @@ package com.tangem.tap.common.settings import android.content.Context import android.content.Intent +import android.content.Intent.FLAG_ACTIVITY_NEW_TASK import android.net.Uri import android.provider.Settings import com.tangem.core.navigation.settings.SettingsManager @@ -11,7 +12,9 @@ internal class IntentSettingsManager(val context: Context) : SettingsManager { val openSettingsIntent = Intent( Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", context.packageName, null), - ) + ).apply { + flags = FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + } context.startActivity(openSettingsIntent) } } \ No newline at end of file From c84f5538bd21628708918de88ac5ceb0a70540a2 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 15 Jul 2024 20:13:14 +0500 Subject: [PATCH 2/2] Updated on 2026-08-14 --- .../java/com/tangem/data/settings/di/SettingsDataModule.kt | 4 ++-- .../presentation/wallet/viewmodels/WalletViewModel.kt | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/data/settings/src/main/java/com/tangem/data/settings/di/SettingsDataModule.kt b/data/settings/src/main/java/com/tangem/data/settings/di/SettingsDataModule.kt index da47f1f604..d1daa5b8a0 100644 --- a/data/settings/src/main/java/com/tangem/data/settings/di/SettingsDataModule.kt +++ b/data/settings/src/main/java/com/tangem/data/settings/di/SettingsDataModule.kt @@ -1,13 +1,13 @@ package com.tangem.data.settings.di import com.tangem.data.settings.DefaultAppRatingRepository -import com.tangem.data.settings.DefaultPromoSettingsRepository import com.tangem.data.settings.DefaultPermissionRepository +import com.tangem.data.settings.DefaultPromoSettingsRepository import com.tangem.data.settings.DefaultSettingsRepository import com.tangem.datasource.local.preferences.AppPreferencesStore import com.tangem.domain.settings.repositories.AppRatingRepository -import com.tangem.domain.settings.repositories.PromoSettingsRepository import com.tangem.domain.settings.repositories.PermissionRepository +import com.tangem.domain.settings.repositories.PromoSettingsRepository import com.tangem.domain.settings.repositories.SettingsRepository import dagger.Module import dagger.Provides diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt index b88fbcf1f9..e13c2f56af 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt @@ -7,8 +7,8 @@ import arrow.core.getOrElse import com.tangem.core.analytics.api.AnalyticsEventHandler import com.tangem.core.navigation.settings.SettingsManager import com.tangem.domain.balancehiding.GetBalanceHidingSettingsUseCase -import com.tangem.domain.tokens.RefreshMultiCurrencyWalletQuotesUseCase import com.tangem.domain.settings.* +import com.tangem.domain.tokens.RefreshMultiCurrencyWalletQuotesUseCase import com.tangem.domain.wallets.models.UserWalletId import com.tangem.domain.wallets.usecase.GetSelectedWalletUseCase import com.tangem.domain.wallets.usecase.GetWalletsUseCase @@ -29,6 +29,7 @@ import com.tangem.feature.wallet.presentation.wallet.utils.ScreenLifecycleProvid import com.tangem.feature.wallet.presentation.wallet.viewmodels.intents.WalletClickIntents import com.tangem.features.pushnotifications.api.featuretoggles.PushNotificationsFeatureToggles import com.tangem.features.pushnotifications.api.utils.PUSH_PERMISSION +import com.tangem.features.pushnotifications.api.utils.getPushPermissionOrNull import com.tangem.utils.Provider import com.tangem.utils.coroutines.CoroutineDispatcherProvider import com.tangem.utils.coroutines.JobHolder @@ -151,7 +152,8 @@ internal class WalletViewModel @Inject constructor( viewModelScope.launch { val isPushToggled = pushNotificationsFeatureToggles.isPushNotificationsEnabled val shouldRequestPush = shouldAskPermissionUseCase(PUSH_PERMISSION) - if (!isPushToggled || !shouldRequestPush) return@launch + val isPushPermissionAvailable = getPushPermissionOrNull() != null + if (!isPushToggled || !shouldRequestPush || !isPushPermissionAvailable) return@launch delay(timeMillis = 1_800)