fix: open correct contact when reopening details after a call#794
Open
fluffyspace wants to merge 1 commit intoFossifyOrg:mainfrom
Open
fix: open correct contact when reopening details after a call#794fluffyspace wants to merge 1 commit intoFossifyOrg:mainfrom
fluffyspace wants to merge 1 commit intoFossifyOrg:mainfrom
Conversation
The contact details intent (ACTION_QUICK_CONTACT) was launched with only FLAG_ACTIVITY_NEW_TASK. If the system Contacts app's task was still alive from a previous view (e.g. after calling the previously-viewed contact), that task was brought forward with its old activity and the new intent was dropped. Adds FLAG_ACTIVITY_CLEAR_TASK so the receiver's task is cleared before launching the new view. Fixes FossifyOrg#783.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #783 — picking a contact from Favorites/Contacts after calling a previously-viewed contact opens that previous contact instead of the one just tapped.
Root cause
startContactDetailsIntentinActivityExt.ktlaunchesACTION_QUICK_CONTACTvia the commonslaunchActivityIntent, which adds onlyFLAG_ACTIVITY_NEW_TASK. With that flag alone, if the receiving Contacts app's task is still alive from a previous view, Android brings the existing task forward with its old activity stack. The new intent is dropped (the receiver isn'tsingleTop/singleTask), so the previously-viewed contact is shown.This is easy to miss in casual testing — pressing back from the quick-contact view finishes the activity and tears down the task, so the bug only reproduces when the previous quick-contact view is left in the background (the typical flow being: open contact → tap call → end call → return to phone app → tap a different contact).
Fix
Add
FLAG_ACTIVITY_CLEAR_TASKso the receiver's task is cleared before launching the new view. Applied to both branches (Fossify Contacts viaACTION_VIEW, system Contacts viaACTION_QUICK_CONTACT). ThelaunchViewContactIntentcall was inlined so the flag could be set beforelaunchActivityIntentaddsNEW_TASK.Test plan