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 operation Finished operation.
|
||||||
* @param result Result of the operation.
|
* @param result Result of the operation.
|
||||||
*/
|
*/
|
||||||
protected void dispatchResultToOperationListeners(
|
protected void dispatchResultToOperationListeners(final RemoteOperation operation, final RemoteOperationResult result) {
|
||||||
final RemoteOperation operation, final RemoteOperationResult result
|
|
||||||
) {
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Iterator<OnRemoteOperationListener> listeners = mOperationsBinder.mBoundListeners.keySet().iterator();
|
|
||||||
while (listeners.hasNext()) {
|
if (mOperationsBinder != null) {
|
||||||
final OnRemoteOperationListener listener = listeners.next();
|
for (OnRemoteOperationListener listener : mOperationsBinder.mBoundListeners.keySet()) {
|
||||||
final Handler handler = mOperationsBinder.mBoundListeners.get(listener);
|
final Handler handler = mOperationsBinder.mBoundListeners.get(listener);
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
handler.post(() -> listener.onRemoteOperationFinish(operation, result));
|
handler.post(() -> listener.onRemoteOperationFinish(operation, result));
|
||||||
count += 1;
|
count += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
Pair<RemoteOperation, RemoteOperationResult> undispatched = new Pair<>(operation, result);
|
Pair<RemoteOperation, RemoteOperationResult> undispatched = new Pair<>(operation, result);
|
||||||
mUndispatchedFinishedOperations.put(operation.hashCode(), undispatched);
|
mUndispatchedFinishedOperations.put(operation.hashCode(), undispatched);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log_OC.d(TAG, "Called " + count + " listeners");
|
Log_OC.d(TAG, "Called " + count + " listeners");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue