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

Commit 5fcc6b57 authored by Hongwei Wang's avatar Hongwei Wang Committed by Automerger Merge Worker
Browse files

Merge "Deprecate ActivityRecord#mLastKnownParent" into sc-dev am: 8a9aed51

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

Change-Id: I4f05e00d99d93237a439e199cb102a3520c999a4
parents db4ec727 8a9aed51
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -587,10 +587,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A


    AnimatingActivityRegistry mAnimatingActivityRegistry;
    AnimatingActivityRegistry mAnimatingActivityRegistry;


    // Set whenever the ActivityRecord gets reparented to a Task so we can know the last known
    // parent was when the ActivityRecord is detached from the hierarchy
    private Task mLastKnownParent;

    // Set to the previous Task parent of the ActivityRecord when it is reparented to a new Task
    // Set to the previous Task parent of the ActivityRecord when it is reparented to a new Task
    // due to picture-in-picture. This gets cleared whenever this activity or the Task
    // due to picture-in-picture. This gets cleared whenever this activity or the Task
    // it references to gets removed. This should also be cleared when we move out of pip.
    // it references to gets removed. This should also be cleared when we move out of pip.
@@ -1361,7 +1357,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            if (getDisplayContent() != null) {
            if (getDisplayContent() != null) {
                getDisplayContent().mClosingApps.remove(this);
                getDisplayContent().mClosingApps.remove(this);
            }
            }
        } else if (mLastKnownParent != null && mLastKnownParent.getRootTask() != null) {
        } else if (oldTask != null && oldTask.getRootTask() != null) {
            task.getRootTask().mExitingActivities.remove(this);
            task.getRootTask().mExitingActivities.remove(this);
        }
        }
        final Task rootTask = getRootTask();
        final Task rootTask = getRootTask();
@@ -1374,8 +1370,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                ? rootTask.getAnimatingActivityRegistry()
                ? rootTask.getAnimatingActivityRegistry()
                : null;
                : null;


        mLastKnownParent = task;
        if (task == mLastParentBeforePip) {
        if (mLastKnownParent == mLastParentBeforePip) {
            // Activity's reparented back from pip, clear the links once established
            // Activity's reparented back from pip, clear the links once established
            clearLastParentBeforePip();
            clearLastParentBeforePip();
        }
        }