Notify Content Capture the selection was changed

The ContentCapture service is interested in the selection changes.
When the selection was changed, notifies a text changed event to
ContentCapture.

Bug: 184311217
Test: manual
 1.long press trigger selection, event is sent.
 2.drag selection indicators, send event after the drag is done.
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Ie45f617b132bc240b6cf61ee7ebc3041275f1694
This commit is contained in:
TYM Tsai
2021-06-16 22:47:11 +08:00
parent dc07d29bd0
commit 46e946a251

View File

@@ -565,6 +565,7 @@ public final class SelectionActionModeHelper {
*/
public void onSmartSelection(SelectionResult result) {
onClassifiedSelection(result);
mTextView.notifyContentCaptureTextChanged();
mLogger.logSelectionModified(
result.mStart, result.mEnd, result.mClassification, result.mSelection);
}
@@ -595,6 +596,7 @@ public final class SelectionActionModeHelper {
mSelectionStart = selectionStart;
mSelectionEnd = selectionEnd;
mAllowReset = false;
mTextView.notifyContentCaptureTextChanged();
mLogger.logSelectionModified(selectionStart, selectionEnd, classification, null);
}
}