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

Commit d93ed17d authored by Adam He's avatar Adam He
Browse files

Fixed event flushing to handle when mDirectServiceInterface is not ready

yet.

Fixes: 135474027
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I5bc12cd5f48138650c82b052c785a505fc8f4773
parent 5e26e1d8
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -428,14 +428,16 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
        }

        final int flushFrequencyMs;
        if (reason == FLUSH_REASON_IDLE_TIMEOUT) {
            flushFrequencyMs = mManager.mOptions.idleFlushingFrequencyMs;
        } else if (reason == FLUSH_REASON_TEXT_CHANGE_TIMEOUT) {
        if (reason == FLUSH_REASON_TEXT_CHANGE_TIMEOUT) {
            flushFrequencyMs = mManager.mOptions.textChangeFlushingFrequencyMs;
        } else {
            Log.e(TAG, "handleScheduleFlush(" + getDebugState(reason) + "): not called with a "
                    + "timeout reason.");
            return;
            if (reason != FLUSH_REASON_IDLE_TIMEOUT) {
                if (sDebug) {
                    Log.d(TAG, "handleScheduleFlush(" + getDebugState(reason) + "): not a timeout "
                            + "reason because mDirectServiceInterface is not ready yet");
                }
            }
            flushFrequencyMs = mManager.mOptions.idleFlushingFrequencyMs;
        }

        mNextFlush = System.currentTimeMillis() + flushFrequencyMs;