Loading core/java/android/view/View.java +17 −0 Original line number Original line Diff line number Diff line Loading @@ -10199,6 +10199,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, setNotifiedContentCaptureAppeared(); setNotifiedContentCaptureAppeared(); if (ai != null) { if (ai != null) { makeParentImportantAndNotifyAppearedEventIfNeed(); ai.delayNotifyContentCaptureEvent(session, this, appeared); ai.delayNotifyContentCaptureEvent(session, this, appeared); } else { } else { if (DEBUG_CONTENT_CAPTURE) { if (DEBUG_CONTENT_CAPTURE) { Loading Loading @@ -10226,6 +10227,22 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } } } private void makeParentImportantAndNotifyAppearedEventIfNeed() { // If view sent the appeared event to Content Capture, Content Capture also // would like to receive its parents' appeared events. So checks its parents // whether the appeared event is sent or not. If not, send the appeared event. final ViewParent parent = getParent(); if (parent instanceof View) { View p = ((View) parent); if (p.getNotifiedContentCaptureAppeared()) { return; } // Set important for content capture in the cache. p.mPrivateFlags4 |= PFLAG4_CONTENT_CAPTURE_IMPORTANCE_MASK; p.notifyAppearedOrDisappearedForContentCaptureIfNeeded(/* appeared */ true); } } private void setNotifiedContentCaptureAppeared() { private void setNotifiedContentCaptureAppeared() { mPrivateFlags4 |= PFLAG4_NOTIFIED_CONTENT_CAPTURE_APPEARED; mPrivateFlags4 |= PFLAG4_NOTIFIED_CONTENT_CAPTURE_APPEARED; mPrivateFlags4 &= ~PFLAG4_NOTIFIED_CONTENT_CAPTURE_DISAPPEARED; mPrivateFlags4 &= ~PFLAG4_NOTIFIED_CONTENT_CAPTURE_DISAPPEARED; Loading
core/java/android/view/View.java +17 −0 Original line number Original line Diff line number Diff line Loading @@ -10199,6 +10199,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, setNotifiedContentCaptureAppeared(); setNotifiedContentCaptureAppeared(); if (ai != null) { if (ai != null) { makeParentImportantAndNotifyAppearedEventIfNeed(); ai.delayNotifyContentCaptureEvent(session, this, appeared); ai.delayNotifyContentCaptureEvent(session, this, appeared); } else { } else { if (DEBUG_CONTENT_CAPTURE) { if (DEBUG_CONTENT_CAPTURE) { Loading Loading @@ -10226,6 +10227,22 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } } } private void makeParentImportantAndNotifyAppearedEventIfNeed() { // If view sent the appeared event to Content Capture, Content Capture also // would like to receive its parents' appeared events. So checks its parents // whether the appeared event is sent or not. If not, send the appeared event. final ViewParent parent = getParent(); if (parent instanceof View) { View p = ((View) parent); if (p.getNotifiedContentCaptureAppeared()) { return; } // Set important for content capture in the cache. p.mPrivateFlags4 |= PFLAG4_CONTENT_CAPTURE_IMPORTANCE_MASK; p.notifyAppearedOrDisappearedForContentCaptureIfNeeded(/* appeared */ true); } } private void setNotifiedContentCaptureAppeared() { private void setNotifiedContentCaptureAppeared() { mPrivateFlags4 |= PFLAG4_NOTIFIED_CONTENT_CAPTURE_APPEARED; mPrivateFlags4 |= PFLAG4_NOTIFIED_CONTENT_CAPTURE_APPEARED; mPrivateFlags4 &= ~PFLAG4_NOTIFIED_CONTENT_CAPTURE_DISAPPEARED; mPrivateFlags4 &= ~PFLAG4_NOTIFIED_CONTENT_CAPTURE_DISAPPEARED;