Skip to content
Snippets Groups Projects
Commit f4da8c82 authored by Haoran Zhang's avatar Haoran Zhang Committed by Android Build Coastguard Worker
Browse files

Revert "Resolve session linger caused by RemoteFillService."

This reverts commit 58e1c93c.

Reason for revert: b/306964891.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:29d48b546d4118caec3cbce0eee528ad6cb5a6ed)
Merged-In: I09f6c9d3570aed0f94385b46f7103e836693e502
Change-Id: I09f6c9d3570aed0f94385b46f7103e836693e502
parent 494381c8
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ final class RemoteFillService extends ServiceConnector.Impl<IAutoFillService> {
private static final long TIMEOUT_IDLE_BIND_MILLIS = 5 * DateUtils.SECOND_IN_MILLIS;
private static final long TIMEOUT_REMOTE_REQUEST_MILLIS = 5 * DateUtils.SECOND_IN_MILLIS;
private FillServiceCallbacks mCallbacks;
private final FillServiceCallbacks mCallbacks;
private final Object mLock = new Object();
private CompletableFuture<FillResponse> mPendingFillRequest;
private int mPendingFillRequestId = INVALID_REQUEST_ID;
......@@ -128,12 +128,9 @@ final class RemoteFillService extends ServiceConnector.Impl<IAutoFillService> {
*/
public int cancelCurrentRequest() {
synchronized (mLock) {
int canceledRequestId = mPendingFillRequest != null && mPendingFillRequest.cancel(false)
return mPendingFillRequest != null && mPendingFillRequest.cancel(false)
? mPendingFillRequestId
: INVALID_REQUEST_ID;
mPendingFillRequest = null;
mPendingFillRequestId = INVALID_REQUEST_ID;
return canceledRequestId;
}
}
......@@ -187,10 +184,6 @@ final class RemoteFillService extends ServiceConnector.Impl<IAutoFillService> {
mPendingFillRequest = null;
mPendingFillRequestId = INVALID_REQUEST_ID;
}
if (mCallbacks == null) {
Slog.w(TAG, "Error calling RemoteFillService - service already unbound");
return;
}
if (err == null) {
mCallbacks.onFillRequestSuccess(request.getId(), res,
mComponentName.getPackageName(), request.getFlags());
......@@ -227,10 +220,6 @@ final class RemoteFillService extends ServiceConnector.Impl<IAutoFillService> {
return save;
}).orTimeout(TIMEOUT_REMOTE_REQUEST_MILLIS, TimeUnit.MILLISECONDS)
.whenComplete((res, err) -> Handler.getMain().post(() -> {
if (mCallbacks == null) {
Slog.w(TAG, "Error calling RemoteFillService - service already unbound");
return;
}
if (err == null) {
mCallbacks.onSaveRequestSuccess(mComponentName.getPackageName(), res);
} else {
......@@ -245,8 +234,6 @@ final class RemoteFillService extends ServiceConnector.Impl<IAutoFillService> {
}
public void destroy() {
cancelCurrentRequest();
unbind();
mCallbacks = null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment