AllowList fixed

This commit is contained in:
Gezim
2025-09-30 21:27:49 +03:00
parent 74612c5009
commit 90013f1e15

View File

@@ -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,