From 52ed9ee0387fa4faa91deff970dde779e2ff2f9f Mon Sep 17 00:00:00 2001 From: Mihir Patel Date: Fri, 9 Aug 2019 14:00:42 -0700 Subject: Fixing a bug where content capture sessions with child sessions could get stuck in a state where no event flushing other than forced flushes would occur Fixes: 139202268 Test: atest CtsContentCaptureServiceTestCases Change-Id: I21e9d4db2402fe5210b7d938dac2f12e7557c146 --- .../java/android/view/contentcapture/MainContentCaptureSession.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/java/android/view/contentcapture/MainContentCaptureSession.java b/core/java/android/view/contentcapture/MainContentCaptureSession.java index cee79439d1b3..1e7440bd5a43 100644 --- a/core/java/android/view/contentcapture/MainContentCaptureSession.java +++ b/core/java/android/view/contentcapture/MainContentCaptureSession.java @@ -480,6 +480,8 @@ public final class MainContentCaptureSession extends ContentCaptureSession { return; } + mNextFlushForTextChanged = false; + final int numberEvents = mEvents.size(); final String reasonString = getFlushReasonAsString(reason); if (sDebug) { @@ -495,10 +497,6 @@ public final class MainContentCaptureSession extends ContentCaptureSession { try { mHandler.removeMessages(MSG_FLUSH); - if (reason == FLUSH_REASON_TEXT_CHANGE_TIMEOUT) { - mNextFlushForTextChanged = false; - } - final ParceledListSlice events = clearEvents(); mDirectServiceInterface.sendEvents(events, reason, mManager.mOptions); } catch (RemoteException e) { -- cgit v1.2.3-59-g8ed1b