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

Commit ea8f44e7 authored by Kai Li's avatar Kai Li Committed by Android (Google) Code Review
Browse files

Merge "Rename `flush()` internal API to `internalFlush()`" into main

parents b5551f47 3c75f1c4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -74,8 +74,8 @@ final class ChildContentCaptureSession extends ContentCaptureSession {
    }

    @Override
    void flush(@FlushReason int reason) {
        mParent.flush(reason);
    void internalFlush(@FlushReason int reason) {
        mParent.internalFlush(reason);
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -663,7 +663,7 @@ public final class ContentCaptureManager {
    @UiThread
    public void flush(@FlushReason int reason) {
        if (mOptions.lite) return;
        getMainContentCaptureSession().flush(reason);
        getMainContentCaptureSession().internalFlush(reason);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ public abstract class ContentCaptureSession implements AutoCloseable {
    /**
     * Flushes the buffered events to the service.
     */
    abstract void flush(@FlushReason int reason);
    abstract void internalFlush(@FlushReason int reason);

    /**
     * Sets the {@link ContentCaptureContext} associated with the session.
+10 −7
Original line number Diff line number Diff line
@@ -375,7 +375,7 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
    void onDestroy() {
        clearAndRunOnContentCaptureThread(() -> {
            try {
                flush(FLUSH_REASON_SESSION_FINISHED);
                internalFlush(FLUSH_REASON_SESSION_FINISHED);
            } finally {
                destroySession();
            }
@@ -623,7 +623,7 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
                flushReason = forceFlush ? FLUSH_REASON_FORCE_FLUSH : FLUSH_REASON_FULL;
        }

        flush(flushReason);
        internalFlush(flushReason);
    }

    private boolean hasStarted() {
@@ -687,15 +687,18 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
            if (sVerbose) Log.v(TAG, "Nothing to flush");
            return;
        }
        flush(reason);
        internalFlush(reason);
    }

    /** @hide */
    /**
     * Internal API to flush the buffered events to the service.
     *
     * Do not confuse this with the public API {@link #flush()}.
     *
     * @hide */
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    @Override
    public void flush(@FlushReason int reason) {
        // TODO: b/380381249 renaming the internal APIs to prevent confusions between this and the
        // public API.
    public void internalFlush(@FlushReason int reason) {
        runOnContentCaptureThread(() -> flushImpl(reason));
    }

+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ public class ContentCaptureSessionTest {
        }

        @Override
        void flush(int reason) {
        void internalFlush(int reason) {
            throw new UnsupportedOperationException("should not have been called");
        }

Loading