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

Commit 56fd8772 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Auto remove the embedded task from Recents" into sc-v2-dev am: 7e7f9d4d am: ccd6f2ad

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15500461

Change-Id: I95828b5f71dbed90ec337fb02d041c8271a824d7
parents 8cc6950f ccd6f2ad
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -722,7 +722,7 @@ class Task extends TaskFragment {
            } catch (RemoteException e) {
            }
        }
        if (autoRemoveFromRecents() || isVoiceSession) {
        if (autoRemoveFromRecents(oldParent.asTaskFragment()) || isVoiceSession) {
            // Task creator asked to remove this when done, or this task was a voice
            // interaction, so it should not remain on the recent tasks list.
            mTaskSupervisor.mRecentTasks.remove(this);
@@ -1577,11 +1577,12 @@ class Task extends TaskFragment {
        return count > 0;
    }

    private boolean autoRemoveFromRecents() {
    private boolean autoRemoveFromRecents(TaskFragment oldParentFragment) {
        // We will automatically remove the task either if it has explicitly asked for
        // this, or it is empty and has never contained an activity that got shown to
        // the user.
        return autoRemoveRecents || (!hasChild() && !getHasBeenVisible());
        // the user, or it was being embedded in another Task.
        return autoRemoveRecents || (!hasChild() && !getHasBeenVisible()
                || (oldParentFragment != null && oldParentFragment.isEmbedded()));
    }

    private void clearPinnedTaskIfNeed() {