summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-05-22 18:52:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-05-22 18:52:32 +0000
commit99885212fa371bca69da74416b18886f5fee8795 (patch)
treeb6243e08c24672f5f8bd04c97133e6275ca8952a /core/java
parent93deb904d3a0948cdfea3368b165bc6527a3c205 (diff)
parent79e0ba05ec5d029e7842ab8290a28e97ef9a031e (diff)
Merge "Fixed Cancellation for PendingAutofillRequest." into qt-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/service/autofill/augmented/AugmentedAutofillService.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/java/android/service/autofill/augmented/AugmentedAutofillService.java b/core/java/android/service/autofill/augmented/AugmentedAutofillService.java
index 87e369f20d58..66c3e1966134 100644
--- a/core/java/android/service/autofill/augmented/AugmentedAutofillService.java
+++ b/core/java/android/service/autofill/augmented/AugmentedAutofillService.java
@@ -228,7 +228,7 @@ public abstract class AugmentedAutofillService extends Service {
} else {
// TODO(b/123099468): figure out if it's ok to reuse the proxy; add logging
if (sDebug) Log.d(TAG, "Reusing proxy for session " + sessionId);
- proxy.update(focusedId, focusedValue, callback);
+ proxy.update(focusedId, focusedValue, callback, cancellationSignal);
}
try {
@@ -252,6 +252,15 @@ public abstract class AugmentedAutofillService extends Service {
Log.w(TAG, "No proxy for session " + sessionId);
return;
}
+ if (proxy.mCallback != null) {
+ try {
+ if (!proxy.mCallback.isCompleted()) {
+ proxy.mCallback.cancel();
+ }
+ } catch (Exception e) {
+ Log.e(TAG, "failed to check current pending request status", e);
+ }
+ }
proxy.destroy();
}
mAutofillProxies.clear();
@@ -442,7 +451,7 @@ public abstract class AugmentedAutofillService extends Service {
}
private void update(@NonNull AutofillId focusedId, @NonNull AutofillValue focusedValue,
- @NonNull IFillCallback callback) {
+ @NonNull IFillCallback callback, @NonNull CancellationSignal cancellationSignal) {
synchronized (mLock) {
mFocusedId = focusedId;
mFocusedValue = focusedValue;
@@ -457,6 +466,7 @@ public abstract class AugmentedAutofillService extends Service {
Log.d(TAG, "mCallback is updated.");
}
mCallback = callback;
+ mCancellationSignal = cancellationSignal;
}
}