summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TYM Tsai <tymtsai@google.com> 2021-06-16 22:47:11 +0800
committer TYM Tsai <tymtsai@google.com> 2021-06-17 22:35:10 +0800
commit46e946a251f133af59f2b95f279c02ca17c7a0a9 (patch)
tree4d57e3c3190b510f8ac5d48e457b86d6f702d405
parentdc07d29bd03e473f9e324c3b64b8cdd33b0a24db (diff)
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
-rw-r--r--core/java/android/widget/SelectionActionModeHelper.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/widget/SelectionActionModeHelper.java b/core/java/android/widget/SelectionActionModeHelper.java
index eb6bce4a2f59..3fed9beeaaba 100644
--- a/core/java/android/widget/SelectionActionModeHelper.java
+++ b/core/java/android/widget/SelectionActionModeHelper.java
@@ -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);
}
}