summaryrefslogtreecommitdiff
path: root/services/contentcapture
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-02-07 18:41:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-02-07 18:41:58 +0000
commitcceb2c2e61e7ff436b99ab3aea690c73ea65b73f (patch)
tree6105a3f1984c25934f90d089304229559880a8a1 /services/contentcapture
parent7f99ea08ebea1ded83da80279cd88aac69fce60d (diff)
parent4770be2d609868f1a856b38223b95fcd0560b0fc (diff)
Merge "Send autofill assist structure data to content capture"
Diffstat (limited to 'services/contentcapture')
-rw-r--r--services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java b/services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java
index 583c5b593b88..32bca35009a8 100644
--- a/services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java
+++ b/services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java
@@ -426,18 +426,26 @@ final class ContentCapturePerUserService
public boolean sendActivityAssistDataLocked(@NonNull IBinder activityToken,
@NonNull Bundle data) {
final int id = getSessionId(activityToken);
+ final Bundle assistData = data.getBundle(ASSIST_KEY_DATA);
+ final AssistStructure assistStructure = data.getParcelable(ASSIST_KEY_STRUCTURE);
+ final AssistContent assistContent = data.getParcelable(ASSIST_KEY_CONTENT);
+ final SnapshotData snapshotData = new SnapshotData(assistData,
+ assistStructure, assistContent);
if (id != NO_SESSION_ID) {
final ContentCaptureServerSession session = mSessions.get(id);
- final Bundle assistData = data.getBundle(ASSIST_KEY_DATA);
- final AssistStructure assistStructure = data.getParcelable(ASSIST_KEY_STRUCTURE);
- final AssistContent assistContent = data.getParcelable(ASSIST_KEY_CONTENT);
- final SnapshotData snapshotData = new SnapshotData(assistData,
- assistStructure, assistContent);
session.sendActivitySnapshotLocked(snapshotData);
return true;
- } else {
- Slog.e(TAG, "Failed to notify activity assist data for activity: " + activityToken);
}
+
+ // We want to send an activity snapshot regardless of whether a content capture session is
+ // present or not since a content capture session is not required for this functionality
+ if (mRemoteService != null) {
+ mRemoteService.onActivitySnapshotRequest(NO_SESSION_ID, snapshotData);
+ Slog.d(TAG, "Notified activity assist data for activity: "
+ + activityToken + " without a session Id");
+ return true;
+ }
+
return false;
}