mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
Grant that same result is never processed twice by the same listener (one through callback, one through getResult)
This commit is contained in:
parent
b017073e96
commit
40f5eb6de6
1 changed files with 5 additions and 3 deletions
|
@ -443,12 +443,11 @@ public class OperationsService extends Service {
|
|||
} finally {
|
||||
synchronized(mPendingOperations) {
|
||||
mPendingOperations.poll();
|
||||
mOperationResults.put(mCurrentOperation.hashCode(), result);
|
||||
}
|
||||
}
|
||||
|
||||
//sendBroadcastOperationFinished(mLastTarget, mCurrentOperation, result);
|
||||
callbackOperationListeners(mLastTarget, mCurrentOperation, result);
|
||||
dispatchOperationListeners(mLastTarget, mCurrentOperation, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -506,7 +505,7 @@ public class OperationsService extends Service {
|
|||
* @param operation Finished operation.
|
||||
* @param result Result of the operation.
|
||||
*/
|
||||
private void callbackOperationListeners(
|
||||
private void dispatchOperationListeners(
|
||||
Target target, final RemoteOperation operation, final RemoteOperationResult result) {
|
||||
int count = 0;
|
||||
Iterator<OnRemoteOperationListener> listeners = mBinder.mBoundListeners.keySet().iterator();
|
||||
|
@ -523,6 +522,9 @@ public class OperationsService extends Service {
|
|||
count += 1;
|
||||
}
|
||||
}
|
||||
if (count == 0) {
|
||||
mOperationResults.put(operation.hashCode(), result);
|
||||
}
|
||||
Log_OC.d(TAG, "Called " + count + " listeners");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue