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

Commit 6a9f1a3e authored by Julian Odell's avatar Julian Odell Committed by Automerger Merge Worker
Browse files

Merge "Flush buffered data when session connects. Typically this data would...

Merge "Flush buffered data when session connects.    Typically this data would have been flushed at the end of the    first draw and there would otherwise be an extended delay    before the data would be sent to the service." into rvc-dev am: 4946555a am: 9754281c am: 73765588 am: c5df5c4e

Change-Id: Iaa740f6cad9d6b4cd76d1c8272d8cd8a330c5696
parents 08a43ac9 c5df5c4e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -166,6 +166,8 @@ public abstract class ContentCaptureSession implements AutoCloseable {
    public static final int FLUSH_REASON_IDLE_TIMEOUT = 5;
    /** @hide */
    public static final int FLUSH_REASON_TEXT_CHANGE_TIMEOUT = 6;
    /** @hide */
    public static final int FLUSH_REASON_SESSION_CONNECTED = 7;

    /** @hide */
    @IntDef(prefix = { "FLUSH_REASON_" }, value = {
@@ -174,7 +176,8 @@ public abstract class ContentCaptureSession implements AutoCloseable {
            FLUSH_REASON_SESSION_STARTED,
            FLUSH_REASON_SESSION_FINISHED,
            FLUSH_REASON_IDLE_TIMEOUT,
            FLUSH_REASON_TEXT_CHANGE_TIMEOUT
            FLUSH_REASON_TEXT_CHANGE_TIMEOUT,
            FLUSH_REASON_SESSION_CONNECTED
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface FlushReason{}
@@ -609,6 +612,8 @@ public abstract class ContentCaptureSession implements AutoCloseable {
                return "IDLE";
            case FLUSH_REASON_TEXT_CHANGE_TIMEOUT:
                return "TEXT_CHANGE";
            case FLUSH_REASON_SESSION_CONNECTED:
                return "CONNECTED";
            default:
                return "UNKOWN-" + reason;
        }
+2 −0
Original line number Diff line number Diff line
@@ -273,6 +273,8 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
        } else {
            mState = resultCode;
            mDisabled.set(false);
            // Flush any pending data immediately as buffering forced until now.
            flushIfNeeded(FLUSH_REASON_SESSION_CONNECTED);
        }
        if (sVerbose) {
            Log.v(TAG, "handleSessionStarted() result: id=" + mId + " resultCode=" + resultCode