mirror of
https://github.com/nextcloud/android.git
synced 2024-12-21 16:24:32 +03:00
Merge remote-tracking branch 'origin/master' into dev
This commit is contained in:
commit
288dd1ea42
1 changed files with 11 additions and 10 deletions
|
@ -775,23 +775,24 @@ public class OperationsService extends Service {
|
|||
* @param operation Finished operation.
|
||||
* @param result Result of the operation.
|
||||
*/
|
||||
protected void dispatchResultToOperationListeners(
|
||||
final RemoteOperation operation, final RemoteOperationResult result
|
||||
) {
|
||||
protected void dispatchResultToOperationListeners(final RemoteOperation operation, final RemoteOperationResult result) {
|
||||
int count = 0;
|
||||
Iterator<OnRemoteOperationListener> listeners = mOperationsBinder.mBoundListeners.keySet().iterator();
|
||||
while (listeners.hasNext()) {
|
||||
final OnRemoteOperationListener listener = listeners.next();
|
||||
final Handler handler = mOperationsBinder.mBoundListeners.get(listener);
|
||||
if (handler != null) {
|
||||
handler.post(() -> listener.onRemoteOperationFinish(operation, result));
|
||||
count += 1;
|
||||
|
||||
if (mOperationsBinder != null) {
|
||||
for (OnRemoteOperationListener listener : mOperationsBinder.mBoundListeners.keySet()) {
|
||||
final Handler handler = mOperationsBinder.mBoundListeners.get(listener);
|
||||
if (handler != null) {
|
||||
handler.post(() -> listener.onRemoteOperationFinish(operation, result));
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
Pair<RemoteOperation, RemoteOperationResult> undispatched = new Pair<>(operation, result);
|
||||
mUndispatchedFinishedOperations.put(operation.hashCode(), undispatched);
|
||||
}
|
||||
|
||||
Log_OC.d(TAG, "Called " + count + " listeners");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue