Loading api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -53041,6 +53041,7 @@ package android.view.contentcapture { method @NonNull public android.view.autofill.AutofillId newAutofillId(@NonNull android.view.autofill.AutofillId, long); method @NonNull public android.view.autofill.AutofillId newAutofillId(@NonNull android.view.autofill.AutofillId, long); method @NonNull public final android.view.ViewStructure newViewStructure(@NonNull android.view.View); method @NonNull public final android.view.ViewStructure newViewStructure(@NonNull android.view.View); method @NonNull public final android.view.ViewStructure newVirtualViewStructure(@NonNull android.view.autofill.AutofillId, long); method @NonNull public final android.view.ViewStructure newVirtualViewStructure(@NonNull android.view.autofill.AutofillId, long); method public final void notifySessionLifecycle(boolean); method public final void notifyViewAppeared(@NonNull android.view.ViewStructure); method public final void notifyViewAppeared(@NonNull android.view.ViewStructure); method public final void notifyViewDisappeared(@NonNull android.view.autofill.AutofillId); method public final void notifyViewDisappeared(@NonNull android.view.autofill.AutofillId); method public final void notifyViewTextChanged(@NonNull android.view.autofill.AutofillId, @Nullable CharSequence); method public final void notifyViewTextChanged(@NonNull android.view.autofill.AutofillId, @Nullable CharSequence); core/java/android/view/contentcapture/ChildContentCaptureSession.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -88,6 +88,11 @@ final class ChildContentCaptureSession extends ContentCaptureSession { getMainCaptureSession().notifyViewTreeEvent(mId, started); getMainCaptureSession().notifyViewTreeEvent(mId, started); } } @Override public void internalNotifySessionLifecycle(boolean started) { getMainCaptureSession().notifySessionLifecycle(mId, started); } @Override @Override boolean isContentCaptureEnabled() { boolean isContentCaptureEnabled() { return getMainCaptureSession().isContentCaptureEnabled(); return getMainCaptureSession().isContentCaptureEnabled(); Loading core/java/android/view/contentcapture/ContentCaptureSession.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -438,6 +438,19 @@ public abstract class ContentCaptureSession implements AutoCloseable { /** @hide */ /** @hide */ public abstract void internalNotifyViewTreeEvent(boolean started); public abstract void internalNotifyViewTreeEvent(boolean started); /** * Notifies the Content Capture Service that a session has paused/resumed. * * @param started whether session has resumed. */ public final void notifySessionLifecycle(boolean started) { if (!isContentCaptureEnabled()) return; internalNotifySessionLifecycle(started); } abstract void internalNotifySessionLifecycle(boolean started); /** /** * Creates a {@link ViewStructure} for a "standard" view. * Creates a {@link ViewStructure} for a "standard" view. * * Loading core/java/android/view/contentcapture/MainContentCaptureSession.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -582,6 +582,11 @@ public final class MainContentCaptureSession extends ContentCaptureSession { notifyViewTreeEvent(mId, started); notifyViewTreeEvent(mId, started); } } @Override public void internalNotifySessionLifecycle(boolean started) { notifySessionLifecycle(mId, started); } @Override @Override boolean isContentCaptureEnabled() { boolean isContentCaptureEnabled() { return super.isContentCaptureEnabled() && mManager.isContentCaptureEnabled(); return super.isContentCaptureEnabled() && mManager.isContentCaptureEnabled(); Loading Loading @@ -637,10 +642,9 @@ public final class MainContentCaptureSession extends ContentCaptureSession { sendEvent(new ContentCaptureEvent(sessionId, type), FORCE_FLUSH); sendEvent(new ContentCaptureEvent(sessionId, type), FORCE_FLUSH); } } /** Public because is also used by ViewRootImpl */ void notifySessionLifecycle(int sessionId, boolean started) { public void notifySessionLifecycle(boolean started) { final int type = started ? TYPE_SESSION_RESUMED : TYPE_SESSION_PAUSED; final int type = started ? TYPE_SESSION_RESUMED : TYPE_SESSION_PAUSED; sendEvent(new ContentCaptureEvent(mId, type), FORCE_FLUSH); sendEvent(new ContentCaptureEvent(sessionId, type), FORCE_FLUSH); } } void notifyContextUpdated(int sessionId, @Nullable ContentCaptureContext context) { void notifyContextUpdated(int sessionId, @Nullable ContentCaptureContext context) { Loading core/tests/coretests/src/android/view/contentcapture/ContentCaptureSessionTest.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -161,6 +161,11 @@ public class ContentCaptureSessionTest { throw new UnsupportedOperationException("should not have been called"); throw new UnsupportedOperationException("should not have been called"); } } @Override public void internalNotifySessionLifecycle(boolean started) { throw new UnsupportedOperationException("Should not have been called"); } @Override @Override public void updateContentCaptureContext(ContentCaptureContext context) { public void updateContentCaptureContext(ContentCaptureContext context) { throw new UnsupportedOperationException("should not have been called"); throw new UnsupportedOperationException("should not have been called"); Loading Loading
api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -53041,6 +53041,7 @@ package android.view.contentcapture { method @NonNull public android.view.autofill.AutofillId newAutofillId(@NonNull android.view.autofill.AutofillId, long); method @NonNull public android.view.autofill.AutofillId newAutofillId(@NonNull android.view.autofill.AutofillId, long); method @NonNull public final android.view.ViewStructure newViewStructure(@NonNull android.view.View); method @NonNull public final android.view.ViewStructure newViewStructure(@NonNull android.view.View); method @NonNull public final android.view.ViewStructure newVirtualViewStructure(@NonNull android.view.autofill.AutofillId, long); method @NonNull public final android.view.ViewStructure newVirtualViewStructure(@NonNull android.view.autofill.AutofillId, long); method public final void notifySessionLifecycle(boolean); method public final void notifyViewAppeared(@NonNull android.view.ViewStructure); method public final void notifyViewAppeared(@NonNull android.view.ViewStructure); method public final void notifyViewDisappeared(@NonNull android.view.autofill.AutofillId); method public final void notifyViewDisappeared(@NonNull android.view.autofill.AutofillId); method public final void notifyViewTextChanged(@NonNull android.view.autofill.AutofillId, @Nullable CharSequence); method public final void notifyViewTextChanged(@NonNull android.view.autofill.AutofillId, @Nullable CharSequence);
core/java/android/view/contentcapture/ChildContentCaptureSession.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -88,6 +88,11 @@ final class ChildContentCaptureSession extends ContentCaptureSession { getMainCaptureSession().notifyViewTreeEvent(mId, started); getMainCaptureSession().notifyViewTreeEvent(mId, started); } } @Override public void internalNotifySessionLifecycle(boolean started) { getMainCaptureSession().notifySessionLifecycle(mId, started); } @Override @Override boolean isContentCaptureEnabled() { boolean isContentCaptureEnabled() { return getMainCaptureSession().isContentCaptureEnabled(); return getMainCaptureSession().isContentCaptureEnabled(); Loading
core/java/android/view/contentcapture/ContentCaptureSession.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -438,6 +438,19 @@ public abstract class ContentCaptureSession implements AutoCloseable { /** @hide */ /** @hide */ public abstract void internalNotifyViewTreeEvent(boolean started); public abstract void internalNotifyViewTreeEvent(boolean started); /** * Notifies the Content Capture Service that a session has paused/resumed. * * @param started whether session has resumed. */ public final void notifySessionLifecycle(boolean started) { if (!isContentCaptureEnabled()) return; internalNotifySessionLifecycle(started); } abstract void internalNotifySessionLifecycle(boolean started); /** /** * Creates a {@link ViewStructure} for a "standard" view. * Creates a {@link ViewStructure} for a "standard" view. * * Loading
core/java/android/view/contentcapture/MainContentCaptureSession.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -582,6 +582,11 @@ public final class MainContentCaptureSession extends ContentCaptureSession { notifyViewTreeEvent(mId, started); notifyViewTreeEvent(mId, started); } } @Override public void internalNotifySessionLifecycle(boolean started) { notifySessionLifecycle(mId, started); } @Override @Override boolean isContentCaptureEnabled() { boolean isContentCaptureEnabled() { return super.isContentCaptureEnabled() && mManager.isContentCaptureEnabled(); return super.isContentCaptureEnabled() && mManager.isContentCaptureEnabled(); Loading Loading @@ -637,10 +642,9 @@ public final class MainContentCaptureSession extends ContentCaptureSession { sendEvent(new ContentCaptureEvent(sessionId, type), FORCE_FLUSH); sendEvent(new ContentCaptureEvent(sessionId, type), FORCE_FLUSH); } } /** Public because is also used by ViewRootImpl */ void notifySessionLifecycle(int sessionId, boolean started) { public void notifySessionLifecycle(boolean started) { final int type = started ? TYPE_SESSION_RESUMED : TYPE_SESSION_PAUSED; final int type = started ? TYPE_SESSION_RESUMED : TYPE_SESSION_PAUSED; sendEvent(new ContentCaptureEvent(mId, type), FORCE_FLUSH); sendEvent(new ContentCaptureEvent(sessionId, type), FORCE_FLUSH); } } void notifyContextUpdated(int sessionId, @Nullable ContentCaptureContext context) { void notifyContextUpdated(int sessionId, @Nullable ContentCaptureContext context) { Loading
core/tests/coretests/src/android/view/contentcapture/ContentCaptureSessionTest.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -161,6 +161,11 @@ public class ContentCaptureSessionTest { throw new UnsupportedOperationException("should not have been called"); throw new UnsupportedOperationException("should not have been called"); } } @Override public void internalNotifySessionLifecycle(boolean started) { throw new UnsupportedOperationException("Should not have been called"); } @Override @Override public void updateContentCaptureContext(ContentCaptureContext context) { public void updateContentCaptureContext(ContentCaptureContext context) { throw new UnsupportedOperationException("should not have been called"); throw new UnsupportedOperationException("should not have been called"); Loading