- } catch (OperationCanceledException e) {\r
- e.printStackTrace();\r
- } catch (AuthenticatorException e) {\r
- syncResult.stats.numAuthExceptions++;\r
- e.printStackTrace();\r
- } catch (IOException e) {\r
- syncResult.stats.numIoExceptions++;\r
- e.printStackTrace();\r
- } catch (DavException e) {\r
- syncResult.stats.numIoExceptions++;\r
- e.printStackTrace();\r
- } catch (Throwable t) {\r
- // TODO update syncResult\r
- Log.e(TAG, "problem while synchronizing owncloud account " + account.name, t);\r
- t.printStackTrace();\r
- }\r
- \r
- /* Commented code for ugly performance tests\r
- long sum = 0, mean = 0, max = 0, min = Long.MAX_VALUE;\r
- for (int i=0; i<MAX_DELAYS && i<mDelaysCount; i++) {\r
- sum += mResponseDelays[i];\r
- max = Math.max(max, mResponseDelays[i]);\r
- min = Math.min(min, mResponseDelays[i]);\r
+ \r
+ \r
+ } finally {\r
+ // it's important making this although very unexpected errors occur; that's the reason for the finally\r
+ \r
+ if (mFailedResultsCounter > 0 && mIsManualSync) {\r
+ /// don't let the system synchronization manager retries MANUAL synchronizations\r
+ // (be careful: "MANUAL" currently includes the synchronization requested when a new account is created and when the user changes the current account)\r
+ mSyncResult.tooManyRetries = true;\r
+ \r
+ /// notify the user about the failure of MANUAL synchronization\r
+ notifyFailedSynchronization();\r
+ }\r
+ sendStickyBroadcast(false, null, mLastFailedResult); // message to signal the end to the UI\r