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

Commit 3835835a authored by Felipe Leme's avatar Felipe Leme
Browse files

Change how notifyAppearedOrDisappearedForContentCaptureIfNeeded() checks if view is visible.

It was calling isVisibleToUser(), which is expensive.

Bug: 121039624
Test: atest CtsContentCaptureServiceTestCases

Change-Id: If641a01a5a6706743caefaa5fa34114902cd2c49
parent 793f1a79
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -9028,11 +9028,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        if (session == null) return;
        if (appeared) {
            if (!isLaidOut() || !isVisibleToUser()
            if (!isLaidOut() || getVisibility() != VISIBLE
                    || (mPrivateFlags4 & PFLAG4_NOTIFIED_CONTENT_CAPTURE_APPEARED) != 0) {
                if (Log.isLoggable(CONTENT_CAPTURE_LOG_TAG, Log.VERBOSE)) {
                    Log.v(CONTENT_CAPTURE_LOG_TAG, "Ignoring 'appeared' on " + this + ": laid="
                            + isLaidOut() + ", visible=" + isVisibleToUser()
                            + isLaidOut() + ", visibleToUser=" + isVisibleToUser()
                            + ", visible=" + (getVisibility() == VISIBLE)
                            + ": alreadyNotifiedAppeared="
                            + ((mPrivateFlags4 & PFLAG4_NOTIFIED_CONTENT_CAPTURE_APPEARED) != 0));
                }