X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/d95d2ac85680c0dcb8a2d863d809c40b64a5808d..24d67823860c34bccb1bd0ba6c127ba1bb5c6fd1:/src/com/owncloud/android/syncadapter/FileSyncAdapter.java?ds=sidebyside diff --git a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java index df5c4b77..07e68c6a 100644 --- a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java +++ b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java @@ -1,6 +1,10 @@ -/* ownCloud Android client application +/** + * ownCloud Android client application + * + * @author Bartek Przybylski + * @author David A. Velasco * Copyright (C) 2011 Bartek Przybylski - * Copyright (C) 2012-2013 ownCloud Inc. + * Copyright (C) 2015 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -31,11 +35,11 @@ import com.owncloud.android.authentication.AuthenticatorActivity; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.operations.RemoteOperationResult; -import com.owncloud.android.operations.SynchronizeFolderOperation; +import com.owncloud.android.operations.RefreshFolderOperation; import com.owncloud.android.operations.UpdateOCVersionOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; +import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.ui.activity.ErrorsWhileCopyingHandlerActivity; -import com.owncloud.android.utils.Log_OC; import android.accounts.Account; import android.accounts.AccountsException; @@ -55,9 +59,6 @@ import android.support.v4.app.NotificationCompat; * ownCloud files. * * Performs a full synchronization of the account recieved in {@link #onPerformSync(Account, Bundle, String, ContentProviderClient, SyncResult)}. - * - * @author Bartek Przybylski - * @author David A. Velasco */ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { @@ -260,10 +261,11 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { } */ // folder synchronization - SynchronizeFolderOperation synchFolderOp = new SynchronizeFolderOperation( folder, + RefreshFolderOperation synchFolderOp = new RefreshFolderOperation( folder, mCurrentSyncTime, true, mIsShareSupported, + false, getStorageManager(), getAccount(), getContext() @@ -382,15 +384,12 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { */ private void notifyFailedSynchronization() { NotificationCompat.Builder notificationBuilder = createNotificationBuilder(); - notificationBuilder.setTicker(i18n(R.string.sync_fail_ticker)); boolean needsToUpdateCredentials = ( mLastFailedResult != null && ( mLastFailedResult.getCode() == ResultCode.UNAUTHORIZED || mLastFailedResult.isIdPRedirection() ) ); - // TODO put something smart in the contentIntent below for all the possible errors - notificationBuilder.setContentTitle(i18n(R.string.sync_fail_ticker)); if (needsToUpdateCredentials) { // let the user update credentials with one click Intent updateAccountCredentials = new Intent(getContext(), AuthenticatorActivity.class); @@ -400,12 +399,16 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); updateAccountCredentials.addFlags(Intent.FLAG_FROM_BACKGROUND); notificationBuilder + .setTicker(i18n(R.string.sync_fail_ticker_unauthorized)) + .setContentTitle(i18n(R.string.sync_fail_ticker_unauthorized)) .setContentIntent(PendingIntent.getActivity( getContext(), (int)System.currentTimeMillis(), updateAccountCredentials, PendingIntent.FLAG_ONE_SHOT )) .setContentText(i18n(R.string.sync_fail_content_unauthorized, getAccount().name)); } else { notificationBuilder + .setTicker(i18n(R.string.sync_fail_ticker)) + .setContentTitle(i18n(R.string.sync_fail_ticker)) .setContentText(i18n(R.string.sync_fail_content, getAccount().name)); }