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

Commit 48949f6b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 978fb5c4 6d6c3d1a
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -74,8 +74,8 @@ final class ChildContentCaptureSession extends ContentCaptureSession {
    }
    }


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


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


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


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


        internalFlush(flushReason);
        flush(flushReason);
    }
    }


    private boolean hasStarted() {
    private boolean hasStarted() {
@@ -687,18 +687,15 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
            if (sVerbose) Log.v(TAG, "Nothing to flush");
            if (sVerbose) Log.v(TAG, "Nothing to flush");
            return;
            return;
        }
        }
        internalFlush(reason);
        flush(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)
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    @Override
    @Override
    public void internalFlush(@FlushReason int reason) {
    public void flush(@FlushReason int reason) {
        // TODO: b/380381249 renaming the internal APIs to prevent confusions between this and the
        // public API.
        runOnContentCaptureThread(() -> flushImpl(reason));
        runOnContentCaptureThread(() -> flushImpl(reason));
    }
    }


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


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


Loading