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

Commit 3aa7b56c authored by Vishnu Nair's avatar Vishnu Nair Committed by android-build-merger
Browse files

Merge "[AML] Check if launched activity has changed when handling visibility changes" into qt-dev

am: cc0d8f39

Change-Id: I0db27e1d8544ce647d62e63916843bf86ce59561
parents 9f7dd342 cc0d8f39
Loading
Loading
Loading
Loading
+24 −8
Original line number Original line Diff line number Diff line
@@ -544,9 +544,26 @@ class ActivityMetricsLogger {


            // If we have an active transition that's waiting on a certain activity that will be
            // If we have an active transition that's waiting on a certain activity that will be
            // invisible now, we'll never get onWindowsDrawn, so abort the transition if necessary.
            // invisible now, we'll never get onWindowsDrawn, so abort the transition if necessary.
            if (info != null && !hasVisibleNonFinishingActivity(t)) {

                if (DEBUG_METRICS) Slog.i(TAG, "notifyVisibilityChanged to invisible"
            // We have no active transitions.
                        + " activity=" + r);
            if (info == null) {
                return;
            }

            // The notified activity whose visibility changed is no longer the launched activity.
            // We can still wait to get onWindowsDrawn.
            if (info.launchedActivity != r) {
                return;
            }

            // Check if there is any activity in the task that is visible and not finishing. If the
            // launched activity finished before it is drawn and if there is another activity in
            // the task then that activity will be draw on screen.
            if (hasVisibleNonFinishingActivity(t)) {
                return;
            }

            if (DEBUG_METRICS) Slog.i(TAG, "notifyVisibilityChanged to invisible activity=" + r);
            logAppTransitionCancel(info);
            logAppTransitionCancel(info);
            mWindowingModeTransitionInfo.remove(r.getWindowingMode());
            mWindowingModeTransitionInfo.remove(r.getWindowingMode());
            if (mWindowingModeTransitionInfo.size() == 0) {
            if (mWindowingModeTransitionInfo.size() == 0) {
@@ -554,7 +571,6 @@ class ActivityMetricsLogger {
            }
            }
        }
        }
    }
    }
    }


    /**
    /**
     * Notifies the tracker that we called immediately before we call bindApplication on the client.
     * Notifies the tracker that we called immediately before we call bindApplication on the client.