1 /* ownCloud Android client application
2 * Copyright (C) 2012-2014 ownCloud Inc.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2,
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package com
.owncloud
.android
.services
;
20 import java
.io
.IOException
;
21 import java
.util
.Iterator
;
22 import java
.util
.concurrent
.ConcurrentHashMap
;
23 import java
.util
.concurrent
.ConcurrentLinkedQueue
;
24 import java
.util
.concurrent
.ConcurrentMap
;
26 import com
.owncloud
.android
.MainApp
;
27 import com
.owncloud
.android
.R
;
28 import com
.owncloud
.android
.datamodel
.FileDataStorageManager
;
29 import com
.owncloud
.android
.lib
.common
.OwnCloudAccount
;
30 import com
.owncloud
.android
.lib
.common
.OwnCloudClient
;
31 import com
.owncloud
.android
.lib
.common
.OwnCloudClientManagerFactory
;
32 import com
.owncloud
.android
.lib
.common
.OwnCloudCredentials
;
33 import com
.owncloud
.android
.lib
.common
.OwnCloudCredentialsFactory
;
34 import com
.owncloud
.android
.lib
.common
.accounts
.AccountUtils
.AccountNotFoundException
;
35 import com
.owncloud
.android
.lib
.common
.operations
.OnRemoteOperationListener
;
36 import com
.owncloud
.android
.lib
.common
.operations
.RemoteOperation
;
37 import com
.owncloud
.android
.lib
.common
.operations
.RemoteOperationResult
;
38 import com
.owncloud
.android
.lib
.common
.utils
.Log_OC
;
39 import com
.owncloud
.android
.lib
.resources
.files
.ExistenceCheckRemoteOperation
;
40 import com
.owncloud
.android
.lib
.resources
.shares
.ShareType
;
41 import com
.owncloud
.android
.lib
.resources
.users
.GetRemoteUserNameOperation
;
42 import com
.owncloud
.android
.operations
.common
.SyncOperation
;
43 import com
.owncloud
.android
.operations
.CreateFolderOperation
;
44 import com
.owncloud
.android
.operations
.CreateShareOperation
;
45 import com
.owncloud
.android
.operations
.GetServerInfoOperation
;
46 import com
.owncloud
.android
.operations
.MoveFileOperation
;
47 import com
.owncloud
.android
.operations
.OAuth2GetAccessToken
;
48 import com
.owncloud
.android
.operations
.RemoveFileOperation
;
49 import com
.owncloud
.android
.operations
.RenameFileOperation
;
50 import com
.owncloud
.android
.operations
.SynchronizeFileOperation
;
51 import com
.owncloud
.android
.operations
.UnshareLinkOperation
;
53 import android
.accounts
.Account
;
54 import android
.accounts
.AccountsException
;
55 import android
.accounts
.AuthenticatorException
;
56 import android
.accounts
.OperationCanceledException
;
57 import android
.app
.Service
;
58 import android
.content
.Intent
;
59 import android
.net
.Uri
;
60 import android
.os
.Binder
;
61 import android
.os
.Handler
;
62 import android
.os
.HandlerThread
;
63 import android
.os
.IBinder
;
64 import android
.os
.Looper
;
65 import android
.os
.Message
;
66 import android
.os
.Process
;
67 import android
.util
.Pair
;
69 public class OperationsService
extends Service
{
71 private static final String TAG
= OperationsService
.class.getSimpleName();
73 public static final String EXTRA_ACCOUNT
= "ACCOUNT";
74 public static final String EXTRA_SERVER_URL
= "SERVER_URL";
75 public static final String EXTRA_OAUTH2_QUERY_PARAMETERS
= "OAUTH2_QUERY_PARAMETERS";
76 public static final String EXTRA_REMOTE_PATH
= "REMOTE_PATH";
77 public static final String EXTRA_SEND_INTENT
= "SEND_INTENT";
78 public static final String EXTRA_NEWNAME
= "NEWNAME";
79 public static final String EXTRA_REMOVE_ONLY_LOCAL
= "REMOVE_LOCAL_COPY";
80 public static final String EXTRA_CREATE_FULL_PATH
= "CREATE_FULL_PATH";
81 public static final String EXTRA_SYNC_FILE_CONTENTS
= "SYNC_FILE_CONTENTS";
82 public static final String EXTRA_RESULT
= "RESULT";
83 public static final String EXTRA_NEW_PARENT_PATH
= "NEW_PARENT_PATH";
85 // TODO review if ALL OF THEM are necessary
86 public static final String EXTRA_SUCCESS_IF_ABSENT
= "SUCCESS_IF_ABSENT";
87 public static final String EXTRA_USERNAME
= "USERNAME";
88 public static final String EXTRA_PASSWORD
= "PASSWORD";
89 public static final String EXTRA_AUTH_TOKEN
= "AUTH_TOKEN";
90 public static final String EXTRA_COOKIE
= "COOKIE";
92 public static final String ACTION_CREATE_SHARE
= "CREATE_SHARE";
93 public static final String ACTION_UNSHARE
= "UNSHARE";
94 public static final String ACTION_GET_SERVER_INFO
= "GET_SERVER_INFO";
95 public static final String ACTION_OAUTH2_GET_ACCESS_TOKEN
= "OAUTH2_GET_ACCESS_TOKEN";
96 public static final String ACTION_EXISTENCE_CHECK
= "EXISTENCE_CHECK";
97 public static final String ACTION_GET_USER_NAME
= "GET_USER_NAME";
98 public static final String ACTION_RENAME
= "RENAME";
99 public static final String ACTION_REMOVE
= "REMOVE";
100 public static final String ACTION_CREATE_FOLDER
= "CREATE_FOLDER";
101 public static final String ACTION_SYNC_FILE
= "SYNC_FILE";
102 public static final String ACTION_MOVE_FILE
= "MOVE_FILE";
104 public static final String ACTION_OPERATION_ADDED
= OperationsService
.class.getName() + ".OPERATION_ADDED";
105 public static final String ACTION_OPERATION_FINISHED
= OperationsService
.class.getName() + ".OPERATION_FINISHED";
107 private ConcurrentLinkedQueue
<Pair
<Target
, RemoteOperation
>> mPendingOperations
=
108 new ConcurrentLinkedQueue
<Pair
<Target
, RemoteOperation
>>();
110 private ConcurrentMap
<Integer
, Pair
<RemoteOperation
, RemoteOperationResult
>>
111 mUndispatchedFinishedOperations
=
112 new ConcurrentHashMap
<Integer
, Pair
<RemoteOperation
, RemoteOperationResult
>>();
114 private static class Target
{
115 public Uri mServerUrl
= null
;
116 public Account mAccount
= null
;
117 public String mUsername
= null
;
118 public String mPassword
= null
;
119 public String mAuthToken
= null
;
120 public String mCookie
= null
;
122 public Target(Account account
, Uri serverUrl
, String username
, String password
, String authToken
,
125 mServerUrl
= serverUrl
;
126 mUsername
= username
;
127 mPassword
= password
;
128 mAuthToken
= authToken
;
133 private Looper mServiceLooper
;
134 private ServiceHandler mServiceHandler
;
135 private OperationsServiceBinder mBinder
;
136 private OwnCloudClient mOwnCloudClient
= null
;
137 private Target mLastTarget
= null
;
138 private FileDataStorageManager mStorageManager
;
139 private RemoteOperation mCurrentOperation
= null
;
143 * Service initialization
146 public void onCreate() {
148 HandlerThread thread
= new HandlerThread("Operations service thread", Process
.THREAD_PRIORITY_BACKGROUND
);
150 mServiceLooper
= thread
.getLooper();
151 mServiceHandler
= new ServiceHandler(mServiceLooper
, this);
152 mBinder
= new OperationsServiceBinder();
157 * Entry point to add a new operation to the queue of operations.
159 * New operations are added calling to startService(), resulting in a call to this method.
160 * This ensures the service will keep on working although the caller activity goes away.
162 * IMPORTANT: the only operations performed here right now is {@link GetSharedFilesOperation}. The class
163 * is taking advantage of it due to time constraints.
166 public int onStartCommand(Intent intent
, int flags
, int startId
) {
167 //Log_OC.wtf(TAG, "onStartCommand init" );
168 Message msg
= mServiceHandler
.obtainMessage();
170 mServiceHandler
.sendMessage(msg
);
171 //Log_OC.wtf(TAG, "onStartCommand end" );
172 return START_NOT_STICKY
;
176 public void onDestroy() {
177 //Log_OC.wtf(TAG, "onDestroy init" );
180 OwnCloudClientManagerFactory
.getDefaultSingleton().
181 saveAllClients(this, MainApp
.getAccountType());
183 // TODO - get rid of these exceptions
184 } catch (AccountNotFoundException e
) {
186 } catch (AuthenticatorException e
) {
188 } catch (OperationCanceledException e
) {
190 } catch (IOException e
) {
194 //Log_OC.wtf(TAG, "Clear mUndispatchedFinisiedOperations" );
195 mUndispatchedFinishedOperations
.clear();
197 //Log_OC.wtf(TAG, "onDestroy end" );
203 * Provides a binder object that clients can use to perform actions on the queue of operations,
204 * except the addition of new operations.
207 public IBinder
onBind(Intent intent
) {
208 //Log_OC.wtf(TAG, "onBind" );
214 * Called when ALL the bound clients were unbound.
217 public boolean onUnbind(Intent intent
) {
218 ((OperationsServiceBinder
)mBinder
).clearListeners();
219 return false
; // not accepting rebinding (default behaviour)
224 * Binder to let client components to perform actions on the queue of operations.
226 * It provides by itself the available operations.
228 public class OperationsServiceBinder
extends Binder
/* implements OnRemoteOperationListener */ {
231 * Map of listeners that will be reported about the end of operations from a {@link OperationsServiceBinder} instance
233 private ConcurrentMap
<OnRemoteOperationListener
, Handler
> mBoundListeners
=
234 new ConcurrentHashMap
<OnRemoteOperationListener
, Handler
>();
237 * Cancels an operation
241 public void cancel() {
246 public void clearListeners() {
248 mBoundListeners
.clear();
253 * Adds a listener interested in being reported about the end of operations.
255 * @param listener Object to notify about the end of operations.
256 * @param callbackHandler {@link Handler} to access the listener without breaking Android threading protection.
258 public void addOperationListener (OnRemoteOperationListener listener
, Handler callbackHandler
) {
259 synchronized (mBoundListeners
) {
260 mBoundListeners
.put(listener
, callbackHandler
);
266 * Removes a listener from the list of objects interested in the being reported about the end of operations.
268 * @param listener Object to notify about progress of transfer.
270 public void removeOperationListener (OnRemoteOperationListener listener
) {
271 synchronized (mBoundListeners
) {
272 mBoundListeners
.remove(listener
);
278 * TODO - IMPORTANT: update implementation when more operations are moved into the service
280 * @return 'True' when an operation that enforces the user to wait for completion is in process.
282 public boolean isPerformingBlockingOperation() {
283 return (!mPendingOperations
.isEmpty());
288 * Creates and adds to the queue a new operation, as described by operationIntent
290 * @param operationIntent Intent describing a new operation to queue and execute.
291 * @return Identifier of the operation created, or null if failed.
293 public long newOperation(Intent operationIntent
) {
294 RemoteOperation operation
= null
;
295 Target target
= null
;
297 if (!operationIntent
.hasExtra(EXTRA_ACCOUNT
) &&
298 !operationIntent
.hasExtra(EXTRA_SERVER_URL
)) {
299 Log_OC
.e(TAG
, "Not enough information provided in intent");
302 Account account
= operationIntent
.getParcelableExtra(EXTRA_ACCOUNT
);
303 String serverUrl
= operationIntent
.getStringExtra(EXTRA_SERVER_URL
);
304 String username
= operationIntent
.getStringExtra(EXTRA_USERNAME
);
305 String password
= operationIntent
.getStringExtra(EXTRA_PASSWORD
);
306 String authToken
= operationIntent
.getStringExtra(EXTRA_AUTH_TOKEN
);
307 String cookie
= operationIntent
.getStringExtra(EXTRA_COOKIE
);
310 (serverUrl
== null
) ? null
: Uri
.parse(serverUrl
),
317 String action
= operationIntent
.getAction();
318 if (action
.equals(ACTION_CREATE_SHARE
)) { // Create Share
319 String remotePath
= operationIntent
.getStringExtra(EXTRA_REMOTE_PATH
);
320 Intent sendIntent
= operationIntent
.getParcelableExtra(EXTRA_SEND_INTENT
);
321 if (remotePath
.length() > 0) {
322 operation
= new CreateShareOperation(remotePath
, ShareType
.PUBLIC_LINK
,
323 "", false
, "", 1, sendIntent
);
326 } else if (action
.equals(ACTION_UNSHARE
)) { // Unshare file
327 String remotePath
= operationIntent
.getStringExtra(EXTRA_REMOTE_PATH
);
328 if (remotePath
.length() > 0) {
329 operation
= new UnshareLinkOperation(
331 OperationsService
.this);
334 } else if (action
.equals(ACTION_GET_SERVER_INFO
)) {
335 // check OC server and get basic information from it
336 operation
= new GetServerInfoOperation(serverUrl
, OperationsService
.this);
338 } else if (action
.equals(ACTION_OAUTH2_GET_ACCESS_TOKEN
)) {
339 /// GET ACCESS TOKEN to the OAuth server
340 String oauth2QueryParameters
=
341 operationIntent
.getStringExtra(EXTRA_OAUTH2_QUERY_PARAMETERS
);
342 operation
= new OAuth2GetAccessToken(
343 getString(R
.string
.oauth2_client_id
),
344 getString(R
.string
.oauth2_redirect_uri
),
345 getString(R
.string
.oauth2_grant_type
),
346 oauth2QueryParameters
);
348 } else if (action
.equals(ACTION_EXISTENCE_CHECK
)) {
350 String remotePath
= operationIntent
.getStringExtra(EXTRA_REMOTE_PATH
);
351 boolean successIfAbsent
= operationIntent
.getBooleanExtra(EXTRA_SUCCESS_IF_ABSENT
, false
);
352 operation
= new ExistenceCheckRemoteOperation(remotePath
, OperationsService
.this, successIfAbsent
);
354 } else if (action
.equals(ACTION_GET_USER_NAME
)) {
356 operation
= new GetRemoteUserNameOperation();
358 } else if (action
.equals(ACTION_RENAME
)) {
359 // Rename file or folder
360 String remotePath
= operationIntent
.getStringExtra(EXTRA_REMOTE_PATH
);
361 String newName
= operationIntent
.getStringExtra(EXTRA_NEWNAME
);
362 operation
= new RenameFileOperation(remotePath
, account
, newName
);
364 } else if (action
.equals(ACTION_REMOVE
)) {
365 // Remove file or folder
366 String remotePath
= operationIntent
.getStringExtra(EXTRA_REMOTE_PATH
);
367 boolean onlyLocalCopy
= operationIntent
.getBooleanExtra(EXTRA_REMOVE_ONLY_LOCAL
, false
);
368 operation
= new RemoveFileOperation(remotePath
, onlyLocalCopy
);
370 } else if (action
.equals(ACTION_CREATE_FOLDER
)) {
372 String remotePath
= operationIntent
.getStringExtra(EXTRA_REMOTE_PATH
);
373 boolean createFullPath
= operationIntent
.getBooleanExtra(EXTRA_CREATE_FULL_PATH
, true
);
374 operation
= new CreateFolderOperation(remotePath
, createFullPath
);
376 } else if (action
.equals(ACTION_SYNC_FILE
)) {
378 String remotePath
= operationIntent
.getStringExtra(EXTRA_REMOTE_PATH
);
379 boolean syncFileContents
= operationIntent
.getBooleanExtra(EXTRA_SYNC_FILE_CONTENTS
, true
);
380 operation
= new SynchronizeFileOperation(remotePath
, account
, syncFileContents
, getApplicationContext());
381 } else if (action
.equals(ACTION_MOVE_FILE
)) {
383 String remotePath
= operationIntent
.getStringExtra(EXTRA_REMOTE_PATH
);
384 String newParentPath
= operationIntent
.getStringExtra(EXTRA_NEW_PARENT_PATH
);
385 operation
= new MoveFileOperation(remotePath
,newParentPath
,account
);
390 } catch (IllegalArgumentException e
) {
391 Log_OC
.e(TAG
, "Bad information provided in intent: " + e
.getMessage());
395 if (operation
!= null
) {
396 mPendingOperations
.add(new Pair
<Target
, RemoteOperation
>(target
, operation
));
397 startService(new Intent(OperationsService
.this, OperationsService
.class));
398 //Log_OC.wtf(TAG, "New operation added, opId: " + operation.hashCode());
399 // better id than hash? ; should be good enough by the time being
400 return operation
.hashCode();
403 //Log_OC.wtf(TAG, "New operation failed, returned Long.MAX_VALUE");
404 return Long
.MAX_VALUE
;
408 public boolean dispatchResultIfFinished(int operationId
, OnRemoteOperationListener listener
) {
409 Pair
<RemoteOperation
, RemoteOperationResult
> undispatched
=
410 mUndispatchedFinishedOperations
.remove(operationId
);
411 if (undispatched
!= null
) {
412 listener
.onRemoteOperationFinish(undispatched
.first
, undispatched
.second
);
414 //Log_OC.wtf(TAG, "Sending callback later");
416 if (!mPendingOperations
.isEmpty()) {
421 //Log_OC.wtf(TAG, "Not finished yet");
429 * Operations worker. Performs the pending operations in the order they were requested.
431 * Created with the Looper of a new thread, started in {@link OperationsService#onCreate()}.
433 private static class ServiceHandler
extends Handler
{
434 // don't make it a final class, and don't remove the static ; lint will warn about a possible memory leak
435 OperationsService mService
;
436 public ServiceHandler(Looper looper
, OperationsService service
) {
438 if (service
== null
) {
439 throw new IllegalArgumentException("Received invalid NULL in parameter 'service'");
445 public void handleMessage(Message msg
) {
446 mService
.nextOperation();
447 mService
.stopSelf(msg
.arg1
);
453 * Performs the next operation in the queue
455 private void nextOperation() {
457 //Log_OC.wtf(TAG, "nextOperation init" );
459 Pair
<Target
, RemoteOperation
> next
= null
;
460 synchronized(mPendingOperations
) {
461 next
= mPendingOperations
.peek();
466 mCurrentOperation
= next
.second
;
467 RemoteOperationResult result
= null
;
469 /// prepare client object to send the request to the ownCloud server
470 if (mLastTarget
== null
|| !mLastTarget
.equals(next
.first
)) {
471 mLastTarget
= next
.first
;
472 if (mLastTarget
.mAccount
!= null
) {
473 OwnCloudAccount ocAccount
= new OwnCloudAccount(mLastTarget
.mAccount
, this);
474 mOwnCloudClient
= OwnCloudClientManagerFactory
.getDefaultSingleton().
475 getClientFor(ocAccount
, this);
477 new FileDataStorageManager(
478 mLastTarget
.mAccount
,
479 getContentResolver());
481 OwnCloudCredentials credentials
= null
;
482 if (mLastTarget
.mUsername
!= null
&&
483 mLastTarget
.mUsername
.length() > 0) {
484 credentials
= OwnCloudCredentialsFactory
.newBasicCredentials(
485 mLastTarget
.mUsername
,
486 mLastTarget
.mPassword
); // basic
488 } else if (mLastTarget
.mAuthToken
!= null
&&
489 mLastTarget
.mAuthToken
.length() > 0) {
490 credentials
= OwnCloudCredentialsFactory
.newBearerCredentials(
491 mLastTarget
.mAuthToken
); // bearer token
493 } else if (mLastTarget
.mCookie
!= null
&&
494 mLastTarget
.mCookie
.length() > 0) {
495 credentials
= OwnCloudCredentialsFactory
.newSamlSsoCredentials(
496 mLastTarget
.mCookie
); // SAML SSO
498 OwnCloudAccount ocAccount
= new OwnCloudAccount(
499 mLastTarget
.mServerUrl
, credentials
);
500 mOwnCloudClient
= OwnCloudClientManagerFactory
.getDefaultSingleton().
501 getClientFor(ocAccount
, this);
502 mStorageManager
= null
;
506 /// perform the operation
507 if (mCurrentOperation
instanceof SyncOperation
) {
508 result
= ((SyncOperation
)mCurrentOperation
).execute(mOwnCloudClient
, mStorageManager
);
510 result
= mCurrentOperation
.execute(mOwnCloudClient
);
513 } catch (AccountsException e
) {
514 if (mLastTarget
.mAccount
== null
) {
515 Log_OC
.e(TAG
, "Error while trying to get authorization for a NULL account", e
);
517 Log_OC
.e(TAG
, "Error while trying to get authorization for " + mLastTarget
.mAccount
.name
, e
);
519 result
= new RemoteOperationResult(e
);
521 } catch (IOException e
) {
522 if (mLastTarget
.mAccount
== null
) {
523 Log_OC
.e(TAG
, "Error while trying to get authorization for a NULL account", e
);
525 Log_OC
.e(TAG
, "Error while trying to get authorization for " + mLastTarget
.mAccount
.name
, e
);
527 result
= new RemoteOperationResult(e
);
528 } catch (Exception e
) {
529 if (mLastTarget
.mAccount
== null
) {
530 Log_OC
.e(TAG
, "Unexpected error for a NULL account", e
);
532 Log_OC
.e(TAG
, "Unexpected error for " + mLastTarget
.mAccount
.name
, e
);
534 result
= new RemoteOperationResult(e
);
537 synchronized(mPendingOperations
) {
538 mPendingOperations
.poll();
542 //sendBroadcastOperationFinished(mLastTarget, mCurrentOperation, result);
543 dispatchResultToOperationListeners(mLastTarget
, mCurrentOperation
, result
);
549 * Sends a broadcast when a new operation is added to the queue.
551 * Local broadcasts are only delivered to activities in the same process, but can't be done sticky :\
553 * @param target Account or URL pointing to an OC server.
554 * @param operation Added operation.
556 private void sendBroadcastNewOperation(Target target
, RemoteOperation operation
) {
557 Intent intent
= new Intent(ACTION_OPERATION_ADDED
);
558 if (target
.mAccount
!= null
) {
559 intent
.putExtra(EXTRA_ACCOUNT
, target
.mAccount
);
561 intent
.putExtra(EXTRA_SERVER_URL
, target
.mServerUrl
);
563 //LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
564 //lbm.sendBroadcast(intent);
565 sendStickyBroadcast(intent
);
569 // TODO - maybe add a notification for real start of operations
572 * Sends a LOCAL broadcast when an operations finishes in order to the interested activities can update their view
574 * Local broadcasts are only delivered to activities in the same process.
576 * @param target Account or URL pointing to an OC server.
577 * @param operation Finished operation.
578 * @param result Result of the operation.
580 private void sendBroadcastOperationFinished(Target target
, RemoteOperation operation
, RemoteOperationResult result
) {
581 Intent intent
= new Intent(ACTION_OPERATION_FINISHED
);
582 intent
.putExtra(EXTRA_RESULT
, result
);
583 if (target
.mAccount
!= null
) {
584 intent
.putExtra(EXTRA_ACCOUNT
, target
.mAccount
);
586 intent
.putExtra(EXTRA_SERVER_URL
, target
.mServerUrl
);
588 //LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
589 //lbm.sendBroadcast(intent);
590 sendStickyBroadcast(intent
);
595 * Notifies the currently subscribed listeners about the end of an operation.
597 * @param target Account or URL pointing to an OC server.
598 * @param operation Finished operation.
599 * @param result Result of the operation.
601 private void dispatchResultToOperationListeners(
602 Target target
, final RemoteOperation operation
, final RemoteOperationResult result
) {
604 Iterator
<OnRemoteOperationListener
> listeners
= mBinder
.mBoundListeners
.keySet().iterator();
605 while (listeners
.hasNext()) {
606 final OnRemoteOperationListener listener
= listeners
.next();
607 final Handler handler
= mBinder
.mBoundListeners
.get(listener
);
608 if (handler
!= null
) {
609 handler
.post(new Runnable() {
612 listener
.onRemoteOperationFinish(operation
, result
);
619 //mOperationResults.put(operation.hashCode(), result);
620 Pair
<RemoteOperation
, RemoteOperationResult
> undispatched
=
621 new Pair
<RemoteOperation
, RemoteOperationResult
>(operation
, result
);
622 mUndispatchedFinishedOperations
.put(operation
.hashCode(), undispatched
);
624 Log_OC
.d(TAG
, "Called " + count
+ " listeners");