Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0414e5b authored by Daniel Lehmann's avatar Daniel Lehmann
Browse files

Task jumping in contact details

When viewing contact details from a quick contact card, the contact
details appear in a two-pane UI, forming a sort of implicit Up
navigation. As a result, viewing contact details from another task is
in effect a task jump since the user may choose to navigate to other
contacts using the other pane of the UI.

Use the new shouldUpRecreateTask API in JB to determine whether the
trampoline from ContactDetailActivity to the two-pane People activity
should also include a task jump.

Bug:6449430

Change-Id: I90b86873a3a21022d52bb387d9adc5391c8d23ac
parent d1e50110
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -75,9 +75,18 @@ public class ContactDetailActivity extends ContactsActivity {
            Intent intent = new Intent();
            intent.setAction(originalIntent.getAction());
            intent.setDataAndType(originalIntent.getData(), originalIntent.getType());
            intent.setFlags(
                    Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_FORWARD_RESULT
                            | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);

            // If we are launched from the outside, we should create a new task, because the user
            // can freely navigate the app (this is different from phones, where only the UP button
            // kicks the user into the full app)
            if (shouldUpRecreateTask(intent)) {
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK |
                        Intent.FLAG_ACTIVITY_TASK_ON_HOME);
            } else {
                intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS |
                        Intent.FLAG_ACTIVITY_FORWARD_RESULT | Intent.FLAG_ACTIVITY_SINGLE_TOP |
                        Intent.FLAG_ACTIVITY_CLEAR_TOP);
            }

            intent.setClass(this, PeopleActivity.class);
            startActivity(intent);