FLAG_ACTIVITY_NEW_DOCUMENT document-task matching (same URI → reuse
existing task) only works with single-intent startActivity(). When
ShortcutInfoCompat.setIntents() passes a multi-intent array, Android
internally calls startActivities(), which does not honour the document-
task model: different shortcuts end up sharing a task, and opening the
same app from chat and from a shortcut creates duplicate tasks.
Fix: replace setIntents(getWebxdcIntentWithParentStack()) with
setIntent(getWebxdcIntent()) so the shortcut fires the exact same
single intent as a direct open. The now-unused
getWebxdcIntentWithParentStack helper and TaskStackBuilder import
are removed.
- Set unique data URI (webxdc://accountId/msgId) on every WebxdcActivity
intent so FLAG_ACTIVITY_NEW_DOCUMENT can identify the document uniquely
- Drop FLAG_ACTIVITY_MULTIPLE_TASK: same URI → existing task brought to
front instead of spawning a duplicate
- Apply FLAG_ACTIVITY_NEW_DOCUMENT to shortcuts too (was openInSeparateTask=false),
so each distinct shortcut (different app) opens in its own task
- Remove the now-unnecessary openInSeparateTask parameter
Reset inLoadChatlist only right before exit
in loadChatlistAsync().
Otherwise if loadChatlistAsync() is called
while the loop is running loadChatlist() or Util.sleep(100),
loadChatlistAsync() will see inLoadChatlist=false,
set needsAnotherLoad=true and start a second loop.
This way it is possible to spawn any number of background loops
running loadChatlist() simultaneously
so no debouncing actually happened.
Debouncing in SearchViewModel.updateQuery()
is fixed similarly by copying the code structure from loadChatlistAsync().
Previously it did not even have the lock.