Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5cb050a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Expose pending request to subclasses and ensure clean up"

parents fb519f33 58d3f87f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public abstract class AbstractMultiplePendingRequestsRemoteService<S
            final int size = mPendingRequests.size();
            if (mVerbose) Slog.v(mTag, "Sending " + size + " pending requests");
            for (int i = 0; i < size; i++) {
                mPendingRequests.get(i).run();
                handlePendingRequest(mPendingRequests.get(i));
            }
            mPendingRequests.clear();
        }
+6 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public abstract class AbstractRemoteService<S extends AbstractRemoteService<S, I
    private long mNextUnbind;

    /** Requests that have been scheduled, but that are not finished yet */
    private final ArrayList<BasePendingRequest<S, I>> mUnfinishedRequests = new ArrayList<>();
    protected final ArrayList<BasePendingRequest<S, I>> mUnfinishedRequests = new ArrayList<>();

    /**
     * Callback called when the service dies.
@@ -622,6 +622,11 @@ public abstract class AbstractRemoteService<S extends AbstractRemoteService<S, I
                mCancelled = true;
            }

            S service = mWeakService.get();
            if (service != null) {
                service.finishRequest(this);
            }

            onCancel();
            return true;
        }