I have a code in place which triggers a deep link from a service running in the background. It works always that the ACTION_MANAGE_OVERLAY_PERMISSION
permission is granted. This makes sense given the exceptions exposed in the docs. The issue is that in the documentation it also states that if the app is in the recent screens stack it should be possible to open it from background:
The app has an activity in the back stack of an existing task on the Recents screen.
I’m trying with a pretty straightforward piece of code from a service:
val currentIntent = Intent(this, MainActivity::class.java).apply {
addCategory(Intent.CATEGORY_BROWSABLE)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
}
startActivity(currentIntent)
And even though the app is in the recent screen stack, it won’t open it unless the permission is granted.
Any help is appreciated.