Merge "Do not send event if the buffer is empty."

This commit is contained in:
Joanne Chung
2022-09-27 11:25:12 +00:00
committed by Android (Google) Code Review

View File

@@ -528,7 +528,12 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
@Override
@UiThread
void flush(@FlushReason int reason) {
if (mEvents == null) return;
if (mEvents == null || mEvents.size() == 0) {
if (sVerbose) {
Log.v(TAG, "Don't flush for empty event buffer.");
}
return;
}
if (mDisabled.get()) {
Log.e(TAG, "handleForceFlush(" + getDebugState(reason) + "): should not be when "