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

Commit b7617a6e authored by Joy Babafemi's avatar Joy Babafemi
Browse files

Notify autofill manager visibility changed in dispatchDetachedFromWindow logic

Bug: 285154556
Test: atest CtsAutoFillServiceTestCases
Change-Id: I896dc8ae2b24172c5a24651321862bcacadaaa0f
parent 84f5fa0b
Loading
Loading
Loading
Loading
+22 −18
Original line number Diff line number Diff line
@@ -16212,7 +16212,27 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        if (fg != null && isVisible != fg.isVisible()) {
            fg.setVisible(isVisible, false);
        }
        notifyAutofillManagerViewVisibilityChanged(isVisible);
        if (isVisible != oldVisible) {
            if (isAccessibilityPane()) {
                notifyViewAccessibilityStateChangedIfNeeded(isVisible
                        ? AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_APPEARED
                        : AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED);
            }
            notifyAppearedOrDisappearedForContentCaptureIfNeeded(isVisible);
            if (!getSystemGestureExclusionRects().isEmpty()) {
                postUpdate(this::updateSystemGestureExclusionRects);
            }
            if (!collectPreferKeepClearRects().isEmpty()) {
                postUpdate(this::updateKeepClearRects);
            }
        }
    }
    private void notifyAutofillManagerViewVisibilityChanged(boolean isVisible) {
        if (isAutofillable()) {
            AutofillManager afm = getAutofillManager();
@@ -16236,24 +16256,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                }
            }
        }
        if (isVisible != oldVisible) {
            if (isAccessibilityPane()) {
                notifyViewAccessibilityStateChangedIfNeeded(isVisible
                        ? AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_APPEARED
                        : AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED);
            }
            notifyAppearedOrDisappearedForContentCaptureIfNeeded(isVisible);
            if (!getSystemGestureExclusionRects().isEmpty()) {
                postUpdate(this::updateSystemGestureExclusionRects);
            }
            if (!collectPreferKeepClearRects().isEmpty()) {
                postUpdate(this::updateKeepClearRects);
            }
        }
    }
    /**
@@ -22128,6 +22130,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                    // Invoking onVisibilityAggregated directly here since the subtree
                    // will also receive detached from window
                    onVisibilityAggregated(false);
                } else {
                    notifyAutofillManagerViewVisibilityChanged(false);
                }
            }
        }