Merge "Move ServiceConnector job timeouts to the job handler thread" am: 336f21d53d am: 44aa1bfb36 am: 450b8a302f am: 4dc8e30779

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2629381

Change-Id: I7713621c799dca56dc7343208428d45583c318ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-06-27 00:02:22 +00:00
committed by Automerger Merge Worker

View File

@@ -745,6 +745,10 @@ public interface ServiceConnector<I extends IInterface> {
boolean mAsync = false;
private String mDebugName;
{
// The timeout handler must be set before any calls to set timeouts on the
// AndroidFuture, to ensure they are posted on the proper thread.
setTimeoutHandler(getJobHandler());
long requestTimeout = getRequestTimeoutMs();
if (requestTimeout > 0) {
orTimeout(requestTimeout, TimeUnit.MILLISECONDS);