Loading core/java/android/view/contentcapture/ContentCaptureSession.java +1 −5 Original line number Diff line number Diff line Loading @@ -341,12 +341,8 @@ public abstract class ContentCaptureSession implements AutoCloseable { } } try { flush(FLUSH_REASON_SESSION_FINISHED); } finally { onDestroy(); } } abstract void onDestroy(); Loading core/java/android/view/contentcapture/MainContentCaptureSession.java +12 −4 Original line number Diff line number Diff line Loading @@ -263,7 +263,13 @@ public final class MainContentCaptureSession extends ContentCaptureSession { @Override void onDestroy() { mHandler.removeMessages(MSG_FLUSH); mHandler.post(() -> destroySession()); mHandler.post(() -> { try { flush(FLUSH_REASON_SESSION_FINISHED); } finally { destroySession(); } }); } /** Loading Loading @@ -571,9 +577,11 @@ public final class MainContentCaptureSession extends ContentCaptureSession { private ParceledListSlice<ContentCaptureEvent> clearEvents() { // NOTE: we must save a reference to the current mEvents and then set it to to null, // otherwise clearing it would clear it in the receiving side if the service is also local. final List<ContentCaptureEvent> events = mEvents == null ? Collections.EMPTY_LIST : new ArrayList<>(mEvents); if (mEvents == null) { return new ParceledListSlice<>(Collections.EMPTY_LIST); } final List<ContentCaptureEvent> events = new ArrayList<>(mEvents); mEvents.clear(); return new ParceledListSlice<>(events); } Loading Loading
core/java/android/view/contentcapture/ContentCaptureSession.java +1 −5 Original line number Diff line number Diff line Loading @@ -341,12 +341,8 @@ public abstract class ContentCaptureSession implements AutoCloseable { } } try { flush(FLUSH_REASON_SESSION_FINISHED); } finally { onDestroy(); } } abstract void onDestroy(); Loading
core/java/android/view/contentcapture/MainContentCaptureSession.java +12 −4 Original line number Diff line number Diff line Loading @@ -263,7 +263,13 @@ public final class MainContentCaptureSession extends ContentCaptureSession { @Override void onDestroy() { mHandler.removeMessages(MSG_FLUSH); mHandler.post(() -> destroySession()); mHandler.post(() -> { try { flush(FLUSH_REASON_SESSION_FINISHED); } finally { destroySession(); } }); } /** Loading Loading @@ -571,9 +577,11 @@ public final class MainContentCaptureSession extends ContentCaptureSession { private ParceledListSlice<ContentCaptureEvent> clearEvents() { // NOTE: we must save a reference to the current mEvents and then set it to to null, // otherwise clearing it would clear it in the receiving side if the service is also local. final List<ContentCaptureEvent> events = mEvents == null ? Collections.EMPTY_LIST : new ArrayList<>(mEvents); if (mEvents == null) { return new ParceledListSlice<>(Collections.EMPTY_LIST); } final List<ContentCaptureEvent> events = new ArrayList<>(mEvents); mEvents.clear(); return new ParceledListSlice<>(events); } Loading