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

Commit 5a7b2bb5 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Looking for occluding activity above" into rvc-dev am: 95ef0694 am: 93e38e21

Change-Id: I34ea4f2d72fc3a4c86d0bb5cb43baa91672efa38
parents a64cafdb 93e38e21
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -2342,8 +2342,7 @@ class ActivityStack extends Task {
        if (!newTask && isOrhasTask) {
        if (!newTask && isOrhasTask) {
            // Starting activity cannot be occluding activity, otherwise starting window could be
            // Starting activity cannot be occluding activity, otherwise starting window could be
            // remove immediately without transferring to starting activity.
            // remove immediately without transferring to starting activity.
            final ActivityRecord occludingActivity = getActivity(
            final ActivityRecord occludingActivity = getOccludingActivityAbove(r);
                    (ar) -> ar.occludesParent(), true, r);
            if (occludingActivity != null) {
            if (occludingActivity != null) {
                // Here it is!  Now, if this is not yet visible (occluded by another task) to the
                // Here it is!  Now, if this is not yet visible (occluded by another task) to the
                // user, then just add it without starting; it will get started when the user
                // user, then just add it without starting; it will get started when the user
@@ -3069,6 +3068,14 @@ class ActivityStack extends Task {
        task.setOverrideDisplayedBounds(bounds == null || bounds.isEmpty() ? null : bounds);
        task.setOverrideDisplayedBounds(bounds == null || bounds.isEmpty() ? null : bounds);
    }
    }


    /**
     * Returns the top-most activity that occludes the given one, or @{code null} if none.
     */
    @Nullable
    private ActivityRecord getOccludingActivityAbove(ActivityRecord activity) {
        return getActivity((ar) -> ar.occludesParent(), true /* traverseTopToBottom */, activity);
    }

    boolean willActivityBeVisible(IBinder token) {
    boolean willActivityBeVisible(IBinder token) {
        final ActivityRecord r = ActivityRecord.forTokenLocked(token);
        final ActivityRecord r = ActivityRecord.forTokenLocked(token);
        if (r == null) {
        if (r == null) {
@@ -3076,8 +3083,7 @@ class ActivityStack extends Task {
        }
        }


        // See if there is an occluding activity on-top of this one.
        // See if there is an occluding activity on-top of this one.
        final ActivityRecord occludingActivity = getActivity((ar) -> ar.occludesParent(), r,
        final ActivityRecord occludingActivity = getOccludingActivityAbove(r);
                false /*includeBoundary*/, true /*traverseTopToBottom*/);
        if (occludingActivity != null) return false;
        if (occludingActivity != null) return false;


        if (r.finishing) Slog.e(TAG, "willActivityBeVisible: Returning false,"
        if (r.finishing) Slog.e(TAG, "willActivityBeVisible: Returning false,"