Ignore Launcher intent (was printing a warning).

This commit is contained in:
Benoit Marty 2023-12-06 17:10:39 +01:00
parent f3318078f2
commit 7a6dda041f
2 changed files with 18 additions and 0 deletions

View file

@ -34,6 +34,8 @@ class IntentResolver @Inject constructor(
private val oidcIntentResolver: OidcIntentResolver
) {
fun resolve(intent: Intent): ResolvedIntent? {
if (intent.canBeIgnored()) return null
val deepLinkData = deeplinkParser.getFromIntent(intent)
if (deepLinkData != null) return ResolvedIntent.Navigation(deepLinkData)
@ -45,3 +47,8 @@ class IntentResolver @Inject constructor(
return null
}
}
private fun Intent.canBeIgnored(): Boolean {
return action == Intent.ACTION_MAIN &&
categories?.contains(Intent.CATEGORY_LAUNCHER) == true
}