mirror of
https://github.com/home-assistant/android
synced 2024-07-22 10:54:12 +00:00
Only request multiple tasks for HA notification intents (#3109)
Only request multiple tasks for notification intents for HA
This commit is contained in:
parent
71bf6a76f1
commit
11e8d5a8e8
|
@ -1673,6 +1673,7 @@ class MessagingManager @Inject constructor(
|
|||
uri: String
|
||||
): PendingIntent {
|
||||
val needsPackage = uri.startsWith(APP_PREFIX) || uri.startsWith(INTENT_PREFIX)
|
||||
val otherApp = needsPackage || UrlHandler.isAbsoluteUrl(uri) || uri.startsWith(DEEP_LINK_PREFIX)
|
||||
val intent = when {
|
||||
uri.isBlank() -> {
|
||||
WebViewActivity.newInstance(context)
|
||||
|
@ -1708,8 +1709,10 @@ class MessagingManager @Inject constructor(
|
|||
intent.putExtra("fragment", NOTIFICATION_HISTORY)
|
||||
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
||||
if (!otherApp) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
||||
}
|
||||
|
||||
return PendingIntent.getActivity(
|
||||
context,
|
||||
|
|
Loading…
Reference in a new issue