Merge "Move ServiceConnector job timeouts to the job handler thread"

This commit is contained in:
Treehugger Robot
2023-06-26 15:09:05 +00:00
committed by Gerrit Code Review

View File

@@ -745,6 +745,10 @@ public interface ServiceConnector<I extends IInterface> {
boolean mAsync = false; boolean mAsync = false;
private String mDebugName; 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(); long requestTimeout = getRequestTimeoutMs();
if (requestTimeout > 0) { if (requestTimeout > 0) {
orTimeout(requestTimeout, TimeUnit.MILLISECONDS); orTimeout(requestTimeout, TimeUnit.MILLISECONDS);