From 90013f1e15db4e36fcb1df7bd1ff386ea370d6c8 Mon Sep 17 00:00:00 2001 From: Gezim Date: Tue, 30 Sep 2025 21:27:49 +0300 Subject: [PATCH] AllowList fixed --- .../settings/NotificationSettingsFragment.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/src/main/java/com/github/gezimos/inkos/ui/settings/NotificationSettingsFragment.kt b/app/src/main/java/com/github/gezimos/inkos/ui/settings/NotificationSettingsFragment.kt index 19bd9f8..db2c38d 100644 --- a/app/src/main/java/com/github/gezimos/inkos/ui/settings/NotificationSettingsFragment.kt +++ b/app/src/main/java/com/github/gezimos/inkos/ui/settings/NotificationSettingsFragment.kt @@ -496,6 +496,26 @@ class NotificationSettingsFragment : Fragment() { !pkg.startsWith("com.inkos.internal.") && !pkg.startsWith("com.inkos.system.") } + // If caller requested hidden apps but the prefs indicate there are hidden + // apps and the current emission does not contain any of them, then + // this emission is stale (likely a pre-request cache). Wait for the + // next emission instead of showing an incomplete dialog. + try { + if (includeHidden) { + val hiddenSet = prefs.hiddenApps + if (hiddenSet.isNotEmpty()) { + // Check if any filteredApps correspond to a hidden entry + val containsHidden = filteredApps.any { item -> + val key = "${item.activityPackage}|${item.user}" + hiddenSet.contains(key) || hiddenSet.contains(item.activityPackage) + } + if (!containsHidden) { + // Skip this emission and wait for the updated list + return@observe + } + } + } + } catch (_: Exception) {} val allApps = filteredApps.map { AppInfo( label = it.customLabel.takeIf { l -> !l.isNullOrEmpty() } ?: it.activityLabel,